【发布时间】:2020-03-06 16:50:43
【问题描述】:
我正在从 WebRTC 浏览器和 SIP 客户端发起呼叫,并希望在呼叫通过 PTSN 桥接到另一方后使用 never_playback 播放 .wav 文件。我尝试了两件事,但都不行。
a) 使用拨号方案
<action application="endless_playback" data="the path of wav file"/> //option 1
<action application="bridge" data="the call info"/>
<action application="endless_playback" data="the path of wav file"/> //option 2
问题在于,在选项 1 中,文件播放但呼叫从未桥接,而在选项 2 中,文件在接收呼叫挂断后播放。
b) 使用 LUA 脚本
local TheSound = "the path of the wav file"
if (session:ready() == true) then
session:execute("playback", TheSound)
end
这似乎更有可能奏效,但它没有因为我需要在桥接发生后执行播放。
我想我需要把LUA脚本行改成下面的伪代码
listen for call connected event and then
session:execute("playback", TheSound)
我该怎么做?
【问题讨论】:
标签: lua freeswitch