The more I look into this I think that the problem is with the dialplan context. I may need to create a custom dialpan for this provider. Please find below the debug output.
I would appreciate any help or pointers to create a custom dialplan/context to handle the incoming SIP traffic correctly.
Provider: provider.net
Provider external IP: 10.0.4.4
Provider internal IP: 172.0.0.182
My PBX External IP: 192.168.46.239
Number dialed: 442071234567
Username: USIM12345
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c: Reliably Transmitting (NAT) to 10.0.4.4:5060:
OPTIONS sip:10.0.4.4 SIP/2.0
Via: SIP/2.0/UDP 192.168.46.239:5060;branch=z9hG4bK571fd661;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as371928cd
To: sip:10.0.4.4
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.10.1(1.8.20.1)
Date: Mon, 08 Jul 2013 13:17:32 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c:
<— SIP read from UDP:10.0.4.4:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.46.239:5060;branch=z9hG4bK571fd661;rport=5060
From: “Unknown” sip:[email protected];tag=as371928cd
To: sip:10.0.4.4
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Server: Sipwise NGCP Proxy 2.X
Content-Length: 0
<------------->
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c: — (8 headers 0 lines) —
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c:
<— SIP read from UDP:10.0.4.4:5060 —>
SIP/2.0 200 Alive
Record-Route: sip:172.0.0.182;r2=on;lr=on;ftag=as371928cd;ngcplb=yes
Record-Route: sip:10.0.4.4;r2=on;lr=on;ftag=as371928cd;ngcplb=yes
Via: SIP/2.0/UDP 192.168.46.239:5060;branch=z9hG4bK571fd661;rport=5060
From: “Unknown” sip:[email protected];tag=as371928cd
To: sip:10.0.4.4;tag=919d46fc866a35d88e9332805505f824.5ae6
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Server: Sipwise NGCP Proxy 2.X
Content-Length: 0
<------------->
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c: — (10 headers 0 lines) —
[2013-07-08 14:17:32] VERBOSE[1465] chan_sip.c: Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c:
<— SIP read from UDP:10.0.4.4:5060 —>
INVITE sip:[email protected]:5060;transport=udp SIP/2.0
Max-Forwards: 70
Record-Route: sip:10.0.4.4;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
Record-Route: sip:172.0.0.182;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
Via: SIP/2.0/UDP 10.0.4.4;branch=z9hG4bKc6b.5c0e44b577898cd2e656b6e7cd933372.0
Via: SIP/2.0/UDP 172.0.0.182:5080;branch=z9hG4bKFBu0iaJg;rport=5080
From: sip:[email protected];tag=201E3B6E-51DABC0A0007AEF4-9BFFF700
To: sip:[email protected]
CSeq: 10 INVITE
Call-ID: c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1
Allow: INVITE, ACK, CANCEL, BYE, INFO, OPTIONS
Supported: timer
Content-Type: application/sdp
Content-Length: 226
Contact: sip:[email protected]:5060;ngcpct=‘sip:172.0.0.182:5080’
v=0
o=Partitionware-MGW 1 1 IN IP4 10.0.4.4
s=SIP Call
c=IN IP4 10.0.4.4
t=0 0
m=audio 37642 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=sendrecv
a=ptime:20
a=nortpproxy:yes
<------------->
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: — (15 headers 11 lines) —
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Sending to 10.0.4.4:5060 (NAT)
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Using INVITE request as basis request - c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Found peer ‘provider_trnk’ for ‘USIM12345’ from 10.0.4.4:5060
[2013-07-08 14:18:02] VERBOSE[1465] netsock2.c: == Using SIP RTP TOS bits 184
[2013-07-08 14:18:02] VERBOSE[1465] netsock2.c: == Using SIP RTP CoS mark 5
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Found RTP audio format 8
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Found RTP audio format 101
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Found audio description format PCMA for ID 8
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Found audio description format telephone-event for ID 101
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x8 (alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x8 (alaw)
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Peer audio RTP is at port 10.0.4.4:37642
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: Looking for 442071234567 in from-trunk (domain 192.168.46.239)
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: list_route: hop: sip:10.0.4.4;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: list_route: hop: sip:172.0.0.182;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c:
<— Transmitting (NAT) to 10.0.4.4:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.4.4;branch=z9hG4bKc6b.5c0e44b577898cd2e656b6e7cd933372.0;received=10.0.4.4;rport=5060
Via: SIP/2.0/UDP 172.0.0.182:5080;branch=z9hG4bKFBu0iaJg;rport=5080
Record-Route: sip:10.0.4.4;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
Record-Route: sip:172.0.0.182;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
From: sip:[email protected];tag=201E3B6E-51DABC0A0007AEF4-9BFFF700
To: sip:[email protected]
Call-ID: c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1
CSeq: 10 INVITE
Server: FPBX-2.10.1(1.8.20.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: sip:[email protected]:5060
Content-Length: 0
<------------>
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [442071234567@from-trunk:1] NoOp(“SIP/provider_trnk-00000018”, “Catch-All DID Match - Found 442071234567 - You probably want a DID for this.”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [442071234567@from-trunk:2] Goto(“SIP/provider_trnk-00000018”, “ext-did,s,1”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Goto (ext-did,s,1)
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:1] ExecIf(“SIP/provider_trnk-00000018”, “1?Set(__FROM_DID=s)”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:2] Set(“SIP/provider_trnk-00000018”, “CDR(did)=s”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:3] ExecIf(“SIP/provider_trnk-00000018”, “1 ?Set(CALLERID(name)=USIM12345)”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:4] Set(“SIP/provider_trnk-00000018”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:5] Set(“SIP/provider_trnk-00000018”, “CALLERPRES()=allowed_not_screened”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [s@ext-did:6] Goto(“SIP/provider_trnk-00000018”, “app-blackhole,hangup,1”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Goto (app-blackhole,hangup,1)
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [hangup@app-blackhole:1] NoOp(“SIP/provider_trnk-00000018”, “Blackhole Dest: Hangup”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: – Executing [hangup@app-blackhole:2] Hangup(“SIP/provider_trnk-00000018”, “”) in new stack
[2013-07-08 14:18:02] VERBOSE[4071] pbx.c: == Spawn extension (app-blackhole, hangup, 2) exited non-zero on ‘SIP/provider_trnk-00000018’
[2013-07-08 14:18:02] VERBOSE[4071] chan_sip.c: Scheduling destruction of SIP dialog ‘c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1’ in 6400 ms (Method: INVITE)
[2013-07-08 14:18:02] VERBOSE[4071] chan_sip.c:
<— Reliably Transmitting (NAT) to 10.0.4.4:5060 —>
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 10.0.4.4;branch=z9hG4bKc6b.5c0e44b577898cd2e656b6e7cd933372.0;received=10.0.4.4;rport=5060
Via: SIP/2.0/UDP 172.0.0.182:5080;branch=z9hG4bKFBu0iaJg;rport=5080
From: sip:[email protected];tag=201E3B6E-51DABC0A0007AEF4-9BFFF700
To: sip:[email protected];tag=as5340c1a3
Call-ID: c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1
CSeq: 10 INVITE
Server: FPBX-2.10.1(1.8.20.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
<------------>
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c:
<— SIP read from UDP:10.0.4.4:5060 —>
ACK sip:[email protected]:5060;transport=udp SIP/2.0
Max-Forwards: 70
Record-Route: sip:10.0.4.4;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
Record-Route: sip:172.0.0.182;r2=on;lr=on;ftag=201E3B6E-51DABC0A0007AEF4-9BFFF700;ngcplb=yes
Via: SIP/2.0/UDP 10.0.4.4;branch=z9hG4bKc6b.5c0e44b577898cd2e656b6e7cd933372.0
Via: SIP/2.0/UDP 172.0.0.182:5080;branch=z9hG4bKFBu0iaJg;rport=5080
From: sip:[email protected];tag=201E3B6E-51DABC0A0007AEF4-9BFFF700
To: sip:[email protected];tag=as5340c1a3
Call-ID: c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1
CSeq: 10 ACK
<------------->
[2013-07-08 14:18:02] VERBOSE[1465] chan_sip.c: — (10 headers 0 lines) —
[2013-07-08 14:18:08] VERBOSE[1465] chan_sip.c: Really destroying SIP dialog ‘c321c0ee-d278-44e9-b2b0-1d05925cd3bd1_b2b-1’ Method: ACK