星号拨号方案:如何检测呼叫成功应答的时间?

时间:2018-05-23 03:15:09

标签: asterisk asteriskami freepbx dialplan

我很难确定是否有触发器或方法继续拨号操作,以便您检测是否已接听电话。在挂断,忙碌或拥挤之前,拨号似乎无法响应。我错过了什么动作或事件会告诉我线路的另一端何时实际接听电话?希望有这样的东西,我只是缺少:

exten => s,7,Dial(${ARG1},20,rt)       ; Ring the interface, 20 seconds maximum
exten => s,8,Goto(s-${DIALSTATUS},1)                    
; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-ANSWER(do something)

2 个答案:

答案 0 :(得分:0)

终于明白了。它涉及在拨号操作调用中调用 M 标志。通过调用 M 标志,您可以调用在连接/应答呼叫后立即执行的自定义宏。

Ex:拨号(SIP / 200,60,M(myCustomMacro))

希望这对任何同样好奇的人都有帮助。

答案 1 :(得分:0)

您也可以在接听电话时进行Gosub操作

asterisk*cli> core show application Dial
...
    U(x[^arg[^...]]):
        x - Name of the subroutine to execute via Gosub
        arg - Arguments for the Gosub routine
Execute via Gosub the routine <x> for the *called* channel before connecting to
the calling channel. Arguments can be specified to the Gosub using '^' as a
delimiter. The Gosub routine can set the variable ${GOSUB_RESULT} to specify
the following actions after the Gosub returns