Extension Macro
From Etel
[edit]
Extension Macro
[edit]
Problem
Dialing an extension can have many results, some installations do not allow users to have voicemail and this creates a complex dial plan
[edit]
Solution
Clean it up with a Macro
[edit]
Macro
[macro-exten]
; This macro takes two arguments, the first is the extension and the second
; is the device. The first step is to dail the device and if dialing was
; not sucsessful then use the status of the Dial() application to choose
; the next corse of action in the form of an extension named named by the
; combination of "ext-" and the Dial() status variable.
;
; NOANSWER
; This is for calls that did not answer the ringing phone
;
; BUSY
; This if for busy calls
;
; CHANUNAVAIL
; This is for extensions that don't exist
; Softphones that are not registered will need tested against this
;
; CONGESTION
; This is when a phone is set to Do Not Disturb (DND)
;
; DONTCALL
; This is when a channel is set to Do Not Disturb (DND)
;
; Any other statuses are captured hungup on if local and sent to the IVR if
; they came from the inbound context
;
exten => s,1,Dial(${ARG2},20)
exten => s,2,Goto(ext-${DIALSTATUS},1)
exten => ext-NOANSWER,1,MailboxExists(${ARG1})
exten => ext-NOANSWER,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?vm)
exten => ext-NOANSWER,n,Background(reciver_unav)
exten => ext-NOANSWER,n,Goto(handle,1)
exten => ext-NOANSWER,n(vm),Voicemail(${ARG1},u)
exten => ext-NOANSWER,n,Goto(handle,1)
exten => ext-BUSY,1,MailboxExists(${ARG1})
exten => ext-BUSY,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?vm)
exten => ext-BUSY,n,Background(reciver_busy)
exten => ext-BUSY,n,Goto(handle,1)
exten => ext-BUSY,n,Voicemail(${ARG1},b)
exten => ext-BUSY,n,Goto(handle,1)
exten => ext-CHANUNAVAIL,1,Background(invalid_ext)
exten => ext-CHANUNAVAIL,n,Goto(handle,1)
exten => ext-CONGESTION,1,Goto(ext-BUSY,1)
exten => _ext-.,1,Goto(handle,1)
exten => handle,1,GotoIf($["${MACRO_CONTEXT}" = "default"]?3)
exten => handle,2,Goto(inbound,s,1)
exten => handle,3,Hangup
[edit]
Discussion
[edit]
See Also:
[edit]
Metadata
- By: Andrew "lathama" Latham AndrewLatham
