我需要的是在呼叫应答时启动音效文件回放,并从被叫方检测出嘟嘟声。
我试过的是:
但是当背景播放开始时,avmd会暂停,然后继续播放。
网关拨号计划是:
<extension name="mytelco">
<condition field="destination_number" expression="^987(\d+)$">
<action application="set" data="effective_caller_id_number=46xxxxxxxx"/>
<param name="caller-id-in-from" value="true"/>
<action application="set" data="record_link=${strftime(%Y-%m-%d-%H-%M-%S)}_${destination_number}_${caller_id_number}.wav"/>
<action application="record_session" data="/var/www/html/freeswitch/recordings/${record_link}"/>
<action application="lua" data="/etc/freeswitch/scripts/beep_detection-from-call-v0.1.2.lua $1 ${record_link}"/>
<action application="hangup"/>
</condition>
</extension>
文件beep_detection V0.1.2.lua
#!/usr/local/bin/lua
DNID = argv[1]
if session:ready() then
session:sleep(1000)
session:execute("avmd_start", "inbound_channel=1,outbound_channel=0,sample_n_continuous_streak=10,sample_n_to_skip=0,debug=1,report_status=1")
session:execute("bridge", "{execute_on_answer=lua /etc/freeswitch/scripts/on_answer-v0.3.lua " .. uuid .. "}sofia/gateway/mytelco/" .. DNID)
session:execute("avmd_stop","")
end --if
文件on_v0.3lua
#!/usr/bin/lua
uuid_original = argv[1]
api = freeswitch.API()
reply = api:executeString("bgapi uuid_broadcast " .. uuid_original .. " /usr/share/asterisk/sounds/en/dennis-ivan.gsm both")
freeswitch.consoleLog("INFO","==============================================")
freeswitch.consoleLog("INFO","API reply is:" .. reply)
freeswitch.consoleLog("INFO","==============================================")
发布于 2020-04-17 14:53:34
我不确定你是不是有和我一样的问题。我升级到了Freeswitch的最新版本(目前为1.10),我的AVMD停止了您所描述的类似方式的工作。我把头撞在墙上几个星期。令人烦恼的是,修复方法是删除sample_n_to_skip=0
。
希望这也能解决你的问题。
https://stackoverflow.com/questions/58235598
复制相似问题