在Asterisk呼叫挂断时,呼叫将被路由到转发/语音邮件

时间:2016-02-02 05:21:52

标签: asterisk voip

我在Asterisk遇到问题。一旦甲方呼叫乙方呼叫成功路由到乙方,呼叫应答。一旦B方(接收方)挂断电话,突然呼叫路由到B方移动电话(如果转发已启用)或语音邮件。请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

您应该更改拨号方案以分析挂断原因或通话时间,如果没有,则不要转到语音信箱。该代码的示例包含在随任何星号安装提供的extensions.conf.sample中。

[stdexten]
;
; Standard extension subroutine:
;   ${EXTEN} - Extension
;   ${ARG1} - Device(s) to ring
;   ${ARG2} - Optional context in Voicemail
;
; Note that the current version will drop through to the next priority in the
; case of their pressing '#'.  This gives more flexibility in what do to next:
; you can prompt for a new extension, or drop the call, or send them to a
; general delivery mailbox, or...
;
; The use of the LOCAL() function is purely for convenience.  Any variable
; initially declared as LOCAL() will disappear when the innermost Gosub context
; in which it was declared returns.  Note also that you can declare a LOCAL()
; variable on top of an existing variable, and its value will revert to its
; previous value (before being declared as LOCAL()) upon Return.
;
exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})})
exten => _X.,n,Dial(${dev},20)                          ; Ring the interface, 20 seconds maximum
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1)           ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u)        ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,Return()                   ; If they press #, return to start

exten => stdexten-BUSY,1,Voicemail(${mbx},b)            ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,Return()                       ; If they press #, return to start

exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1)    ; Treat anything else as no answer

exten => a,1,VoicemailMain(${mbx})                      ; If they press *, send the user into VoicemailMain
exten => a,n,Return()