Inbound SIP Trunk hangup

Hi Folks - I was hoping someone might be able to help me with this. I’ve got a SIP trunk setup with paetec as the provider. Outbound calls work great, but on inbound calls, it connects for about 15 seconds, then I get the following error in my log:

Got SIP response 420 “Bad Extension” back from 192.x.x.x

I’ve tried searching EVERYwhere, and well as looking in the asterisk code and can’t seem to find what extension the system is looking for…

Any thoughts would be greatly appreciated! Thanks!

Steve

would need to see a SIP debug for a call which did this. Also having a look at the relevant portions of your dial plan would help greatly.

Dialplan is easy. :smile: 9|X.

Sip debug from right before the inbound call:


zgmsvoip01*CLI>
<— SIP read from UDP://10.10.7.41:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27f96047;rport
From: “Unknown” sip:Unknown@10.10.7.220;tag=as1720426f
To: sip:4500@10.10.7.41;tag=A17084D8-61583069
CSeq: 102 OPTIONS
Call-ID: 2c7b6de43060311c43267f134b426f8e@10.10.7.220
Contact: sip:4500@10.10.7.41
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_670-UA/3.0.3.0401
Content-Length: 0

<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘2c7b6de43060311c43267f134b426f8e@10.10.7.220’ Method: OPTIONS
set_destination: Parsing sip:6038041999@192.168.250.5:5060;transport=udp for address/port to send to
set_destination: set destination to 192.168.250.5, port 5060
Audio is at 10.10.7.220 port 12268
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.250.5:5060:
INVITE sip:6038041999@192.168.250.5:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport
Max-Forwards: 70
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Contact: sip:6035464702@10.10.7.220
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Require: timer
Session-Expires: 60;refresher=uas
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (Session-Timers)
Content-Type: application/sdp
Content-Length: 270

v=0
o=root 1570455997 1570455997 IN IP4 10.10.7.220
s=Asterisk PBX 1.6.0.9-samy-r27
c=IN IP4 10.10.7.220
t=0 0
m=audio 12268 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


zgmsvoip01*CLI>
<— SIP read from UDP://192.168.250.5:5060 —>
SIP/2.0 420 Bad Extension
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport=5060
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 INVITE
Unsupported: timer

<------------->
— (7 headers 0 lines) —
– Got SIP response 420 “Bad Extension” back from 192.168.250.5
set_destination: Parsing sip:6038041999@192.168.250.5:5060;transport=udp for address/port to send to
set_destination: set destination to 192.168.250.5, port 5060
Transmitting (NAT) to 192.168.250.5:5060:
ACK sip:6038041999@192.168.250.5:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport
Max-Forwards: 70
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Contact: sip:6035464702@10.10.7.220
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Content-Length: 0


-- Executing [h@macro-dial:1] Macro("SIP/6035897253-09da8178", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/6035897253-09da8178", "vw") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/6035897253-09da8178", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/6035897253-09da8178", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/6035897253-09da8178", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/6035897253-09da8178", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/6035897253-09da8178", "") in new stack

== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘hangupcall’
== Spawn extension (macro-dial, h, 1) exited non-zero on 'SIP/6035897253-09da8178’
Scheduling destruction of SIP dialog ‘27af1a02558bbc275ecdb7f2789ca040@10.10.7.220’ in 6400 ms (Method: INVITE)
set_destination: Parsing sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426 for address/port to send to
set_destination: set destination to 10.10.9.79, port 58100
Reliably Transmitting (NAT) to 10.10.9.79:58100:
BYE sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426 SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27ec1959;rport
Max-Forwards: 70
From: “GLOBAL NAPS - N” sip:6038041999@10.10.7.220;tag=as495a918c
To: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426;tag=f4ccb86e
Call-ID: 27af1a02558bbc275ecdb7f2789ca040@10.10.7.220
CSeq: 103 BYE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 4702, 1) exited non-zero on 'SIP/6035897253-09da8178’
zgmsvoip01*CLI>
<— SIP read from UDP://10.10.9.79:58100 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27ec1959;rport=5060
Contact: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426
To: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426;tag=f4ccb86e
From: "GLOBAL NAPS - N"sip:6038041999@10.10.7.220;tag=as495a918c
Call-ID: 27af1a02558bbc275ecdb7f2789ca040@10.10.7.220
CSeq: 103 BYE
User-Agent: X-Lite Beta release 4.0 Beta stamp 54293
Content-Length: 0

<------------->
— (9 headers 0 lines) —
Really destroying SIP dialog ‘27af1a02558bbc275ecdb7f2789ca040@10.10.7.220’ Method: INVITE
Really destroying SIP dialog ‘BW005018422100809-1935807693@64.198.149.134’ Method: ACK
zgmsvoip01*CLI>
<— SIP read from UDP://192.168.250.5:5060 —>
BYE sip:6035464702@10.10.7.220 SIP/2.0
Via: SIP/2.0/UDP 192.168.250.5:5060;branch=z9hG4bK14074i207og06go79100cd00p7me1.1
From: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
To: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 14967645 BYE
Max-Forwards: 46
Content-Length: 0

<------------->
— (8 headers 0 lines) —

<— Transmitting (no NAT) to 192.168.250.5:5060 —>
SIP/2.0 481 Call leg/transaction does not exist
Via: SIP/2.0/UDP 192.168.250.5:5060;branch=z9hG4bK14074i207og06go79100cd00p7me1.1;received=192.168.250.5
From: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
To: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 14967645 BYE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Content-Length: 0

what is the device at 192.168.250.5? That is the one reporting a 420 bad extension… not asterisk.

sip provider, Paetec.

Are you sure your dial string is properly formatted? Most SIP providers require numbers in one of the following formats:

1NPANXXXXXX
+1NPANXXXXXX

If you have tried both of those and you still can’t originate the call, I would suggest calling Paetec and asking them why they are rejecting the INVITE.

[quote=“g2010”]Are you sure your dial string is properly formatted? Most SIP providers require numbers in one of the following formats:

1NPANXXXXXX
+1NPANXXXXXX

If you have tried both of those and you still can’t originate the call, I would suggest calling Paetec and asking them why they are rejecting the INVITE.[/quote]

Outbound calls all work great. This is just on inbound. It is Monday morning now, so I’m going to give them a shout when I get in the office, I was just trying to solve this before Monday, when folks actually tried to USE the system for the first time.

At first, the error confused me, thinking it was something wrong with the extension. Hard to find any information on the error…

Not sure you really understand what is going on here. This message clearly indicates this is NOT an inbound call, but you are trying to originate an outbound call to the Paetec SIP gateway.

Reliably Transmitting (NAT) to 192.168.250.5:5060:
INVITE sip:6038041999@192.168.250.5:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport
Max-Forwards: 70
From: ". TYBRIN CORP"<sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3>;tag=as28eb1195
To: "GLOBAL NAPS - N"<sip:6038041999@192.168.250.5;user=phone>;tag=1530546119-1249865418422-
Contact: <sip:6035464702@10.10.7.220>
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Require: timer
Session-Expires: 60;refresher=uas
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (Session-Timers)
Content-Type: application/sdp
Content-Length: 270

v=0
o=root 1570455997 1570455997 IN IP4 10.10.7.220
s=Asterisk PBX 1.6.0.9-samy-r27
c=IN IP4 10.10.7.220
t=0 0
m=audio 12268 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

What does your dialplan look like in the context which handles your inbound calls?

All I have in my inbound routes is, for this extension, 6035464702 / Any CID, which I believe is the default from freepbx. There is no place to put in a dialplan… Just on the trunk, and that is what I had put up top.

If you want to configure using freepbx, you need to use their support web site. This forum is only really useful for people directly editing their dialplans.

ah, the power of a GUI… protecting people from what’s really happening since 1982.

Solved the problem, Paetec does NOT support session timers, and asterisk was doing a timeout after 15 seconds. I put session-timers=refuse in the Trunk, and that fixed it.

Thanks for your responses in helping me jar my mind. :smile:

Steve