SIP trunk. No outbound calls
Hi,
I’m having a problem that is driving me nuts and my Google-fu is apparently limited. I have FreePBX 13.0.190.7 (The Distro) with Asterisk 13.13.1 and a bunch of Cisco SIP (chan-sip) and SCCP phones (and a Zoiper soft-phone configured using chan-pjsip). The pbx and all phones are sitting behind NAT and a dynamic IP adress. I have a SIP trunk from a local provider. I can make calls between all phones internally
FreePBX is registered with the provider and I can receive external calls to the DID. Audio is working correctly for all calls both internally and from the trunk. The problem is that I can’t call any external numbers. I have tried to narrow the problem down and a SIP debug shows that i get a “SIP/2.0 403 Forbidden” from the voip provider whenever I try to call out over the trunk. I initially used chan_pjsip for the trunk but switched over to chan_sip but the result is the same.
Here are the PEER Details on the outgoing tab of the trunk sip settings
host=95.143.207.218
port=9950
username=3976
secret=hunter2
type=peer
qualify=yes
nat=yes
insecure=port,invite
I realise that there must be something wrong with my configuration but I haven’t been able to nail it yet so I would really appreciate any help I can get with this.
Here is a sip debug trace from a connection attempt. What else can I provide to narrow down the issue?
SIP Debugging enabled
[2017-01-02 12:23:39] WARNING[7183]: res_pjsip_pubsub.c:3150 pubsub_on_rx_publish_request: No registered publish handler for event presence
[2017-01-02 12:23:39] WARNING[7183]: res_pjsip_pubsub.c:639 subscription_get_handler_from_rdata: No registered subscribe handler for event presence.winfo
[2017-01-02 12:23:39] WARNING[2055]: func_cdr.c:383 cdr_write_callback: CDR requires a value (CDR(variable)=value)
Audio is at 12034
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 95.143.207.218:9950:
INVITE sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: FPBX-13.0.190.7(13.13.1)
Date: Mon, 02 Jan 2017 11:23:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 334
v=0
o=root 1978262473 1978262473 IN IP4 83.233.167.184
s=Asterisk PBX 13.13.1
c=IN IP4 83.233.167.184
t=0 0
m=audio 12034 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
---
Retransmitting #1 (NAT) to 95.143.207.218:9950:
INVITE sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: FPBX-13.0.190.7(13.13.1)
Date: Mon, 02 Jan 2017 11:23:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 334
v=0
o=root 1978262473 1978262473 IN IP4 83.233.167.184
s=Asterisk PBX 13.13.1
c=IN IP4 83.233.167.184
t=0 0
m=audio 12034 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
---
<--- SIP read from UDP:95.143.207.218:9950 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport=5160
To: <sip:[email protected]:9950>
From: <sip:[email protected]:5160>;tag=as29ca084e
Call-ID: [email protected]
CSeq: 102 INVITE
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
<--- SIP read from UDP:95.143.207.218:9950 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport=5160
Proxy-Authenticate: Digest nonce="414d535c0e7ac93323:88273b0cbea406e86e0ccb0dc2de0a05",algorithm=MD5,realm="3CXPhoneSystem"
To: <sip:[email protected]:9950>;tag=bc720b74
From: <sip:[email protected]:5160>;tag=as29ca084e
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: 3CXPhoneSystem 15.0.59950.0 (59299)
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 95.143.207.218:9950:
ACK sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>;tag=bc720b74
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: FPBX-13.0.190.7(13.13.1)
Content-Length: 0
---
Audio is at 12034
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 95.143.207.218:9950:
INVITE sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK3cc9854d;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 103 INVITE
User-Agent: FPBX-13.0.190.7(13.13.1)
Proxy-Authorization: Digest username="3976", realm="3CXPhoneSystem", algorithm=MD5, uri="sip:[email protected]:9950", nonce="414d535c0e7ac93323:88273b0cbea406e86e0ccb0dc2de0a05", response="a027db0748189532f8ac2dd211a3c44f"
Date: Mon, 02 Jan 2017 11:23:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 334
v=0
o=root 1978262473 1978262474 IN IP4 83.233.167.184
s=Asterisk PBX 13.13.1
c=IN IP4 83.233.167.184
t=0 0
m=audio 12034 RTP/AVP 0 8 3 111 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
---
<--- SIP read from UDP:95.143.207.218:9950 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK322b0c61;rport=5160
Proxy-Authenticate: Digest nonce="414d535c0e7ac93323:88273b0cbea406e86e0ccb0dc2de0a05",algorithm=MD5,realm="3CXPhoneSystem"
To: <sip:[email protected]:9950>;tag=bc720b74
From: <sip:[email protected]:5160>;tag=as29ca084e
Call-ID: [email protected]
CSeq: 102 INVITE
User-Agent: 3CXPhoneSystem 15.0.59950.0 (59299)
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 95.143.207.218:9950:
ACK sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK3cc9854d;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 102 ACK
User-Agent: FPBX-13.0.190.7(13.13.1)
Content-Length: 0
---
<--- SIP read from UDP:95.143.207.218:9950 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK3cc9854d;rport=5160
To: <sip:[email protected]:9950>;tag=237b1917
From: <sip:[email protected]:5160>;tag=as29ca084e
Call-ID: [email protected]
CSeq: 103 INVITE
User-Agent: 3CXPhoneSystem 15.0.59950.0 (59299)
Warning: 499 WIN-F6MOI2921OH "Caller is forbidden"
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 95.143.207.218:9950:
ACK sip:[email protected]:9950 SIP/2.0
Via: SIP/2.0/UDP 83.233.167.184:5160;branch=z9hG4bK3cc9854d;rport
Max-Forwards: 70
From: <sip:[email protected]:5160>;tag=as29ca084e
To: <sip:[email protected]:9950>;tag=237b1917
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]
CSeq: 103 ACK
User-Agent: FPBX-13.0.190.7(13.13.1)
Content-Length: 0
---
[2017-01-02 12:23:39] WARNING[2405][C-00000003]: chan_sip.c:23861 handle_response_invite: Received response: "Forbidden" from '<sip:[email protected]:5160>;tag=as29ca084e'
Scheduling destruction of SIP dialog '[email protected]' in 7616 ms (Method: INVITE)
Reliably Transmitting (no NAT) to 192.168.0.120:5160:
OPTIONS sip:[email protected]:5160;transport=udp SIP/2.0
Via: SIP/2.0/UDP 192.168.0.38:5160;branch=z9hG4bK093cf21c
Max-Forwards: 70
From: "Unknown" <sip:[email protected]:5160>;tag=as66e16942
To: <sip:[email protected]:5160;transport=udp>
Contact: <sip:[email protected]:5160>
Call-ID: [email protected]:5160
CSeq: 102 OPTIONS
User-Agent: FPBX-13.0.190.7(13.13.1)
Date: Mon, 02 Jan 2017 11:23:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:192.168.0.120:51837 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.38:5160;branch=z9hG4bK093cf21c
From: "Unknown" <sip:[email protected]:5160>;tag=as66e16942
To: <sip:[email protected]:5160;transport=udp>;tag=0018187f3bf514043c773463-6a31ccd8
Call-ID: [email protected]:5160
Date: Mon, 02 Jan 2017 11:23:39 GMT
CSeq: 102 OPTIONS
Server: Cisco-CP7941G/9.4.2
Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE
Allow-Events: kpml,dialog,refer
Accept: application/sdp,multipart/mixed,multipart/alternative
Accept-Encoding: identity
Accept-Language: en
Supported: replaces,join,sdp-anat,norefersub,resource-priority,extended-refer,X-cisco-callinfo,X-cisco-serviceuri,X-cisco-escapecodes,X-cisco-service-control,X-cisco-srtp-fallback,X-cisco-monrec,X-cisco-config,X-cisco-sis-6.0.0
Content-Length: 265
Content-Type: application/sdp
Content-Disposition: session;handling=optional
v=0
o=Cisco-SIPUA 6727 0 IN IP4 192.168.0.120
s=SIP Call
t=0 0
m=audio 0 RTP/AVP 0 8 18 102 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:102 L16/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
<------------->
--- (17 headers 12 lines) ---