3 Star 23 Fork 13

大汉刺史 / freeswitch-lua-demo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
channel_answer.lua 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
大汉刺史 提交于 2019-03-26 16:10 . 添加呼出桥接
session:consoleLog("info","--进入channel_answer---------");
--目前这个文件只准备处理应答的情况
--只做呼出的时候录音,呼入的录音全部都是callcenter控制的。呼出的录音需要自行处理
--<action application="record_session" data="$${recordings_dir}/archive/${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
local recordings_dir=session:getVariable("recordings_dir"); --录音文件主目录
local destination_number=session:getVariable("destination_number");--呼出的号码
local caller_id_name=session:getVariable("sip_from_user");--拨出的坐席名称
local uuid=session:getVariable("uuid");--会话id
local recordFile=recordings_dir.."/"..destination_number.."/"..caller_id_name.."/"..uuid..".wav"
session:execute("record_session",recordFile);
local event = freeswitch.Event("CUSTOM", "NECO:CALLOUTANSWER");
event:addHeader("Caller-Orig-Caller-ID-Number",destination_number);
event:addHeader("Caller-Callee-ID-Number",caller_id_name);
event:addHeader("Unique-ID",uniqueId);
event:addHeader("variable_cc_record_filename",recordFile);
event:fire();
Lua
1
https://gitee.com/tianzhenjiu/freeswitch-lua-demo.git
git@gitee.com:tianzhenjiu/freeswitch-lua-demo.git
tianzhenjiu
freeswitch-lua-demo
freeswitch-lua-demo
master

搜索帮助