Asterisk settings

Asterisk Configuration Examples

Incoming and Outgoing Settings

here's a basic asterisk configuration to place and receive calls through network.

for the sake of simplicity, lets replace your sip.conf file by the following (pls make a backup!!):

context=default ; default context
srvlookup=no ; sip srv lookup applies to, and not to specific proxy IPs
allowguest=no ; disallow unidentified sip calls to come in, useful for debugging

dont use externip for NATings since its taken care by proxy itself.

  1. include sip_additional.conf

then lets create sip_additional.conf file, in which we'll keep the peer and registration configs:

register = username:[email protected]/username
; fastest (and closes) proxy to me is in NYC (get proxies on

;Allo.ComTrunk Setting

now, lets create a context for the incoming and outgoing calls of this peer, in extensions.conf

; Note: Make sure you use the '/username' at the end of register line in your sip configuration.

exten => username,1,Goto(default,s,1) ; assuming you have a default context where incoming calls are routed

;or use the following dialplan to route based on the DID's


exten => username,1,System(echo \'${SIP_HEADER(TO)}\' | egrep "sip:.*5555555555@" > /dev/null)
exten => username,n,GotoIf($[ "${SYSTEMSTATUS}" = "SUCCESS" ]?ivr1,1)
exten => username,n,System(echo \'${SIP_HEADER(TO)}\' | egrep "sip:.*66666666666@" > /dev/null)
exten => username,n,GotoIf($[ "${SYSTEMSTATUS}" = "SUCCESS" ]?ivr2,1)
exten => username,n,System(echo \'${SIP_HEADER(TO)}\' | egrep "sip:.*8888888888@" > /dev/null)
exten => username,n,GotoIf($[ "${SYSTEMSTATUS}" = "SUCCESS" ]?ivr3,1)
exten => username,n,Hangup

exten => ivr1,1, Playback(ivr-1)
exten => ivr1,2, Dial(SIP/10001)
exten => ivr1,3, Hangup()

exten => ivr2,1, Playback(ivr-2)
exten => ivr2,2, Dial(SIP/10002)
exten => ivr2,3, Hangup()

exten => ivr3,1, Playback(ivr-3)
exten => ivr3,2, Dial(SIP/10003)
exten => ivr3,3, Hangup()


exten => _09.,1,Set(CALLERID(name)='666') ; make sure you dont use any space character
exten => _09.,2,Dial(SIP/${EXTEN:2},120,r) ; to dialout through

; Some of the PBX internal SIP extensions
exten => 101,1, Dial(SIP/101)

exten => 201,1, Dial(SIP/201)

Click here
to download and run the perl script, which gives you sorted order of proxies based on your location.
Created by: jac_allo, Last modification: Thu 05 of Jul, 2007 (10:19 UTC) by varadhan
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+