[Asterisk-Users] Sample advanced call routing standard extension
Eric Wieling
eric at fnords.org
Fri Oct 15 11:26:12 MST 2004
[default]
;
; Eric Wieling
;
exten => 2120,1,SetVar(DND=)
exten => 2120,2,SetVar(CFU_DEST=)
exten => 2120,3,SetVar(CFU_TIMEOUT=)
exten => 2120,4,SetVar(CFU_MESSAGE=)
exten => 2120,5,SetVar(CFU_FLAGS=)
exten => 2120,6,SetVar(CFU_LIMIT=)
exten => 2120,7,SetVar(DIAL_DEST=Zap/2)
exten => 2120,8,SetVar(DIAL_TIMEOUT=15)
exten => 2120,9,SetVar(DIAL_FLAGS=)
exten => 2120,10,SetVar(DIAL_LIMIT=1)
exten => 2120,11,SetVar(CFNA_DEST=)
exten => 2120,12,SetVar(CFNA_TIMEOUT=)
exten => 2120,13,SetVar(CFNA_MESSAGE=)
exten => 2120,14,SetVar(CFNA_FLAGS=)
exten => 2120,15,SetVar(CFNA_LIMIT=1)
exten => 2120,16,SetVar(CFBL_DEST=)
exten => 2120,17,SetVar(CFBL_TIMEOUT=)
exten => 2120,18,SetVar(CFBL_MESSAGE=)
exten => 2120,19,SetVar(CFBL_FLAGS=)
exten => 2120,20,SetVar(CFBL_LIMIT=)
exten => 2120,21,SetVar(OPER_DEST=${COLISEUM}/2221&${ORMOND}/95042325606)
exten => 2120,22,SetVar(OPER_TIMEOUT=20)
exten => 2120,23,SetVar(OPER_MESSAGE=)
exten => 2120,24,SetVar(OPER_FLAGS=)
exten => 2120,25,SetVar(OPER_LIMIT=)
exten => 2120,26,Macro(std-exten)
[macro-std-exten]
;
; This macro is controlled by the following variables set before the macro
; is called. The variables can be set using SetVar, DBGet, AGI, web based
; CGI script, manager interface, government mind control rays, etc. How
; they are set is up to you.
;
; MOH_CLASS - Music on Hold Class. Set the music on hold class to this
; value. If empty, don't change the current MOH class.
;
; DND - Do Not Disturb. If this variable is not empty, then send call
; directly to unavailable voicemail. Example: SetVar(DND=1) or
; SetVar(DND=blah) or SetVar(DND=)
;
; DND_MESSAGE - When DND is set, play this audio file before going to
; unavailable voicemail. Example:
SetVar(DND_MESSAGE=/tmp/happy-message) or
; SetVar(DND_MESSAGE=)
;
; CFU_DEST - Call Forward Unconditional. If set, unconditionally dial
; this destination. If empty, don't Call Forward Unconditionaly.
Example:
; SetVar(CFU_DEST=IAX2/bob at fnords/1234) or SetVar(CFU_DEST=)
;
; CFU_TIMEOUT - When dialing CFU_DEST, how many seconds to wait before
; giving up and going to unavailable voicemail. If empty or 0, never
; timeout. Example: SetVar(CFU_TIMEOUT=20)
;
; CFU_MESSAGE - When dialing CFU_DEST, play this audio file to the caller
; first. If empty, don't play anything. Example:
; SetVar(CFU_MESSAGE=/tmp/happy-message) or SetVar(CFU_MESSAGE=)
;
; CFU_FLAGS - When dialing CFU_DEST, use this variable as the optons on to
; the Dial command. If empty, use the default Dial flags. Example:
; SetVar(CFU_FLAGS=mH) or SetVar(CFU_FLAGS=)
;
; CFU_LIMIT - When dialing CFU_DEST, this is the maximum number of
; simultaneous calls to allow. If empty or 0, allow unlimited
simultaneous
; calls. Example: SetVar(CFU_LIMIT=1) or SetVar(CFU_LIMIT=)
;
; DIAL_DEST - If DND and CFU_DEST are not set, dial this destination. If
; empty go to unavailable voicemail. If all the destinations are busy
dial
; CFBL_DEST. Example: SetVar(CFU_DEST=IAX2/bob at fnords/1234) or
; SetVar(CFU_DEST=SIP/1234&Zap/4)
;
; DIAL_TIMEOUT - How many seconds to wait before giving up and trying
; Call Forward No Answer. If empty or 0, never timeout. Example:
; SetVar(DIAL_TIMEOUT=20)
;
; DIAL_FLAGS - Use this variable as the optons on to the Dial command. If
; empty, use the default Dial flags. Example: SetVar(DIAL_FLAGS=mH) or
; SetVar(DIAL_FLAGS=)
;
; CFNA_DEST - Call Forward No Answer. If DIAL_TIMEOUT expires when
; dialing DIAL_DEST (call was not answered) then dial this destination. If
; empty, don't Call Forward No Answer and go directly to unavailable
; voicemail. If all destinations are busy go directly to unavailable
; voicemail. Example: SetVar(CFNA_DEST=IAX2/bob at fnords/1234) or
; SetVar(CFU_DEST=SIP/1234&Zap/4) or SetVar(CFNA_DEST=)
;
; CFNA_TIMEOUT - When dialing CFNA_DEST, how many seconds to wait before
; giving up and going to unavailable voicemail. If empty or 0, never
; timeout. Example: SetVar(CFNA_TIMEOUT=20)
;
; CFNA_MESSAGE - Before dialing CFNA_DEST, play this audio file to the
; caller first. If empty, don't play anything. Example:
; SetVar(CFNA_MESSAGE=/tmp/happy-message) or SetVar(CFNA_MESSAGE=)
;
; CFNA_FLAGS - When dialing CFNA_DEST, use this variable as the optons on
; to the Dial command. If empty, use the default Dial flags. Example:
; SetVar(CFNA_FLAGS=mH) or SetVar(CFNA_FLAGS=)
;
; CFNA_LIMIT - When dialing CFNA_DEST, this is the maximum number of
; simultaneous calls to allow. If empty or 0, allow unlimited
simultaneous
; calls. Example: SetVar(CFNA_LIMIT=1) or SetVar(CFNA_LIMIT=)
;
; CFBL_DEST - Call Forward Busy Line. If destination is busy when dialing
; DIAL_DEST then dial this destination. If empty, don't Call Forward Busy
; Line and go directly to busy voicemail. Example:
; SetVar(CFBL_DEST=IAX2/bob at fnords/1234) or
SetVar(CFBL_DEST=SIP/1234&Zap/4)
; or SetVar(CFBL_DEST=)
;
; CFBL_TIMEOUT - When dialing CFBL_DEST, how many seconds to wait before
; giving up and going to busy voicemail. If empty or 0, never timeout.
; Example: SetVar(CFBL_TIMEOUT=20)
;
; CFBL_MESSAGE - Before dialing CFBL_DEST, play this audio file to the
; caller first. If empty, don't play anything. Example:
; SetVar(CFBL_MESSAGE=/tmp/happy-message) or SetVar(CFBL_MESSAGE=)
;
; CFBL_FLAGS - When dialing CFBL_DEST, use this variable as the optons on
; to the Dial command. If empty, use the default Dial flags. Example:
; SetVar(CFBL_FLAGS=mH) or SetVar(CFBL_FLAGS=)
;
; CFBL_LIMIT - When dialing CFBL_DEST, this is the maximum number of
; simultaneous calls to allow. If empty or 0, allow unlimited
simultaneous
; calls. Example: SetVar(CFBL_LIMIT=1) or SetVar(CFBL_LIMIT=)
;
; OPER_DEST - Operator Destination. When a caller presses "0" during
; the voicemail greeting, dial this destination. If all destinations are
; busy go back to VoicemailMain. If empty tell the caller "Invalid
Option"
; when they press "0" during the voicemail greeting and go back to
; VoicemailMain. Exmaple: SetVar(CFBL_DEST=IAX2/bob at fnords/1234) or
; SetVar(CFBL_DEST=SIP/1234&Zap/4) or SetVar(CFBL_DEST=)
;
; OPER_TIMEOUT - When dialing OPER_DEST, how many seconds to wait
; before giving up and going to unavailable voicemail. If empty or 0,
never
; timeout. Example: SetVar(OPER_TIMEOUT=20)
;
; OPER_MESSAGE - Before dialing OPER_DEST, play this audio file to
; the caller first. If empty, don't play anything. Example:
; SetVar(OPER_MESSAGE=/tmp/happy-message) or SetVar(OPER_MESSAGE=)
;
; OPER_FLAGS - When dialing OPER_DEST, use this variable as the
; optons on to the Dial command. If empty, use the default Dial flags.
; Example: SetVar(OPER_FLAGS=mH) or SetVar(OPER_FLAGS=)
;
; OPER_LIMIT - When dialing OPER_DEST, this is the maximum number
; of simultaneous calls to allow. If empty or 0, allow unlimited
; simultaneous calls. Example: SetVar(OPER_LIMIT=1) or
; SetVar(OPER_LIMIT=)
;
exten => s,1,SetVar(SAVED_EXTEN=${MACRO_EXTEN})
exten => s,2,SetVar(SAVED_CONTEXT=${MACRO_CONTEXT})
exten => s,3,GotoIf($[${LEN(${DIAL_DEST})} = 0]?s-NOANSWER,12:4)
exten => s,4,GotoIf($[${LEN(${DND})} = 0]?5:s-dnd,1)
exten => s,5,GotoIf($[${LEN(${MOH_CLASS})} = 0]?7:6)
exten => s,6,SetMusicOnHold(${MOH_CLASS})
exten => s,7,GotoIf($[${LEN(${CFU_DEST})} = 0]?8:s-cfu,1)
exten => s,8,GotoIf($[${DIAL_TIMEOUT} = 0]?9:10)
exten => s,9,SetVar(DIAL_TIMEOUT=)
exten => s,10,GotoIf($[${LEN(${DIAL_LIMIT})} = 0]?14:11)
exten => s,11,GotoIf($[${DIAL_LIMIT} = 0]?14:12)
exten => s,12,SetGroup(${SAVED_EXTEN}-DIAL_LIMIT)
exten => s,13,CheckGroup(${CFNA_LIMIT})
exten => s,14,SetVar(DESTINATION=${DIAL_DEST}) ;Placeholder for future
macro
exten => s,15,Dial(${DESTINATION},${DIAL_TIMEOUT},${DIAL_FLAGS})
exten => s,16,Goto(s-${DIALSTATUS},1)
exten => s,114,Goto(s-BUSY,1)
exten => s-NOANSWER,1,GotoIf($[${LEN(${CFNA_DEST})} = 0]?12:2)
exten => s-NOANSWER,2,GotoIf($[${CFNA_TIMEOUT} = 0]?3:4)
exten => s-NOANSWER,3,SetVar(CFNA_TIMEOUT=)
exten => s-NOANSWER,4,GotoIf($[${LEN(${CFNA_LIMIT})} = 0]?8:5)
exten => s-NOANSWER,5,GotoIf($[${CFNA_LIMIT} = 0]?8:6)
exten => s-NOANSWER,6,SetGroup(${SAVED_EXTEN}-CFNA_LIMIT)
exten => s-NOANSWER,7,CheckGroup(${CFNA_LIMIT})
exten => s-NOANSWER,8,GotoIf($[${LEN(${CFNA_MESSAGE})} = 0]?10:9)
exten => s-NOANSWER,9,Playback(${CFNA_MESSAGE})
exten => s-NOANSWER,10,SetVar(DESTINATION=${CFNA_DEST}) ;Placeholder
for future macro
exten => s-NOANSWER,11,Dial(${DESTINATION},${CFNA_TIMEOUT},${CFNA_FLAGS})
exten => s-NOANSWER,12,Voicemail(u${SAVED_EXTEN})
exten => s-NOANSWER,13,Hangup
exten => s-NOANSWER,108,Goto(12)
exten => s-BUSY,1,GotoIf($[${LEN(${CFBL_DEST})} = 0]?12:2)
exten => s-BUSY,2,GotoIf($[${CFBL_TIMEOUT} = 0]?3:4)
exten => s-BUSY,3,SetVar(CFBL_TIMEOUT=)
exten => s-BUSY,4,GotoIf($[${LEN(${CFBL_LIMIT})} = 0]?8:5)
exten => s-BUSY,5,GotoIf($[${CFBL_LIMIT} = 0]?8:6)
exten => s-BUSY,6,SetGroup(${SAVED_EXTEN}-CFBL_LIMIT)
exten => s-BUSY,7,CheckGroup(${CFBL_LIMIT})
exten => s-BUSY,8,GotoIf($[${LEN(${CFBL_MESSAGE})} = 0]?10:9)
exten => s-BUSY,9,Playback(${CFBL_MESSAGE})
exten => s-BUSY,10,SetVar(DESTINATION=${CFBL_DEST}) ;Placeholder for
future macro
exten => s-BUSY,11,Dial(${DESTINATION},${CFBL_TIMEOUT},${CFBL_FLAGS})
exten => s-BUSY,12,Voicemail(b${SAVED_EXTEN})
exten => s-BUSY,13,Hangup
exten => s-BUSY,108,Goto(12)
exten => s-cfu,1,GotoIf($[${LEN(${CFU_DEST})} = 0]?12:2)
exten => s-cfu,2,GotoIf($[${CFU_TIMEOUT} = 0]?3:4)
exten => s-cfu,3,SetVar(CFU_TIMEOUT=)
exten => s-cfu,4,GotoIf($[${LEN(${CFU_LIMIT})} = 0]?8:5)
exten => s-cfu,5,GotoIf($[${CFU_LIMIT} = 0]?8:6)
exten => s-cfu,6,SetGroup(${SAVED_EXTEN}-CFU_LIMIT)
exten => s-cfu,7,CheckGroup(${CFU_LIMIT})
exten => s-cfu,8,GotoIf($[${LEN(${CFU_MESSAGE})} = 0]?10:9)
exten => s-cfu,9,Playback(${CFU_MESSAGE})
exten => s-cfu,10,SetVar(DESTINATION=${CFU_DEST}) ;Placeholder for
future macro
exten => s-cfu,11,Dial(${DESTINATION},${CFU_TIMEOUT},${CFU_FLAGS})
exten => s-cfu,12,Voicemail(u${SAVED_EXTEN})
exten => s-cfu,13,Hangup
exten => s-cfu,108,Goto(12)
exten => s-dnd,1,GotoIf($[${LEN(${DND_MESSAGE})} = 0]?3:2)
exten => s-dnd,2,Playback(${DND_MESSAGE})
exten => s-dnd,3,Voicemail(u${SAVED_EXTEN})
exten => s-dnd,4,Hangup
exten => s-CHANUNAVAIL,1,Goto(s-NOANSWER,1)
exten => s-CONGESTION,1,Goto(s-NOANSWER,1)
exten => s-CANCEL,1,Goto(s-NOANSWER,1)
exten => s-ANSWERED,1,Hangup()
exten => a,1,VoicemailMain()
exten =>
o,1,GotoIf($[${LEN(${OPER_DEST})} = 0]?2:4)
exten => o,2,Playback(conf-errormenu)
exten => o,3,Goto(14)
exten => o,4,GotoIf($[${OPER_TIMEOUT} = 0]?5:6)
exten => o,5,SetVar(OPER_TIMEOUT=)
exten => o,6,GotoIf($[${LEN(${OPER_LIMIT})} = 0]?10:7)
exten => o,7,GotoIf($[${OPER_LIMIT} = 0]?10:8)
exten => o,8,SetGroup(${SAVED_EXTEN}-OPER_LIMIT)
exten => o,9,CheckGroup(${OPER_LIMIT})
exten => o,10,GotoIf($[${LEN(${OPER_MESSAGE})} = 0]?12:11)
exten => o,11,Playback(${OPER_MESSAGE})
exten => o,12,SetVar(DESTINATION=${OPER_DEST}) ;Placeholder for future
macro
exten => o,13,Dial(${DESTINATION},${OPER_TIMEOUT},${OPER_FLAGS})
exten => o,14,Voicemail(u${SAVED_EXTEN})
exten => o,15,Hangup
exten => o,110,Goto(14)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eric.vcf
Type: text/x-vcard
Size: 146 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20041015/d5a4c2da/eric.vcf
More information about the asterisk-users
mailing list