[Asterisk-Users] making * more like a normal pbx (ciscoata-186)

Reid A. Forrest reid at cvtelecom.com
Tue Jun 15 10:19:54 MST 2004


> -----Original Message-----
> From: asterisk-users-admin at lists.digium.com [mailto:asterisk-users-
> admin at lists.digium.com] On Behalf Of Robert Withrow
> Sent: Tuesday, June 15, 2004 12:32 PM
> To: Asterisk-users
> Subject: RE: [Asterisk-Users] making * more like a normal pbx (ciscoata-
> 186)
> 
> On Mon, 2004-06-14 at 19:34, Reid A. Forrest wrote:
> > I've done something similar at home, but made my dialplan such that I
> > can dial either 10 or 11 digits locally. I don't use a "throw away"
> > digit at all. Any 7, 10, or 11 digit call will be appropriately
> > mangled and sent out the PSTN / VoIP provider.
> 
> Sure would be nice to see that extensions.conf posted...
> 

Here you go. I'm afraid it's rather messy, as I'm in "just get the thing
working" mode, but I hope it can serve as a good example. It's a modified
version of the sample extensions.conf. There are a few bugs in it, since I'm
just starting to work through it.


[globals]
CONSOLE=Console/dsp              ; Console interface for demo
IAXINFO=myname:mypassword        ; IAXtel username/password
 
VP=IAX2/Kxxxxxxxxx at voicepulse    ; Voicepulse
VON=Zap/3                        ; Vonage adaptor is plugged into the TDM400
PSTN=Zap/4                       ; Bellsouth trunk

[macro-stdexten];
; 
; Standard extension macro:
;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;   ${ARG2} - Device(s) to ring 
; 
;exten => s,1,SetCallerID(13212063934)
exten => s,1,SetCIDName(Internal) 
exten => s,2,Dial(${ARG2},20)                 ; Ring for 20 secs max
exten => s,3,Voicemail(u${ARG1})              ; If unavailable, voicemail
exten => s,4,Goto(default,s,1)                ; If they press #, start over
exten => s,102,Voicemail(b${ARG1})            ; If busy, send to voicemail
exten => s,103,Goto(default,s,1)              
 
; Make an outbound call through Vonage
[macro-dialout-VON];
exten => s,1,Dial,${VON}/${ARG1}
exten => s,2,Congestion 
 
; Make an outbound call through Voicepulse
[macro-dialout-VP];
exten => s,1,SetCallerID("My Name" <(321) 555-1212>)
exten => s,2,Dial,${VP}/${ARG1} 
exten => s,3,Congestion 
 
;
; Outbound calls will default to Vonage, then roll over to
; Voicepulse if Vonage is either busy or can't complete the call
[macro-dialout-MULTI]; 
exten => s,1,SetCallerID("My Name" <(321) 555-1212)
exten => s,2,Dial,${VON}/${ARG1} 
exten => s,3,Dial,${VP}/${ARG1}  
exten => s,4,Congestion 

; This macro will dial out first using Voicepulse and then
; using IAXtel if VP isn't available
[macro-dialout-VP-IAXtel]
exten => s,1,SetCallerID("My Name" <(321) 555-1212)
exten => s,2,Dial,${VP}/${ARG1}
exten => s,3,Dial,IAX2/${IAXINFO}@iaxtel.com/${EXTEN}@iaxtel
exten => s,4,Congestion

; dials an internal extension and outside number simultaneously
; First to answer gets the call
[macro-dualextn];
exten => s,1,SetCallerID("My Name" <(321) 555-1212>)
exten => s,2,Dial(${ARG2}&${VP}/${ARG3},22)       
exten => s,3,Voicemail(u${ARG1})        
exten => s,4,Goto(default,s,1)  
exten => s,102,Voicemail(b${ARG1}) 
exten => s,103,Goto(default,s,1)    


;
; Inbound calls from VoicePulse
; 
[voicepulse]
exten => 3212063934,1,Goto(mainmenu,s,1)
 
; Inbound calls from Zaptel (either Vonage or PSTN)
[inbound] 
 
exten => s,1,Dial(SIP/510&Zap/1,23)
exten => s,2,Voicemail(u500) 
exten => s,3,Hangup 
exten => s,102,Voicemail(b500)
exten => s,103,Hangup 
 
; I only route inbound Voicepulse to this context
[mainmenu]
exten => s,1,Answer
exten => s,2,DigitTimeout(10)           ; Set Digit Timeout to 10 seconds
exten => s,3,ResponseTimeout(20)        ; Set Response Timeout to 20 seconds
exten => s,4,Wait(2) 
exten => s,5,Background(vm-extension)   ; Ask them for the extension they
want
 
exten => t,1,Hangup
 
; This is the default context for internal phones, both
; SIP and analog 
[default] 
 
include => internal-extn
 
; always route 7005554141 through Voicepulse
exten => 17005554141,1,Macro(dialout-VP,${EXTEN})
 
; IAXtel numbers (i.e. other 1700 numbers)
exten => _1700NXXXXXX,1,Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN}@iaxtel)
 
; toll free numbers are routed first through VP then through IAXtel
exten => _1800NXXXXXX,1,Macro(dialout-VP-IAXtel,${EXTEN})
exten => _1855NXXXXXX,1,Macro(dialout-VP-IAXtel,${EXTEN})
exten => _1866NXXXXXX,1,Macro(dialout-VP-IAXtel,${EXTEN})
exten => _1877NXXXXXX,1,Macro(dialout-VP-IAXtel,${EXTEN})
exten => _1888NXXXXXX,1,Macro(dialout-VP-IAXtel,${EXTEN})


include => outbound-dial

exten => h,1,Hangup


; rules for outbound dialing
[outbound-dial] 
 
; block 900 numbers
exten => _1900NXXXXXX,1,Congestion
exten => _1976NXXXXXX,1,Congestion
exten => _976XXXX,1,Congestion 
 
; Here is our local dialing plan
; 
exten => _1NXXNXXXXXX,1,Macro(dialout-MULTI,${EXTEN})
exten => _407NXXXXXX,1,Macro(dialout-MULTI,1${EXTEN})
exten => _321NXXXXXX,1,Macro(dialout-MULTI,1${EXTEN})
 
; If I dial a 9 first, the call will go out through Voicepulse
exten => _91NXXNXXXXXX,1,Macro(dialout-VP,${EXTEN:1})
exten => _9NXXNXXXXXX,1,Macro(dialout-VP,1${EXTEN:1})
exten => _9407NXXXXXX,1,Macro(dialout-VP,1${EXTEN:1})
exten => _9321NXXXXXX,1,Macro(dialout-VP,1${EXTEN:1})
 
[internal-extn]
 
; Extension 500 is port 1 on the ATA-186. It uses voice mailbox 500
exten => 500,1,Macro(stdexten,500,SIP/500) 
 
; Second port on the ATA-186
exten => 510,1,Macro(stdexten,510,SIP/510)

; Reid's soft phone. Simultaneously rings my cell phone
;exten => 520,1,Macro(dualextn,520,SIP/520,13215551212)






More information about the asterisk-users mailing list