[SOLVED] SIP trunk inbound calls not working

Hello all,

We switched to a new SIP Trunk provider however we can’t get inbound calls working. They gave us a pair of IP’s and basically said good luck. We successfully got outbound calls working but inbound calls still will not go through. Any ideas or thoughts would be great.

Excerpt from /var/log/asterisk/full around the time the call fails would be great.

[2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_xmpp.so' (Asterisk XMPP Interface) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_crypto.so' (Cryptographic Digital Signatures) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_outbound_publish.so' (PJSIP Outbound Publish Support) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_ari.so' (Asterisk RESTful Interface) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_fax.so' (Generic FAX Applications) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_parking.so' (Call Parking Resource) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/71/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/72/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/73/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/74/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/75/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/76/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/77/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/78/1, registrar=res_parking/default; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] pbx.c: Remove parkedcalls/70/1, registrar=res_parking; con=<nil>((nil)); con->root=(nil) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_config_mysql.so' (MySQL RealTime Configuration Driver) [2018-12-27 18:52:37] VERBOSE[6250] res_config_mysql.c: MySQL RealTime reloaded. [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_config_curl.so' (Realtime Curl configuration) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_authenticator_digest.so' (PJSIP authentication resource) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_endpoint_identifier_ip.so' (PJSIP IP endpoint identifier) [2018-12-27 18:52:37] ERROR[6250] res_pjsip_config_wizard.c: Unable to load config file 'pjsip_wizard.conf' [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_musiconhold.so' (Music On Hold Resource) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_rtp_asterisk.so' (Asterisk RTP Stack) [2018-12-27 18:52:37] WARNING[6250] res_rtp_asterisk.c: Invalid STUN server address: stun01.sipphone.com [2018-12-27 18:52:37] VERBOSE[6250] res_rtp_asterisk.c: RTP Allocating from port range 10000 -> 20000 [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_mwi.so' (PJSIP MWI resource) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_publish_asterisk.so' (PJSIP Asterisk Event PUBLISH Support) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'chan_iax2.so' (Inter Asterisk eXchange (Ver 2)) [2018-12-27 18:52:37] WARNING[6250] iax2/firmware.c: Error opening firmware directory '/var/lib/asterisk/firmware/iax': No such file or directory [2018-12-27 18:52:37] NOTICE[6250] iax2/provision.c: No IAX provisioning configuration found, IAX provisioning disabled. [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'chan_motif.so' (Motif Jingle Channel Driver) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'chan_sip.so' (Session Initiation Protocol (SIP)) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'chan_dahdi.so' (DAHDI Telephony w/PRI & SS7 & MFC/R2) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_adsi.so' (ADSI Resource) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_notify.so' (CLI/AMI PJSIP NOTIFY Support) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'res_pjsip_outbound_registration.so' (PJSIP Outbound Registration Support) [2018-12-27 18:52:37] ERROR[6250] res_pjsip_config_wizard.c: Unable to load config file 'pjsip_wizard.conf' [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_confbridge.so' (Conference Bridge Application) [2018-12-27 18:52:37] NOTICE[6250] confbridge/conf_config_parser.c: Adding default_menu menu to app_confbridge [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_meetme.so' (MeetMe conference bridge) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'cel_manager.so' (Asterisk Manager Interface CEL Backend) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'cel_odbc.so' (ODBC CEL backend) [2018-12-27 18:52:37] VERBOSE[6250] cel_odbc.c: Found CEL table cel@asteriskcdrdb. [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_amd.so' (Answering Machine Detection Application) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_playback.so' (Sound File Playback Application) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_voicemail.so' (Comedian Mail (Voicemail System)) [2018-12-27 18:52:37] WARNING[6250] app_voicemail.c: maxsilence should be less than minsecs or you may get empty messages [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_flite.so' (Flite TTS Interface) [2018-12-27 18:52:37] WARNING[6250] app_flite.c: Flite: Unable to read config file flite.conf. Using default settings [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'codec_dahdi.so' (Generic DAHDI Transcoder Codec Translator) [2018-12-27 18:52:37] VERBOSE[6250] loader.c: Reloading module 'app_queue.so' (True Call Queueing) [2018-12-27 18:52:37] NOTICE[6250] app_queue.c: queuerules.conf has not changed since it was last loaded. Not taking any action. [2018-12-27 18:52:37] VERBOSE[6250] asterisk.c: Remote UNIX connection disconnected [2018-12-27 18:52:37] VERBOSE[2417] chan_sip.c: Reloading SIP [2018-12-27 18:52:37] WARNING[2417] sip/config_parser.c: Format for registration is [peer?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry] at line 10 [2018-12-27 18:52:37] VERBOSE[2417] netsock2.c: Using SIP TOS bits 96 [2018-12-27 18:52:37] VERBOSE[2417] netsock2.c: Using SIP CoS mark 4

Just a heads up - the IP’s are whitelist only so not to concerned about uploading them here.

There you go.

So you are Peering with them based on IP. So how do they route calls to you? Did you give them an IP to send calls to and to allow calls from?

  1. Your trunk is misconfigured and there is only one of them. Chan_SIP supports only 1 IP per “trunk”. So you would need two Chan_SIP trunks.\

  2. What port is Chan_SIP using on your PBX?

This maybe something you want to do via Chan_PJSIP as you can setup a trunk that accepts calls from both IPs and can be your main outbound trunk and a second one to make calls out as a backup.

But before we can fully correct your trunk setttings and setup in Chan_SIP we need to see the outgoing section to make sure that has all the right settings.

Yes we gave them the static IP to send calls to, port for Chan_SIP is 5160 I believe. From what I have googled I am just supposed to leave the incoming blank which doesn’t seem to do much for us.

This is a summary of what we were told to do.

I would start with the chan SIp port. They may be expecting traffic on 5060 instead of 5160. I would also look at the inbound route for the call. We ended up having to do a inbound route for E.164. Meaning we had to put the +1 at the beginning of every inbound route coming in to get to ring.

I am working with similar SIP provider so just my two cents!

Josh

Thanks Josh!

I looked into some logs and found this error:
2018-12-27 21:09:25] NOTICE[2394]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request ‘INVITE’ from ‘"PINEAPPLE INC " <sip:[email protected]>’ failed for ‘67.231.8.195:5060’ (callid: [email protected]) - No matching endpoint found [2018-12-27 21:09:25] NOTICE[2394]: res_pjsip/pjsip_distributor.c:649 log_failed_request: Request ‘INVITE’ from ‘"PINEAPPLE INC " <sip:[email protected]>’ failed for ‘67.231.4.195:5060’ (callid: [email protected]) - No matching endpoint found

It looks like it is able to communicate but something is failing somehow. Any ideas?

Yep it looks like its trying to use PJSIP to talk. Your chan SIP is set for port 5160. How many endpoints are on this device? If not very many i would go to your sip settings and set your chan sip port to 5060 and your pjsip to 5160. Once your talking the right port it will work perfect. But if you have alot of endpoints you will have to adjust them to new port as well.

We have about 4 endpoints - I tried changing them earlier however after I do so, all of our grandstream phones refuse to function.

So you will need to log into phones and change port that they are trying to communicate to PBX on. On yealink it looks like this. Not sure on grandstream

Grandstream is about the same - odd part is I did that and the phones still don’t want to register.

But the number works now so I guess that is good.

What type of extensions are they? Chan_SIP or Chan_PJSIP?

reboot pbx after port change.

All of our endpoints run on PJSIP

Rebooted and still nothing on the phones.

OK, so you were basically given poor advice as no one thought that your trunk and your endpoints would be under different tech. I’m going to go back to my original post, you should have just made a PJSIP trunk.

So now, go back and revert the ports the way they were (PJSIP on 5060 and Chan_SIP on 5160). Create a PJSIP Trunk, under the PJSIP Settings

Authentication: None
SIP Server URI: 67.231.8.195
SIP Server Port: 5060

Advanced tab where it says Match (Permit) put : 65.213.8.195/32,67.231.4.195/32

This trunk will send calls to the 67.231.8.195 server and accept calls from both.

Ok so i think that worked,

I called the trunk number - it rang my phone as planned but when I answered the phone lost connection - I am restarting the full PBX to see if that solves any issues.

Alright I can now say everything is working perfectly!

Thanks everyone for your help!