All pastes #344879 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-02-08 02:09 UTC
rendered paste body
[macro-stdexten]
;===============
;
; Standard extension macro:
;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;   ${ARG2} - Device(s) to ring
;   ${ARG3} - Dial command arguments
;
exten => s,1,Set(temp=${DB(CFU/${ARG1})})       ; Get CFU key
exten => s,2,GotoIf($["${temp}" = ""]?5)        ; If not existing, ring the interface
exten => s,3,Dial(Local/${temp}@default/n)      ; Unconditional Forward
exten => s,4,Voicemail(u${ARG1})                ; If CFU failed, send to voicemail w/ unavail announce
exten => s,5,Dial(${ARG2},${RING-TIMEOUT},${ARG3})           ; Ring the interface, 30 seconds maximum
exten => s,6,Goto(s-${DIALSTATUS},1)            ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,AN
SWER)

exten => s-NOANSWER,1,Set(temp=${DB(CFNA/${ARG1})})     ; Get CFNA key
exten => s-NOANSWER,2,GotoIf($["${temp}" = ""]?4)       ; If not existing, goto voicemail
exten => s-NOANSWER,3,Dial(Local/${temp}@default/n)     ; Forward on No Answer
exten => s-NOANSWER,4,Voicemail(u${ARG1})       ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,5,Goto(s,5)                 ; If they press #, return to ring the interface

exten => s-BUSY,1,Set(temp=${DB(CFB/${ARG1})})  ; Get CFB key
exten => s-BUSY,2,GotoIf($["${temp}" = ""]?4)   ; If not existing, goto voicemail
exten => s-BUSY,3,Dial(Local/${temp}@default/n) ; Forward on Busy
exten => s-BUSY,4,Voicemail(b${ARG1})           ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,5,Goto(s,5)                     ; If they press #, return to ring the interface

exten => _s-.,1,Goto(s-NOANSWER,1)              ; Treat anything else as no answer

exten => a,1,VoicemailMain(${ARG1}@default)     ; If they press *, send the user into VoicemailMain