I have been working on a new project, trying to get this Linux box with Asterisk running on it to connect to an external SIP server to make outgoing calls. As of right now I can make all the internal calls I want to any of my 5 extensions. I have called the external sip server “SWITCH” in sip.conf. I have provided my files below. I will be so greatful if anyone can help me call out to the outside world.
extensions.conf:
[general]
static=yes
writeprotect=yes
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[sip]
;extension 0001=phone1
exten => 0001,1,Dial(SIP/phone1,20,tr)
exten => 0001,2,VoiceMail,u0001
;extension 0002=phone2
exten => 0002,1,Dial(SIP/phone2,20,tr)
exten => 0002,2,VoiceMail,u0002
;extension 0003=phone3
exten => 0003,1,Dial(SIP/phone3,20,tr)
exten => 0003,2,VoiceMail,u0003
;extension 0004=phone4 Basement VOIP phone
exten => 0004,1,Dial(SIP/phone4,20,tr)
exten => 0004,2,VoiceMail,u0004
;extension 0005=phone5 Laptop Phone
exten => 0005,1,Dial(SIP/phone5,20,tr)
exten => 0005,2,Dial(VoiceMail,u0005
;extension 1000 (phones 1,2,&3 ring, then go to GROUP mailbox#0000)
exten => 1000,1,Dial(SIP/phone1&SIP/phone2&SIP/phone3,20,tr)
exten => 1000,2,VoiceMail,u0000
exten => 1000,102,VoiceMail,b0000
;extension 1001: to receive voicemail
exten => 1001,1,Ringing
exten => 1001,2,Wait(2)
exten => 1001,3,VoicemailMain
;extension 2400: intercom PAGING over loudspeaker for phones 1-3
exten => 2400,1,Set(VXML_URL=intercom=true)
exten => 2400,2,SIPAddHeader(Call-Info: sip:playpen.mit.edu.de;answer-after=0)
exten => 2400,3,Page(SIP/phone1&SIP/phone2&SIP/phone3)
exten => _9.,1,Dial(SIP/${EXTEN:1}@SWITCH,60,r)
exten => _1XXXXXXXXXX,1,Set(CALLERID(num)=64xxxxxxx)
exten => _1XXXXXXXXXX,n,Dial(SIP/SWITCH${EXTEN}@SWITCH,T)
exten => _#81.,1,Dial(SIP/${EXTEN:3}@voipuser,60)
exten => _#81.,2,Congestion
;exten => _9.,1,Dial(SIP/${EXTEN:1}@SWITCH,30,r)
sip.conf:
[general]
bindport=5060
bindaddr=#.#.#.#
context=sip ;default
maxexpiry=3600
checkmwi=10
vmexten=voicemail
videosupport=yes
rtcachefriends=yes
disallow=all
allow=gsm
allow=ulaw
allow=alaw
allow=g729
rtptimeout=60
dtmfmode=auto
nat=yes
[SWITCH] ;external sip server at IP ##.##.##.##
type=peer
host=##.##.##.##
trustrpid=yes
context=SIP
insecure=very
dtmfmode=auto
nat=yes
qualify=yes
[phone1]
type=friend
username=phone1
secret=password
host=dynamic
dtmfmode=rfc2833
mailbox=0001
context=sip
insecure=very
canreinvite=yes
nat=yes
realm=####.mit.edu
collerid=“Phone 1” <2124>
[phone2]
type=friend
username=phone2
secret=password
host=dynamic
dtmfmode=rfc2833
mailbox=0002
context=sip
insecure=very
canreinvite=yes
nat=yes
realm=####.mit.edu
callerid=“Phone 2” <2123>
and so on for phones 3,4,&5.