Freeswitch:向A-leg播放铃声,同时我们向被叫方B-leg播放一些消息

Freeswitch: play ringing tone to A-leg, while we play some message to called party B-leg

在 asterisk 拨号命令中 A(x): Play an announcement (x.gsm) to the called party. 可以向 b-leg 播放一些消息并且仍然让 a-leg 听到铃声。

我试过在freeswitch

_nolocal_execute_on_answer=playback <file>

bridge_pre_execute_bleg_app=playback bridge_pre_execute_bleg_data=<file>

我在桥接之前得到初始铃声。但是在 b-leg asnwer 之后,A-leg 只会获得无声音频,直到音频文件在 B-leg 上完成。我如何才能让 A-leg 仍然收到铃声,而只向 B-leg 播放一条消息?你的建议可能对我有很大帮助!

最好的方法是使用一些ESL编程来处理两个独立的呼叫段,然后在B方接听时将它们桥接在一起。

这里我有一个模拟类似场景的例子: https://github.com/xlab1/go-fs-secretary-prototype

https://github.com/xlab1/go-fs-secretary-prototype/blob/master/golang/secretary_server.go

第 49-53 行:回答 A leg 并回放 MOH(在你的情况下会是 ringback)

第95行:向B段拨出电话

第151行:向B腿播放消息并等待DTMF输入

第 156-162 行:根据 DTMF 输入,要么放弃 A 分支,要么将其与 B 分支桥接。

group_confirm_file 是在将呼叫桥接到 A 支路之前向被叫方播放消息的最佳选择

<action application="set" data="group_confirm_file=playback /path/to/prompt.wav"/> <action application="set" data="group_confirm_key=exec"/>

参考:FS-jira and FS-wiki