【问题标题】:How to play music during call use Asterisk?如何在通话中使用 Asterisk 播放音乐?
【发布时间】:2017-09-08 14:39:14
【问题描述】:

我有一个问题: 在 Asterisk 脚本中,我通过命令 Dial(SIP/xxx) 执行从 A 到 B 的呼叫。 我想在 A 和 B 说话时播放音乐。

功能拨号仅支持音乐开始通话或结束通话: https://www.voip-info.org/wiki/view/Asterisk+cmd+Dial

如果你知道,请帮助我。

【问题讨论】:

    标签: asterisk asterisk-ari


    【解决方案1】:

    有两种可能的变体

    1) 在通话结束前的某个时间拨打命令 L 参数播放文件,带有重复选项

      L(x[:y[:z]]): 
            x - Maximum call time, in milliseconds
    
            y - Warning time, in milliseconds
    
            z - Repeat time, in milliseconds
    Limit the call to <x> milliseconds. Play a warning when <y> milliseconds
    are left. Repeat the warning every <z> milliseconds until time expires.
        This option is affected by the following variables:
            ${LIMIT_PLAYAUDIO_CALLER}: 
                yes
                no
                If set, this variable causes Asterisk to play the
                prompts to the caller.
            ${LIMIT_PLAYAUDIO_CALLEE}: 
                yes
                no
                If set, this variable causes Asterisk to play the
                prompts to the callee.
            ${LIMIT_TIMEOUT_FILE}: 
                filename
                If specified, <filename> specifies the sound prompt
                to play when the timeout is reached. If not set, the time remaining
                will be announced.
            ${LIMIT_CONNECT_FILE}: 
                filename
                If specified, <filename> specifies the sound prompt
                to play when the call begins. If not set, the time remaining will
                be announced.
            ${LIMIT_WARNING_FILE}: 
                filename
                If specified, <filename> specifies the sound prompt
                to play as a warning when time <x> is reached. If not set, the
                time remaining will be announced.
    

    2) 您可以通过 ChanSpy wisper 功能创建新频道,一条腿到文件,另一条腿连接到当前通话。 https://www.voip-info.org/wiki/view/Asterisk+cmd+ChanSpy

    【讨论】:

    • 谢谢,但是使用选项 1,只有接收者 (B) 听音乐或发送者 (A) 听音乐,并且当 A 正在听音乐时,不要互相交谈。
    • 是的,但这比选项 2 简单得多。Chanspy 可以同时与两者对话。
    • 我用的是通话组,A和B通话的时候,把C放到这个组里放音乐。可以,但我认为不是最好的。我正在使用 ChanSpy 进行测试,但它不起作用。我使用 Asterisk 11.x
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-25
    • 1970-01-01
    • 1970-01-01
    • 2011-07-22
    • 2018-12-27
    相关资源
    最近更新 更多