Please Help, I beg of you!

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.

I think you’d want to change this:

to this:

or this

depending on how your provider wants the call.

WARNING[31170]: app_dial.c:1111 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 3 - No route to destination)
[Jan 2 22:21:07] NOTICE[31170]: cdr.c:434 ast_cdr_free: CDR on channel ‘SIP/phone3-b7d01e00’ not posted

Just noticed you have nat=yes in sip.conf on that peer without specifying localnet and externip in the general section. Those will need to be set. Do you also have the correct ports forwarded on your router and open on your firewalls? Can you ping the external host?

I don’t think it’s necessary that I declare this because all the IP addresses being dealt with are in fact the external IP addresses. This is on a college campus and all IP addresses on campus are accessible from outdside, in other words, they are not your average 192.168.0.x addresses

HI
with use of ur initial config plz send us ur Asterisl console logs when u make in out calls. plz send that cli logs

Amit

Since this is on a college campus, you may have simple firewall issues.

If the firewall isn’t open to allow traffic back through to your Asterisk box, you’re not going to be able to establish a sip session to an external provider.

[Jan 3 19:14:06] NOTICE[27492]: cdr.c:1362 do_reload: CDR simple logging enable d.
[Jan 3 19:14:06] NOTICE[27492]: indications.c:505 ast_unregister_indication_cou ntry: Removed default indication country ‘us’
[Jan 3 19:14:06] WARNING[27492]: res_smdi.c:746 reload: No SMDI interfaces were specified to listen on, not starting SDMI listener.
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4090 pbx_load_module: Starting AEL lo ad process.
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4097 pbx_load_module: AEL load proces s: calculated config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] WARNING[27492]: ael.y:205 ael_yyparse: ==== File: /etc/asteris k/extensions.ael, Line 112, Cols: 34-34: Warning! The empty context ael-dundi-e1 64-canonical will be IGNORED!
[Jan 3 19:14:06] WARNING[27492]: ael.y:205 ael_yyparse: ==== File: /etc/asteris k/extensions.ael, Line 120, Cols: 34-34: Warning! The empty context ael-dundi-e1 64-customers will be IGNORED!
[Jan 3 19:14:06] WARNING[27492]: ael.y:205 ael_yyparse: ==== File: /etc/asteris k/extensions.ael, Line 128, Cols: 33-33: Warning! The empty context ael-dundi-e1 64-via-pstn will be IGNORED!
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4105 pbx_load_module: AEL load proces s: parsed config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] WARNING[27492]: pbx_ael.c:838 check_includes: Warning: file /e tc/asterisk/extensions.ael, line 141-145: The included context ‘ael-dundi-e164-c anonical’ cannot be found.
[Jan 3 19:14:06] WARNING[27492]: pbx_ael.c:838 check_includes: Warning: file /e tc/asterisk/extensions.ael, line 141-145: The included context ‘ael-dundi-e164-c ustomers’ cannot be found.
[Jan 3 19:14:06] WARNING[27492]: pbx_ael.c:838 check_includes: Warning: file /e tc/asterisk/extensions.ael, line 141-145: The included context ‘ael-dundi-e164-v ia-pstn’ cannot be found.
[Jan 3 19:14:06] WARNING[27492]: pbx_ael.c:838 check_includes: Warning: file /e tc/asterisk/extensions.ael, line 276-283: The included context ‘ael-parkedcalls’ cannot be found.
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4108 pbx_load_module: AEL load proces s: checked config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4110 pbx_load_module: AEL load proces s: compiled config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4113 pbx_load_module: AEL load proces s: merged config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-local’ tries includes nonexistent context ‘ael-parkedcalls’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-cano nical’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-cust omers’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-via- pstn’
[Jan 3 19:14:06] NOTICE[27492]: pbx_ael.c:4116 pbx_load_module: AEL load proces s: verified config file name ‘/etc/asterisk/extensions.ael’.
[Jan 3 19:14:06] NOTICE[27492]: app_playback.c:455 reload: Reloading say.conf
[Jan 3 19:14:06] NOTICE[27492]: chan_iax2.c:9258 build_user: The option ‘notran sfer’ is deprecated in favor of ‘transfer’ which has options ‘yes’, ‘no’, and ‘m ediaonly’
[Jan 3 19:14:06] NOTICE[27492]: chan_iax2.c:8998 build_peer: The option ‘notran sfer’ is deprecated in favor of ‘transfer’ which has options ‘yes’, ‘no’, and ‘m ediaonly’
[Jan 3 19:14:06] WARNING[27492]: pbx_config.c:2292 pbx_load_config: No closing parenthesis found? ‘Dial(VoiceMail,u0005’
[Jan 3 19:14:06] WARNING[27492]: pbx_config.c:2292 pbx_load_config: No closing parenthesis found? ‘SIPAddHeader(Call-Info: sip:playpen.mit.edu.de;answer-after =0’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-local’ tries includes nonexistent context ‘ael-parkedcalls’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-cano nical’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-cust omers’
[Jan 3 19:14:06] WARNING[27492]: pbx.c:6246 ast_context_verify_includes: Contex t ‘ael-dundi-e164-local’ tries includes nonexistent context ‘ael-dundi-e164-via- pstn’
[Jan 3 19:14:06] ERROR[27492]: chan_zap.c:10471 build_channels: Unable to recon figure channel ‘1’
[Jan 3 19:14:06] WARNING[27492]: chan_zap.c:11436 reload: Reload of chan_zap.so is unsuccessful!
[Jan 3 19:14:08] WARNING[11348]: chan_sip.c:12543 handle_response: Remote host can’t match request NOTIFY to call '50c245346e5406d80bbcd67267b67206@18.7.10.106 '. Giving up.
[Jan 3 19:14:12] WARNING[27496]: app_dial.c:1111 dial_exec_full: Unable to crea te channel of type ‘SIP’ (cause 3 - No route to destination)
[Jan 3 19:14:12] NOTICE[27496]: cdr.c:434 ast_cdr_free: CDR on channel ‘SIP/pho ne3-b7d01e00’ not posted
[Jan 3 19:14:13] NOTICE[11348]: chan_sip.c:14781 handle_request_subscribe: Got SUBSCRIBE for extension 1001@sip from 18.7.10.108, but there is no hint for that extension.

What does sip show peers say? Are you registered with the switch?

Get that worked out first then work out how to talk to the chanel.

phone2/phone2 xx.xx.10.108 D N 2072 Unmonitored
phone1/phone1 xx.xx.10.107 D N 2051 Unmonitored
SWITCH xx.xx.7.98 N 5060 Unmonitored

This is what I now get when trying to make an outgoing call:

[Jan 3 20:55:32] NOTICE[11348]: chan_sip.c:2880 auto_congest: Auto-congesting SIP/SWITCH-08c91f38
[Jan 3 20:55:32] NOTICE[29274]: cdr.c:434 ast_cdr_free: CDR on channel ‘SIP/SWITCH-08c91f38’ not posted

Some one else on the list had the same issue. Run a SIP debug and see what happens. Also contact your carrier and see if they are receiving anything. Also some one else mentioned there may be a firewall issue.

In your sip.conf, in each of the blocks, stick a qualify=yes line in, and do a reload.

You may need to put a register line in sip.conf for the switch with your username and password.

You should see all of the sip devices showing up. If they are not showing up and registered, you will not be able to make calls.

Get the channel set up first. Once you are seeing the switch show up in the sip show peers, then work on talking to it.

Thank you to everyone who helped debug this issue… I have finally found the answer and figured I would share it with everyone. With the PSTN gateway registered in sip.conf as ‘SWITCH’, I simply call it in extensions.conf by:

‘exten => _9.,1,Dial(SIP/SWITCH/${EXTEN},60,tr)’

Now I have a one-way audio problem! :frowning: always something!

The one way audio is probably a NAT issue. Do you have externip= set in sip.conf ? Also you need to set localnet as well as forward the ports from your router to your asterisk box.

The thing with that though is that the Asterisk box is in a location on campus that it doesnt need the external or internal IP because they are the same. The whole campus has IP addresses that are accessible from outside networks. However, the phones that I’m using are behind NAT’s and they just simply have a 192.168.0.x IP.

I don’t fully understand your set up. Can you please draw a graph ?

The phones themselves are of campus. They are in different houses so they are behind their own NAT’s (in this case they are all behind netgear routers that need to be opened to deal with SIP and RTP). Basically if you open the right ports it works just fine with 2-way audio. Unfortunately, it can be a little tricky finding the right ports to open. Or I could just buy a router that accepts SIP and RTP.

How good are these routers ? I have found that the dumber they are the better. Port forwarding would not work well since you have multiple ports. If the issue is that the router’s are too good then for SIP (for Asterisk) you need to allow ports 5060, 10000-20000 UDP.