New instance with new Trunk provider

Trying to setup a new freepbx with a new trunk provider. I have been in contact with their support and it looks like calls are getting dropped at my PBX.

I’m running FreePBX 15.0.16.75 and can give logs but just tell me what commands to get the requested logs.

I assume that your issue is with incoming calls. Are outgoing calls working ok?

Does anything appear in the Asterisk log on a call attempt? If so, paste the log for a failed call at pastebin.freepbx.org and post the link here.

If nothing is logged, does sngrep show an incoming INVITE for an attempted call? If so, you need to configure FreePBX firewall to allow traffic from all addresses from which the provider sends calls.

If sngrep also shows nothing, your hardware firewall is likely blocking the traffic.

[root@freepbx ~]# asterisk -vcr
Asterisk 16.6.2, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 16.6.2 currently running on freepbx (pid = 11686)

<--- SIP read from UDP:41.193.38.17:5060 --->
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bKvb664i3088qo558dq3o0.1
Max-Forwards: 68
Contact: <sip:[email protected]:5060;transport=udp>
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 194 INVITE
Expires: 300
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Content-Disposition: session
Content-Type: application/sdp
User-Agent: PortaSIP
P-Asserted-Identity: <sip:[email protected]>
cisco-GUID: 1097175055-183208602-1856406288-1856406288
h323-conf-id: 1097175055-183208602-1856406288-1856406288
Content-Length: 289

v=0
o=PortaSIP 760560454731228636 1 IN IP4 41.193.38.17
s=Interaction
t=0 0
m=audio 50340 RTP/AVP 18 8 9 101
c=IN IP4 41.193.38.17
a=rtpmap:18 G729/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=sendrecv
<------------->
--- (17 headers 13 lines) ---
Sending to 41.193.38.17:5060 (NAT)
Sending to 41.193.38.17:5060 (NAT)
Using INVITE request as basis request - SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
No matching peer for '27878050500' from '41.193.38.17:5060'
Found RTP audio format 18
Found RTP audio format 8
Found RTP audio format 9
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format PCMA for ID 8
Found audio description format G722 for ID 9
Found audio description format telephone-event for ID 101
Capabilities: us - (g729|ulaw|alaw|gsm|g726|g722), peer - audio=(alaw|g722|g729)/video=(nothing)/text=(nothing), combined - (g729|alaw|g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 41.193.38.17:50340
Looking for 27878986227 in from-sip-external (domain 102.132.242.189)
sip_route_dump: route/path hop: <sip:[email protected]:5060;transport=udp>

<--- Transmitting (NAT) to 41.193.38.17:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bKvb664i3088qo558dq3o0.1;received=41.193.38.17;rport=5060
From: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
To: <sip:[email protected]>
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 194 INVITE
Server: FPBX-15.0.16.75(16.6.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:[email protected]:5160>
Content-Length: 0


<------------>
Audio is at 11280
Adding codec g729 to SDP
Adding codec alaw to SDP
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 41.193.38.17:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bKvb664i3088qo558dq3o0.1;received=41.193.38.17;rport=5060
From: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
To: <sip:[email protected]>;tag=as00b20dd0
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 194 INVITE
Server: FPBX-15.0.16.75(16.6.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:[email protected]:5160>
Content-Type: application/sdp
Content-Length: 328

v=0
o=root 1690793242 1690793242 IN IP4 102.132.242.189
s=Asterisk PBX 16.6.2
c=IN IP4 102.132.242.189
t=0 0
m=audio 11280 RTP/AVP 18 8 9 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

<--- SIP read from UDP:41.193.38.17:5060 --->
ACK sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bK5k7s8c209o6oj9fh5n40.1
Max-Forwards: 68
Contact: <sip:[email protected]:5060;transport=udp>
To: <sip:[email protected]>;tag=as00b20dd0
From: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 194 ACK
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
User-Agent: PortaSIP
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---

<--- SIP read from UDP:41.193.38.17:5060 --->
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bK1ica54304g6tbck2i080.1
Max-Forwards: 68
Contact: <sip:[email protected]:5060;transport=udp>
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=SDnpr0e01-KBLN6WT2XJ3HXNCCMUZA____.o
Call-ID: SDnpr0e01-7ffbb808012499dc49750d8f1dbc3c82-a848r11020
CSeq: 186 INVITE
Expires: 300
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Content-Disposition: session
Content-Type: application/sdp
User-Agent: PortaSIP
P-Asserted-Identity: <sip:[email protected]>
cisco-GUID: 4215738234-2553899424-550566659-550566659
h323-conf-id: 4215738234-2553899424-550566659-550566659
Content-Length: 290

v=0
o=PortaSIP 3129319845194269044 1 IN IP4 41.193.38.17
s=Interaction
t=0 0
m=audio 51474 RTP/AVP 18 8 9 101
c=IN IP4 41.193.38.17
a=rtpmap:18 G729/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=fmtp:18 annexb=no
a=sendrecv
<------------->
--- (17 headers 13 lines) ---
Sending to 41.193.38.17:5060 (NAT)
Sending to 41.193.38.17:5060 (NAT)
Using INVITE request as basis request - SDnpr0e01-7ffbb808012499dc49750d8f1dbc3c82-a848r11020
No matching peer for '27878050500' from '41.193.38.17:5060'
Found RTP audio format 18
Found RTP audio format 8
Found RTP audio format 9
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format PCMA for ID 8
Found audio description format G722 for ID 9
Found audio description format telephone-event for ID 101
Capabilities: us - (g729|ulaw|alaw|gsm|g726|g722), peer - audio=(alaw|g722|g729)/video=(nothing)/text=(nothing), combined - (g729|alaw|g722)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 41.193.38.17:51474
Looking for 27878986227 in from-sip-external (domain 102.132.242.189)
sip_route_dump: route/path hop: <sip:[email protected]:5060;transport=udp>

<--- Transmitting (NAT) to 41.193.38.17:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bK1ica54304g6tbck2i080.1;received=41.193.38.17;rport=5060
From: <sip:[email protected]>;tag=SDnpr0e01-KBLN6WT2XJ3HXNCCMUZA____.o
To: <sip:[email protected]>
Call-ID: SDnpr0e01-7ffbb808012499dc49750d8f1dbc3c82-a848r11020
CSeq: 186 INVITE
Server: FPBX-15.0.16.75(16.6.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:[email protected]:5160>
Content-Length: 0


<------------>
Audio is at 16466
Adding codec g729 to SDP
Adding codec alaw to SDP
Adding codec g722 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 41.193.38.17:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bK1ica54304g6tbck2i080.1;received=41.193.38.17;rport=5060
From: <sip:[email protected]>;tag=SDnpr0e01-KBLN6WT2XJ3HXNCCMUZA____.o
To: <sip:[email protected]>;tag=as5c1c8926
Call-ID: SDnpr0e01-7ffbb808012499dc49750d8f1dbc3c82-a848r11020
CSeq: 186 INVITE
Server: FPBX-15.0.16.75(16.6.2)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:[email protected]:5160>
Content-Type: application/sdp
Content-Length: 328

v=0
o=root 1343466214 1343466214 IN IP4 102.132.242.189
s=Asterisk PBX 16.6.2
c=IN IP4 102.132.242.189
t=0 0
m=audio 16466 RTP/AVP 18 8 9 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

<--- SIP read from UDP:41.193.38.17:5060 --->
ACK sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 41.193.38.17:5060;branch=z9hG4bKc22ia60050ne10sdqoa0.1
Max-Forwards: 68
Contact: <sip:[email protected]:5060;transport=udp>
To: <sip:[email protected]>;tag=as5c1c8926
From: <sip:[email protected]>;tag=SDnpr0e01-KBLN6WT2XJ3HXNCCMUZA____.o
Call-ID: SDnpr0e01-7ffbb808012499dc49750d8f1dbc3c82-a848r11020
CSeq: 186 ACK
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
User-Agent: PortaSIP
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Scheduling destruction of SIP dialog 'SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020' in 32000 ms (Method: ACK)
Reliably Transmitting (NAT) to 41.193.38.17:5060:
BYE sip:[email protected]:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 102.132.242.189:5160;branch=z9hG4bK37bc21ef;rport
Max-Forwards: 70
From: <sip:[email protected]>;tag=as00b20dd0
To: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 102 BYE
User-Agent: FPBX-15.0.16.75(16.6.2)
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---

<--- SIP read from UDP:41.193.38.17:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 102.132.242.189:5160;received=102.132.242.189;branch=z9hG4bK37bc21ef;rport=5160
From: <sip:[email protected]>;tag=as00b20dd0
To: <sip:[email protected]>;tag=SDn25ie01-BIHISH3W752CPOCAELEA____.o
Call-ID: SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020
CSeq: 102 BYE
Allow: INVITE, ACK, BYE, CANCEL, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS, UPDATE
Server: PortaSIP
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog 'SDn25ie01-edbe9172e874df5239952643657097ec-a848r11020' Method: ACK
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 41.193.38.17:5060:
REGISTER sip:41.193.38.17 SIP/2.0
Via: SIP/2.0/UDP 102.132.242.189:5160;branch=z9hG4bK370b28bc;rport
Max-Forwards: 70
From: <sip:[email protected]>;tag=as0c88e746
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 135 REGISTER
Supported: replaces, timer
User-Agent: FPBX-15.0.16.75(16.6.2)
Authorization: Digest username="27878986227", realm="sip-2.core", algorithm=MD5, uri="sip:41.193.38.17", nonce="1604922211:505302f87f368bf1c509669bf7674edd5db8ee66", response="2eee50408b804716f83b4aca404b62b6"
Expires: 120
Contact: <sip:[email protected]:5160>
Content-Length: 0


---

<--- SIP read from UDP:41.193.38.17:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 102.132.242.189:5160;received=102.132.242.189;branch=z9hG4bK370b28bc;rport=5160
From: <sip:[email protected]>;tag=as0c88e746
To: <sip:[email protected]>;tag=SDp433599-13bb983c
Call-ID: [email protected]
CSeq: 135 REGISTER
WWW-Authenticate: Digest nonce="1604922336:77286555cded3328283b828d95c055313188f6ed",algorithm=MD5,realm="sip-2.core"
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Responding to challenge, registration to domain/host name 41.193.38.17
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 41.193.38.17:5060:
REGISTER sip:41.193.38.17 SIP/2.0
Via: SIP/2.0/UDP 102.132.242.189:5160;branch=z9hG4bK7eb52c88;rport
Max-Forwards: 70
From: <sip:[email protected]>;tag=as0c88e746
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 136 REGISTER
Supported: replaces, timer
User-Agent: FPBX-15.0.16.75(16.6.2)
Authorization: Digest username="27878986227", realm="sip-2.core", algorithm=MD5, uri="sip:41.193.38.17", nonce="1604922336:77286555cded3328283b828d95c055313188f6ed", response="854d6e0c2af5672a0f8f69d7fd09712a"
Expires: 120
Contact: <sip:[email protected]:5160>
Content-Length: 0


---

<--- SIP read from UDP:41.193.38.17:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 102.132.242.189:5160;received=102.132.242.189;branch=z9hG4bK7eb52c88;rport=5160
From: <sip:[email protected]>;tag=as0c88e746
To: <sip:[email protected]>;tag=SDp433599-cedba018
Call-ID: [email protected]
CSeq: 136 REGISTER
Contact: <sip:[email protected]:5160>;expires=120
Date: Mon, 09 Nov 2020 11:45:36 GMT
Supported: path
PortaBilling: available-funds:1500.00000 currency:ZAR
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---

I’m puzzled. Your registration is for username 27878986227 and the Contact header specifies that user, but the incoming call somehow shows 27878050500. Do you have more than one trunk with Vox? If not, do you recognize the latter number?

For testing, in Asterisk SIP Settings, you can set Allow Anonymous Inbound SIP Calls and Allow SIP Guests to Yes and create an Inbound Route with both DID Number and CallerID Number left blank (any) and pointing to your extension, you should be able to receive these calls. However, this combination of settings is a big security risk and should not be used in production.

That incoming number is their support desk when we were troubleshooting. Thats why the first part of the number is the same.

Here is the outcome of changing those settings. https://pastebin.freepbx.org/view/499c871e

Can you post your Trunk config? mask sensitive info

Incoming PEER:

username=2787****
type=peer
qualify=yes
secret=*******
nat=yes
insecure=invite,port
host=41.193.38.17
fromuser=2787****
fromdomain=41.193.38.17
dtmfmode=rfc2833
context=from-trunk
disallow=all
allow=g711
canreinvite=no

Incoming Reg String:
2787******:@41.193.38.17/2787***

Asterisk G.711 codecs are named alaw and ulaw; the name g711 is not recognized and would result in no codecs being enabled.

Both alaw and ulaw are already enabled.

Do you only have ChanSIP enabled?

Have you set up an “any/any” route for incoming calls?

Your ChanSIP config file says not true, so are you using ChanSIP (normally on port 5160) or are you using PJSIP (normally on port 5060). This looks to me like channel driver confusion, so the more specificity we can get from you, the faster this gets solved.

This is on a new Instance of FreePBX so whatever is turn on is on by default. I have made no changes beyond setting up the trunk and one extension. I even did a reinstall yesterday with the same result.

Honestly if someone wants to take a look themselves I can give someone remote access. Theirs no damage that can be done to the PBX or the SIP Trunk account.

By default, chan_sip uses port 5160. Is your provider sending the inbound call to it? Or are they sending it so 5060.

If you are installing new, then you should only be using pjsip anyway.

Just because providers do not update their documentation does not mean stuff does not work.

Do this and see if things work

If not you likely only need to tweak a few advanced settings PAI, RPID, maybe from user, from domain, or contact user.

Generally when you define a trunk, you have the option to choose host(s) and port, this has no bearing on the port you are listening on for INVITES/REGISTRATIONS or the channel driver’s bind port choice.

As long as your firewall passes those calls to your PBX , feel free to use any SIP stack that works for you.

That is stupid. The Asterisk team has clearly stated that they are working to remove chan_sip. That means there is no reason to be attempting to use it chan_sip on new deployments.

A parable,

That’s not the first time I have been called stupid today, my wife called me that when I asked for a second cup of coffee. I was however right , I did want one, but made it myself, it was delicious :wink:

Everybody not my wife is not necessarily stupid.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.