Ai
1 Star 5 Fork 6

lidedongsn/FreeSWITCH-Scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
gen_dir_user_xml.lua 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
lidedongsn 提交于 2016-09-29 15:36 +08:00 . first commit
-- FreeSWITCH directory lua exmaple
-- QQ: 1053481745
freeswitch.consoleLog("notice", "Debug from gen_dir_user_xml.lua, provide params:\n"..params:serialize().."\n")
local req_domain = params:getHeader("domain")
local req_key = params:getHeader("key")
local req_user = params:getHeader("user")
if req_user==nil then
req_user="1001";
end
XML_STRING =
[[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="directory">
<domain name="]]..req_domain..[[">
<user id="]]..req_user..[[">
<params>
<param name="password" value="123456"/>
<param name="vm-password" value="]]..req_user..[["/>
<param name="dial-string" value="{sip_invite_domain=${dialed_domain},presence_id=$={dialed_user}@${dialed_domain}}${sofia_contact(${dialed_user}@${dialed_domain})}"/>
</params>
<variables>
<variable name="toll_allow" value="domestic, international,local"/>
<param name="accountcode" value="]]..req_user..[["/>
<variable name="user_context" value="default"/>
<param name="effective_caller_id_number" value="]]..req_user..[["/>
<param name="effective_caller_id_name" value="Extension]]..req_user..[["/>
<variable name="outbound_caller_id_name" value="Extension 5678"/>
<variable name="outbound_caller_id_number" value="5678"/>
<variable name="callgroup" value="techsupport"/>
</variables>
</user>
</domain>
</section>
</document>]]
--commment the following line for production:
freeswitch.consoleLog("notice", "Debug from gen_dir_user_xml.lua, generated XML:\n"..XML_STRING.."\n")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Lua
1
https://gitee.com/lidecoolblue/FreeSWITCH-Scripts.git
git@gitee.com:lidecoolblue/FreeSWITCH-Scripts.git
lidecoolblue
FreeSWITCH-Scripts
FreeSWITCH-Scripts
master

搜索帮助