No Rx audio SIP trunk + NAT

Hi folks, i know it’s been posted thousands of times, but my issue doesnt seem to be the usual NAT problem. I am a SIP provider and i sip trunk’d many Asterisk based and non asterisk PBXs.

My customer (FPBX-2.10.1(10.12.1)), behind FW, 5060/10000-20000FWD
Sip trunk was misconfigured, he was able to in/ou calls but it would drop at 15 seconds. But customer was having audio in both ways.

He gave me access to his PBX, i reconfigured Siptrunk, externalip and localnet. Now he can dial in/out but has no Rx audio. local IP is now DMZ for test purposes.

Here’s the trunk config:
type=peer
host=url.registrar
outboundproxy=X.X.X.X
qualify=yes
auth=username:[email protected]
dtmfmode=rfc2833

**No user context/details
externip, localnet and nat=yes set

Here’s sip debug logs:
SIP provider proxy: X.X.X.X
Sip provider registrar: url.registrar
PBX externip: Y.Y.Y.Y

localhost*CLI> sip set debug on
SIP Debugging enabled

<— SIP read from UDP:X.X.X.X:5060 —>
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKpm9j8i20c8lh2m0t65m1.1
Allow-Events: message-summary, refer, dialog, line-seize, presence, call-info, as-feature-event
Max-Forwards: 69
Call-ID: [email protected]
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060
CSeq: 683256566 INVITE
Expires: 180
Organization: Provider
Supported: 100rel, resource-priority
Content-Length: 172
Content-Type: application/sdp
Contact: “Provider” sip:[email protected]:5060;transport=udp;isup-oli=00
P-Asserted-Identity: “Provider” sip:[email protected]:5060
Privacy: none

v=0
o=- 1199725311 1199725311 IN IP4 X.X.X.X
s=-
c=IN IP4 X.X.X.X
t=0 0
m=audio 34190 RTP/AVP 18 0 101
a=rtpmap:101 telephone-event/8000
a=ptime:20
<------------->
— (16 headers 8 lines) —
Sending to X.X.X.X:5060 (NAT)
Using INVITE request as basis request - [email protected]
Found peer ‘Provider’ for ‘6666666666’ from X.X.X.X:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Capabilities: us - (gsm|ulaw|alaw), peer - audio=(ulaw|g729)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port X.X.X.X:34190
Looking for 5555555555 in from-trunk-sip-Provider (domain 192.168.1.85)
list_route: hop: sip:[email protected]:5060;transport=udp

<— Transmitting (NAT) to X.X.X.X:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKpm9j8i20c8lh2m0t65m1.1;received=X.X.X.X;rport=5060
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060
Call-ID: [email protected]
CSeq: 683256566 INVITE
Server: FPBX-2.10.1(10.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
– Executing [5555555555@from-trunk-sip-Provider:1] Set(“SIP/Provider-0000000f”, “GROUP()=OUT_2”) in new stack
– Executing [5555555555@from-trunk-sip-Provider:2] Goto(“SIP/Provider-0000000f”, “from-trunk,5555555555,1”) in new stack
– Goto (from-trunk,5555555555,1)
– Executing [5555555555@from-trunk:1] Set(“SIP/Provider-0000000f”, “__FROM_DID=5555555555”) in new stack
– Executing [5555555555@from-trunk:2] Gosub(“SIP/Provider-0000000f”, “sub-record-cancel,s,1()”) in new stack
– Executing [s@sub-record-cancel:1] ExecIf(“SIP/Provider-0000000f”, “1?Return()”) in new stack
– Executing [5555555555@from-trunk:3] Set(“SIP/Provider-0000000f”, “__REC_POLICY_MODE=never”) in new stack
– Executing [5555555555@from-trunk:4] Gosub(“SIP/Provider-0000000f”, “app-blacklist-check,s,1()”) in new stack
– Executing [s@app-blacklist-check:1] GotoIf(“SIP/Provider-0000000f”, “0?blacklisted”) in new stack
– Executing [s@app-blacklist-check:2] Set(“SIP/Provider-0000000f”, “CALLED_BLACKLIST=1”) in new stack
– Executing [s@app-blacklist-check:3] Return(“SIP/Provider-0000000f”, “”) in new stack
– Executing [5555555555@from-trunk:5] Set(“SIP/Provider-0000000f”, “CDR(did)=5555555555”) in new stack
– Executing [5555555555@from-trunk:6] ExecIf(“SIP/Provider-0000000f”, “0 ?Set(CALLERID(name)=6666666666)”) in new stack
– Executing [5555555555@from-trunk:7] Set(“SIP/Provider-0000000f”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [5555555555@from-trunk:8] Set(“SIP/Provider-0000000f”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [5555555555@from-trunk:9] Goto(“SIP/Provider-0000000f”, “ivr-1,s,1”) in new stack
– Goto (ivr-1,s,1)
– Executing [s@ivr-1:1] Set(“SIP/Provider-0000000f”, “TIMEOUT_LOOPCOUNT=0”) in new stack
– Executing [s@ivr-1:2] Set(“SIP/Provider-0000000f”, “INVALID_LOOPCOUNT=0”) in new stack
– Executing [s@ivr-1:3] Set(“SIP/Provider-0000000f”, “_IVR_CONTEXT_ivr-1=”) in new stack
– Executing [s@ivr-1:4] Set(“SIP/Provider-0000000f”, “_IVR_CONTEXT=ivr-1”) in new stack
– Executing [s@ivr-1:5] Set(“SIP/Provider-0000000f”, “__IVR_RETVM=RETURN”) in new stack
– Executing [s@ivr-1:6] GotoIf(“SIP/Provider-0000000f”, “0?skip”) in new stack
– Executing [s@ivr-1:7] Answer(“SIP/Provider-0000000f”, “”) in new stack
Audio is at 16864
Adding codec 100003 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (NAT) to X.X.X.X:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKpm9j8i20c8lh2m0t65m1.1;received=X.X.X.X;rport=5060
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060;tag=as5cada1df
Call-ID: [email protected]
CSeq: 683256566 INVITE
Server: FPBX-2.10.1(10.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Type: application/sdp
Content-Length: 236

v=0
o=root 1017790363 1017790363 IN IP4 Y.Y.Y.Y
s=Asterisk PBX 10.12.1
c=IN IP4 Y.Y.Y.Y
t=0 0
m=audio 16864 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

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

<— SIP read from UDP:X.X.X.X:5060 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKqmmnc430dgl01kg0c730.1
Allow-Events: message-summary, refer, dialog, line-seize, presence, call-info, as-feature-event
Max-Forwards: 69
Call-ID: [email protected]
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060;tag=as5cada1df
CSeq: 683256566 ACK
Contact: “Provider” sip:[email protected]:5060;transport=udp;isup-oli=00
Organization: Provider
Content-Length: 0
Privacy: none

<------------->
— (12 headers 0 lines) —
– Executing [s@ivr-1:8] Wait(“SIP/Provider-0000000f”, “1”) in new stack
– Executing [s@ivr-1:9] Set(“SIP/Provider-0000000f”, “IVR_MSG=custom/TestIVR”) in new stack
– Executing [s@ivr-1:10] Set(“SIP/Provider-0000000f”, “TIMEOUT(digit)=3”) in new stack
– Digit timeout set to 3.000
– Executing [s@ivr-1:11] ExecIf(“SIP/Provider-0000000f”, “1?Background(custom/TestIVR)”) in new stack
– <SIP/Provider-0000000f> Playing ‘custom/TestIVR.slin’ (language ‘en’)
Reliably Transmitting (NAT) to X.X.X.X:5060:
OPTIONS sip:url.registrar SIP/2.0
Via: SIP/2.0/UDP Y.Y.Y.Y:5060;branch=z9hG4bK2dc326a7;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as357015ad
To: sip:url.registrar
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.10.1(10.12.1)
Date: Fri, 26 Apr 2013 18:02:10 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<— SIP read from UDP:X.X.X.X:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.85:5060;received=Y.Y.Y.Y;branch=z9hG4bK2dc326a7;rport
From: “Unknown” sip:[email protected]:5060;tag=as357015ad
To: sip:url.registrar;tag=url.registrar+1+0+a9f39743
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
WWW-Authenticate: Digest realm=“url.registrar”,nonce=“3332b94ad7fc”,stale=false,algorithm=MD5,qop="auth"
Server: DC-SIP/2.0
Organization: Provider
Supported: 100rel, resource-priority
Content-Length: 0
Privacy: none

<------------->
— (8 headers 0 lines) —
Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS

<— SIP read from UDP:192.168.1.152:5062 —>

<------------->
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS

<— SIP read from UDP:X.X.X.X:5060 —>
BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKqmmnc430dgl01kg0c730cd89elqr3.1
Allow-Events: message-summary, refer, dialog, line-seize, presence, call-info, as-feature-event
Max-Forwards: 69
Call-ID: [email protected]
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060;tag=as5cada1df
CSeq: 683256567 BYE
Organization: Provider
Supported: 100rel, resource-priority
Content-Length: 0
Privacy: none

<------------->
— (12 headers 0 lines) —
Sending to X.X.X.X:5060 (NAT)
Scheduling destruction of SIP dialog ‘[email protected]’ in 6400 ms (Method: BYE)

<— Transmitting (NAT) to X.X.X.X:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP X.X.X.X:5060;branch=z9hG4bKqmmnc430dgl01kg0c730cd89elqr3.1;received=X.X.X.X;rport=5060
From: “Provider” sip:[email protected]:5060;tag=url.registrar+1+381737+aa587ffb;isup-oli=00
To: sip:[email protected]:5060;tag=as5cada1df
Call-ID: [email protected]
CSeq: 683256567 BYE
Server: FPBX-2.10.1(10.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------>
== Spawn extension (ivr-1, s, 11) exited non-zero on ‘SIP/Provider-0000000f’
– Executing [h@ivr-1:1] Hangup(“SIP/Provider-0000000f”, “”) in new stack
== Spawn extension (ivr-1, h, 1) exited non-zero on 'SIP/Provider-0000000f’
Really destroying SIP dialog ‘[email protected]’ Method: BYE
localhost*CLI> sip set debug off

I am no Asterisk guru, maybe someone can point the obvious.
I have the same config on other FreePBX in identical setups, only difference is FPBX version, and i’m pretty puzzled

Definitely sounds like classic NAT issue. Stupid question but is the extension for that user set to nat=yes?

After that perhaps their firewall. If dlink make sure SIP ALG is disabled also there are some dlink routers where SIP will not work at all.

PFsense, 5060 trigger 10000-20000, PBX DMZ, FW is pretty much open. It was open like that before i modified the auth string, externalip, localnet. The call is coming from the provider to an IVR. Althought i’m testring with DTMF, i have the same “no Rx audio” when in send the DID on a local extension

And befor i modified the auth string, externip, localnet, etc. i had audio in both ways***. FW settings havent changed since.