3

我很难确定是否有触发器或方法可以从Dial操作继续,以允许您检测呼叫是否已接听。似乎Dial直到hangup、busy 或 congested才响应。我错过了什么动作或事件来告诉我线路的另一端何时实际接听电话?希望有这样的东西可用,我只是想念:

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)
4

2 回答 2

3

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

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

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

于 2018-05-23T14:23:54.387 回答
1

您也可以在接听电话时执行 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
于 2018-08-15T21:11:29.737 回答