1 Star 0 Fork 14

poseidon2011/freeswitch-lua-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
onreg.lua 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
tianzhenjiu 提交于 2019-03-20 17:11 . 更改
--{"Event-Subclass":"sofia::unregister","Event-Name":"CUSTOM","Core-UUID":"69b8d28c-3ff9-11e9-8f2f-d91fe25a972c","FreeSWITCH-Hostname":"localhost.localdomain","FreeSWITCH-Switchname":"localhost.localdomain","FreeSWITCH-IPv4":"192.168.31.120","FreeSWITCH-IPv6":"::1","Event-Date-Local":"2019-03-07 15:35:08","Event-Date-GMT":"Thu, 07 Mar 2019 07:35:08 GMT","Event-Date-Timestamp":"1551944108881593","Event-Calling-File":"sofia_reg.c","Event-Calling-Function":"sofia_reg_handle_register_token","Event-Calling-Line-Number":"2156","Event-Sequence":"16148","profile-name":"internal","username":"1002","from-user":"1002","from-host":"192.168.31.120","contact":"\"1002\" <sip:1002@192.168.31.133:53412;rinstance=a55f8e8760624d5a>","call-id":"Yzg3NWI4Mzc4ZTNlZTBlZWI0MjE2Mzk4OGY2NGU3MTM.","rpid":"unknown","realm":"192.168.31.120","network-ip":"192.168.31.133","network-port":"53412","user-agent":"eyeBeam release 1011d stamp 40820","expires":"0"}
local username=event:getHeader("username");
if(username ==nil)then
return "break";
end;
freeswitch.consoleLog("info",username.."注册");
local api=freeswitch.API();
local cmd="callcenter_config agent set status "..username.." 'Available'";
freeswitch.consoleLog("info","执行命令"..cmd);
--local reply=api:executeString(cmd);
--freeswitch.consoleLog("info","执行callcenter上线结果结果"..reply);
if(allagent == nil)then
allagent={};
end
allagent[username]=username;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Lua
1
https://gitee.com/poseidon2011/freeswitch-lua-demo.git
git@gitee.com:poseidon2011/freeswitch-lua-demo.git
poseidon2011
freeswitch-lua-demo
freeswitch-lua-demo
master

搜索帮助