Example Outbound Macro

Example Outbound Macro: This is the outbound Macro I use, it helps with routing calls to different destinations based on where the call is going to. ie certain international calls can be sent to a different carrier, or toll free can be sent out through a different carrier. This example uses TelCommone, VoIPJet, NuFone, and a local ZAP phone line for Toll Free calls for outbound.


; OUTGOING

[macro-dial]
; ARG1 = ACCOUNTCODE (for CDR's, tracking/billing purposes)
; ARG2 = DESTINATION NUMBER
; ARG3 = MAX NUMBER OUTBOUND CHANNELS (CALLS)
; ARG4 = Custom Dial Arguments
; ARG5 = Custom Dial Arguments

exten => s,1,SetAccount(${ARG1})                        ; Sets Account Code
exten => s,2,SetGroup(${ARG1})                          ; Identifies Call
exten => s,3,CheckGroup(${ARG3})                        ; Enforce Limit
exten => s,4,GotoIf($[${LEN(${ARG2})} = 11]?201:5)      ; National (11 digits)
exten => s,5,GotoIf($[${ARG2:0:3} = 011]?401:6)         ; International through Tel Comm One then VoIPJet
exten => s,6,GotoIf($[${ARG2} = h]?10:7)                ; Special
exten => s,7,GotoIf($[${ARG2} = i]?10:8)                ; Special
exten => s,8,GotoIf($[${ARG2} = t]?10:9)                ; Special
exten => s,9,Background(invalid)
exten => s,10,Hangup
exten => s,104,Playback(all-circuits-busy-now)		; Too many outbound calls
exten => s,105,Congestion

exten => s,201,GotoIf($[${ARG2:1:3} = 800]?601:202)     ; National calls; Toll Free Filter
exten => s,202,GotoIf($[${ARG2:1:3} = 866]?601:203)	; Toll Free Filter
exten => s,203,GotoIf($[${ARG2:1:3} = 877]?601:204)	; Toll Free Filter
exten => s,204,GotoIf($[${ARG2:1:3} = 888]?601:205)	; Toll Free Filter
exten => s,205,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},${ARG5}o)	; First Tel Comm One (1.1 cents)
exten => s,206,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; Then VoIP Jet (1.3 cents)
exten => s,207,Dial(SIP/${ARG2}@nufone,${ARG4},${ARG5}o)		; Then NuFone (2 cents)
exten => s,208,Congestion						; Bad Number

exten => s,306,Goto(s,206)
exten => s,307,Goto(s,207)
exten => s,308,Goto(s,208)

exten => s,401,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},o${ARG5})	; International via Tel Comm One (generally cheaper)
exten => s,402,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; International backup via VoIPJet
exten => s,403,Playback(all-circuits-busy-now)				; Bad Number
exten => s,404,Congestion

exten => s,502,Goto(s,402)
exten => s,503,Goto(s,403)

exten => s,601,Dial(ZAP/${ARG2}@g1,${ARG4},${ARG5}o)			; Toll Free via ZAP group 1
exten => s,602,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},${ARG5}o)	; Toll Free via TelCommOne (1.1 cents)
exten => s,603,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; VoIP Jet Backup (1.3 cents)
exten => s,604,Dial(SIP/${ARG2}@nufone,${ARG4},${ARG5}o)           	; NuFone (2 cents)
exten => s,605,Congestion

exten => s,702,Goto(s,602)
exten => s,703,Goto(s,603)
exten => s,704,Goto(s,604)
exten => s,705,Goto(s,605)




See Also:

Example Outbound Macro: This is the outbound Macro I use, it helps with routing calls to different destinations based on where the call is going to. ie certain international calls can be sent to a different carrier, or toll free can be sent out through a different carrier. This example uses TelCommone, VoIPJet, NuFone, and a local ZAP phone line for Toll Free calls for outbound.


; OUTGOING

[macro-dial]
; ARG1 = ACCOUNTCODE (for CDR's, tracking/billing purposes)
; ARG2 = DESTINATION NUMBER
; ARG3 = MAX NUMBER OUTBOUND CHANNELS (CALLS)
; ARG4 = Custom Dial Arguments
; ARG5 = Custom Dial Arguments

exten => s,1,SetAccount(${ARG1})                        ; Sets Account Code
exten => s,2,SetGroup(${ARG1})                          ; Identifies Call
exten => s,3,CheckGroup(${ARG3})                        ; Enforce Limit
exten => s,4,GotoIf($[${LEN(${ARG2})} = 11]?201:5)      ; National (11 digits)
exten => s,5,GotoIf($[${ARG2:0:3} = 011]?401:6)         ; International through Tel Comm One then VoIPJet
exten => s,6,GotoIf($[${ARG2} = h]?10:7)                ; Special
exten => s,7,GotoIf($[${ARG2} = i]?10:8)                ; Special
exten => s,8,GotoIf($[${ARG2} = t]?10:9)                ; Special
exten => s,9,Background(invalid)
exten => s,10,Hangup
exten => s,104,Playback(all-circuits-busy-now)		; Too many outbound calls
exten => s,105,Congestion

exten => s,201,GotoIf($[${ARG2:1:3} = 800]?601:202)     ; National calls; Toll Free Filter
exten => s,202,GotoIf($[${ARG2:1:3} = 866]?601:203)	; Toll Free Filter
exten => s,203,GotoIf($[${ARG2:1:3} = 877]?601:204)	; Toll Free Filter
exten => s,204,GotoIf($[${ARG2:1:3} = 888]?601:205)	; Toll Free Filter
exten => s,205,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},${ARG5}o)	; First Tel Comm One (1.1 cents)
exten => s,206,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; Then VoIP Jet (1.3 cents)
exten => s,207,Dial(SIP/${ARG2}@nufone,${ARG4},${ARG5}o)		; Then NuFone (2 cents)
exten => s,208,Congestion						; Bad Number

exten => s,306,Goto(s,206)
exten => s,307,Goto(s,207)
exten => s,308,Goto(s,208)

exten => s,401,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},o${ARG5})	; International via Tel Comm One (generally cheaper)
exten => s,402,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; International backup via VoIPJet
exten => s,403,Playback(all-circuits-busy-now)				; Bad Number
exten => s,404,Congestion

exten => s,502,Goto(s,402)
exten => s,503,Goto(s,403)

exten => s,601,Dial(ZAP/${ARG2}@g1,${ARG4},${ARG5}o)			; Toll Free via ZAP group 1
exten => s,602,Dial(SIP/###PIN###${ARG2}@telcommone,${ARG4},${ARG5}o)	; Toll Free via TelCommOne (1.1 cents)
exten => s,603,Dial(IAX2/${ARG2}@voipjet,${ARG4},${ARG5}o)		; VoIP Jet Backup (1.3 cents)
exten => s,604,Dial(SIP/${ARG2}@nufone,${ARG4},${ARG5}o)           	; NuFone (2 cents)
exten => s,605,Congestion

exten => s,702,Goto(s,602)
exten => s,703,Goto(s,603)
exten => s,704,Goto(s,604)
exten => s,705,Goto(s,605)




See Also:

Created by: telcomm1, Last modification: Sun 07 of May, 2006 (20:24 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+