[英]Asterisk Dialplan: How to detect when a call has been successfully answered?
我很難確定撥號操作是否存在觸發器或繼續操作的方法,該方法可以讓您檢測呼叫是否已應答。 似乎Dial在掛斷,忙碌或擁擠之前沒有響應。 我缺少什么動作或事件可以告訴我該線路的另一端何時實際接聽電話? 希望我缺少這樣的東西:
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)
終於想通了。 它涉及在“ 撥號”操作調用中調用M標志。 通過調用M標志,您可以調用自定義宏,該宏將在連接/應答呼叫后立即執行。
例如: 撥號(SIP / 200,60,M(myCustomMacro))
希望這對任何好奇的人有所幫助。
您也可以在接聽電話時進行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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.