[Asterisk-Users] Asterisk as a Gateway

James Sizemore james at deny.org
Thu Dec 29 07:39:50 MST 2005


Nitesh Divecha wrote:
 > Are there any examples of dial plans? Like how to make the default
 > context?
 >
 > I just need a kick start on the config part, as I am really  struggling
 > on routing the calls.
 >


Here is a very very simple example using a PRI. You will need more error 
routing in a real dial plan:

extensions.conf:
[general]
static=yes
writeprotect=no
country=us

[local]
include => default

[globals]
TRUNK=Zap/g1
LDTRUNK=Zap/g2

[trunk]
;Long distance pstn
exten => _1NXXNXXXXXX,1,Dial(${LDTRUNK}/${EXTEN})
exten => _1NXXNXXXXXX,2,Hangup

;pstn
exten => _X.,1,Dial(${TRUNK}/${EXTEN})
exten => _X.,2,Hangup

[default-out]
;This is where you sent trusted calls from sip.conf out to pstn
include => trunk

[default]
;you send incoming pstn calls here as well as untrusted voip calls.
;here you would route call to local numbers you own via enum or static.
exten => 6153247060,1,Wait(2)   ; you need to wait
                                 ; long enough to get
                                 ; CNAM off line
;send incoming call to your register server.
exten => 5555554444,2,Dial(SIP/5555554444 at inside-voip.com)



sip.conf:

[general]
bindport = 5060
bindaddr = 0.0.0.0
context = default   ; non trusted call from sip side go here
srvlookup = yes
dtmfmode=info
disallow=all
allow=ulaw
allow=alaw
allow=g729

[trusted]
type=friend
context=default-out  ; trusted call can go out pstn
host=192.168.0.1
canreinvite=no



zaptel.conf:
span=1,1,0,esf,b8zs
bchan=1-23
dchan=24
span=2,1,0,esf,b8zs
bchan=25-47
dchan=48
span=3,1,0,esf,b8zs
bchan=49-71
dchan=72
span=4,1,0,esf,b8zs
bchan=73-95
dchan=96
loadzone = us
defaultzone=us


zapata.conf:
[channels]
context=default                ;pstn incoming call go here
switchtype=national
signalling=pri_cpe
toneduration=500
usecallerid=yes
hidecallerid=no
callwaitingcallerid=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=800
rxgain=-1.0
txgain=-1.0
callerid=asreceived
;
group=1
channel=>1-23
channel=>73-95
;
group=2
channel=>25-47
channel=>49-71








More information about the asterisk-users mailing list