Hey guys,
I have successfully established an Asterisk server that can make and receive internal calls as well as make outbound calls to the PSTN gateway. I now need to allow for incoming calls. I have been given two numbers by the PSTN gateway and need to tell Asterisk what to do when they are called. Asterisk is receiving the request but still doesn’t recognize what to do. I want it to dial SIP/phone1. The numbers I have been assigned are 1111111111 and 2222222222 (theoretically speaking). I have provided my files below. SWITCH is the PSTN gateway. Outbound calls this way are successful.
sip.conf:
[general]
bindport=5060
bindaddr=xx.xx.xx.xx
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]
type=peer
host=xx.xx.xx.98
trustrpid=yes
context=SIP
insecure=very
dtmfmode=auto
;nat=yes
;qualify=yes
[phone1] ;snom
type=friend
username=phone1
secret=password
host=dynamic
dtmfmode=rfc2833
mailbox=0001
context=sip
insecure=very
canreinvite=yes
nat=yes
realm=test@test.com
collerid=“Phone 1” <1111111111>
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
;Outbound Calls (Must Dial ‘9’)
exten => _9.,1,Dial(SIP/SWITCH/${EXTEN},tr)