[asterisk-users] Outgoing SIP calls dropped after 30 seconds.

SIP sip at arcdiv.com
Fri Nov 7 14:15:46 CST 2008


Kurt Knudsen wrote:
> Specs: Asterisk 1.4.22 running behind a SonicWall (transparent mode)
> with a public IP address. We have our phone system setup as 172.16.2.x
> that connect through the SonicWall to Asterisk. Incoming calls work
> flawlessly and we no longer get one-way audio. We are only using SIP
> (3 trunks now, instead of 2) and having all 3 in use is not an issue.
>
> Problem: Make a call on a Polycom 320 IP phone to any number and (4/5
> times) it will drop the call after 30 seconds. I noticed that the
> little timer that pops up on the LCD on the phone is missing when a
> call will be dropped. This timer appears when the phone is answered,
> so I have about 30 seconds to talk to them before the call is just
> dropped.
>
> Known Causes: It's a NAT issue, I know that much, I just don't know
> how to fix it. SIP debugging shows that it attempts to retransmit
> packets to my phone and since it can't, it drops it after 30 seconds.
>
> Log snippet:
>     -- Executing [s at macro-dialout-trunk:19] Dial("SIP/203-b7a2b558",
> "SIP/bw_outbound/+18005551212|300|") in new stack
> Audio is at <public IP> port 11968
> Adding codec 0x4 (ulaw) to SDP
> Adding codec 0x100 (g729) to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
> Reliably Transmitting (no NAT) to 216.82.224.202:5060:
> INVITE sip:+18881231234 at 216.82.224.202 SIP/2.0
> Via: SIP/2.0/UDP <public IP>:5060;branch=z9hG4bK6ea30a1a;rport
> From: "8881231234" <sip:+18881231234 at public IP>;tag=as3ed791f3
> To: <sip:+18005551212 at 216.82.224.202>
> Contact: <sip:+18881231234 at public IP>
> Call-ID: 28aa1a24047e1bdc3328f645766ddbbb at public IP
> CSeq: 102 INVITE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Date: Fri, 07 Nov 2008 19:06:30 GMT
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Content-Type: application/sdp
> Content-Length: 291
>
> v=0
> o=root 21520 21520 IN IP4 151.196.61.115
> s=session
> c=IN IP4 <public IP>
> t=0 0
> m=audio 11968 RTP/AVP 0 18 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
>     -- Called bw_outbound/+18885551212
> FreePBX*CLI>
> <--- SIP read from 216.82.224.202:5060 --->
> SIP/2.0 100 Giving a try
> Via: SIP/2.0/UDP public IP:5060;branch=z9hG4bK6ea30a1a;rport=5060
> From: "8881231234" <sip:+14105601717 at public IP>;tag=as3ed791f3
> To: <sip:+18005551212 at 216.82.224.202>
> Call-ID: 28aa1a24047e1bdc3328f645766ddbbb at public IP
> CSeq: 102 INVITE
> Server: Bandwidth.com TRM (bw7.gold.13)
> Content-Length: 0
>
> <------------->
> --- (8 headers 0 lines) ---
> FreePBX*CLI>
> <--- SIP read from 216.82.224.202:5060 --->
> SIP/2.0 183 Session Progress
> Via: SIP/2.0/UDP public IP:5060;branch=z9hG4bK6ea30a1a;rport=5060
> Record-Route: <sip:216.82.224.202;lr;ftag=as3ed791f3>
> From: "8881231234" <sip:+18881231234 at public IP>;tag=as3ed791f3
> To: <sip:+18005551212 at 216.82.224.202>;tag=VPST50603522629853
> Call-ID: 28aa1a24047e1bdc3328f645766ddbbb at public IP
> CSeq: 102 INVITE
> Contact: <sip:+18005551212 at 209.247.16.221:5060;transport=udp>
> Content-Type: application/sdp
> Content-Length: 184
>
> v=0
> o=- 1226084867 1226084868 IN IP4 209.244.42.253
> s=-
> c=IN IP4 209.244.42.253
> t=0 0
> m=audio 64706 RTP/AVP 0 101
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20
>
> <------------->
> --- (10 headers 9 lines) ---
> Found RTP audio format 0
> Found RTP audio format 101
> Peer audio RTP is at port 209.244.42.253:64706
> Found audio description format telephone-event for ID 101
> Got unsupported a:fmtp in SDP offer
> Capabilities: us - 0x104 (ulaw|g729), peer - audio=0x4
> (ulaw)/video=0x0 (nothing), combined - 0x4 (ulaw)
> Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1
> (telephone-event), combined - 0x1 (telephone-event)
> Peer audio RTP is at port 209.244.42.253:64706
>     -- SIP/bw_outbound-08bf43d0 is making progress passing it to
> SIP/203-b7a2b558
> Audio is at public IP port 16244
> Adding codec 0x4 (ulaw) to SDP
> Adding codec 0x100 (g729) to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
>
> <--- Transmitting (NAT) to 172.16.2.203:5060 --->
> SIP/2.0 183 Session Progress
> Via: SIP/2.0/UDP
> 172.16.2.203;branch=z9hG4bKed293df65EAFD78F;received=172.16.2.203
> From: "Me" <sip:203 at public IP>;tag=28354B-27A53F00
> To: <sip:18005551212 at public IP;user=phone>;tag=as600b952c
> Call-ID: 992e82f4-2e300935-39c0ba22 at 172.16.2.203
> CSeq: 1 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Contact: <sip:18005551212 at public IP>
> Content-Type: application/sdp
> Content-Length: 291
>
> v=0
> o=root 21520 21520 IN IP4 public IP
> s=session
> c=IN IP4 public IP
> t=0 0
> m=audio 16244 RTP/AVP 0 18 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
>
> <------------->
> --- (10 headers 9 lines) ---
> Found RTP audio format 0
> Found RTP audio format 101
> Peer audio RTP is at port 209.244.42.253:64706
> Found audio description format telephone-event for ID 101
> Got unsupported a:fmtp in SDP offer
> Capabilities: us - 0x104 (ulaw|g729), peer - audio=0x4
> (ulaw)/video=0x0 (nothing), combined - 0x4 (ulaw)
> Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1
> (telephone-event), combined - 0x1 (telephone-event)
> Peer audio RTP is at port 209.244.42.253:64706
> list_route: hop: <sip:216.82.224.202;lr;ftag=as3ed791f3>
> set_destination: Parsing <sip:216.82.224.202;lr;ftag=as3ed791f3> for
> address/port to send to
> set_destination: set destination to 216.82.224.202, port 5060
> Transmitting (no NAT) to 216.82.224.202:5060:
> ACK sip:+18005551212 at 209.247.16.221:5060;transport=udp SIP/2.0
> Via: SIP/2.0/UDP public IP:5060;branch=z9hG4bK3c4f465e;rport
> Route: <sip:216.82.224.202;lr;ftag=as3ed791f3>
> From: "8881231234" <sip:+18881231234 at public IP>;tag=as3ed791f3
> To: <sip:+18005551212 at 216.82.224.202>;tag=VPST50603522629853
> Contact: <sip:+18881231234 at public IP>
> Call-ID: 28aa1a24047e1bdc3328f645766ddbbb at public IP
> CSeq: 102 ACK
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Content-Length: 0
>
>
> ---
>     -- SIP/bw_outbound-08bf43d0 answered SIP/203-b7a2b558
> Audio is at public IP port 16244
> Adding codec 0x4 (ulaw) to SDP
> Adding codec 0x100 (g729) to SDP
> Adding non-codec 0x1 (telephone-event) to SDP
>
> <--- Reliably Transmitting (NAT) to 172.16.2.203:5060 --->
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP
> 172.16.2.203;branch=z9hG4bKed293df65EAFD78F;received=172.16.2.203
> From: "Me" <sip:203 at public IP>;tag=28354B-27A53F00
> To: <sip:18005551212 at public IP;user=phone>;tag=as600b952c
> Call-ID: 992e82f4-2e300935-39c0ba22 at 172.16.2.203
> CSeq: 1 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Contact: <sip:18005551212 at public IP>
> Content-Type: application/sdp
> Content-Length: 291
>
> v=0
> o=root 21520 21521 IN IP4 public IP
> s=session
> c=IN IP4 public IP
> t=0 0
> m=audio 16244 RTP/AVP 0 18 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
> <------------>
>     -- Packet2Packet bridging SIP/203-b7a2b558 and SIP/bw_outbound-08bf43d0
> Retransmitting #1 (NAT) to 172.16.2.203:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP
> 172.16.2.203;branch=z9hG4bKed293df65EAFD78F;received=172.16.2.203
> From: "Me" <sip:203 at public IP>;tag=28354B-27A53F00
> To: <sip:18005551212 at public IP;user=phone>;tag=as600b952c
> Call-ID: 992e82f4-2e300935-39c0ba22 at 172.16.2.203
> CSeq: 1 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Contact: <sip:18005551212 at public IP>
> Content-Type: application/sdp
> Content-Length: 291
>
> v=0
> o=root 21520 21521 IN IP4 public IP
> s=session
> c=IN IP4 public IP
> t=0 0
> m=audio 16244 RTP/AVP 0 18 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
>
> <------------->
> --- (10 headers 0 lines) ---
> Really destroying SIP dialog '48e1c5682586d0b92915c00a1104adc7 at public
> IP' Method: OPTIONS
> Retransmitting #2 (NAT) to 172.16.2.203:5060:
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP
> 172.16.2.203;branch=z9hG4bKed293df65EAFD78F;received=172.16.2.203
> From: "Me" <sip:203 at public IP>;tag=28354B-27A53F00
> To: <sip:18005551212 at public IP;user=phone>;tag=as600b952c
> Call-ID: 992e82f4-2e300935-39c0ba22 at 172.16.2.203
> CSeq: 1 INVITE
> User-Agent: Asterisk PBX
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
> Supported: replaces
> Contact: <sip:18005551212 at public IP>
> Content-Type: application/sdp
> Content-Length: 291
>
> v=0
> o=root 21520 21521 IN IP4 public IP
> s=session
> c=IN IP4 public IP
> t=0 0
> m=audio 16244 RTP/AVP 0 18 101
> a=rtpmap:0 PCMU/8000
> a=rtpmap:18 G729/8000
> a=fmtp:18 annexb=no
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=silenceSupp:off - - - -
> a=ptime:20
> a=sendrecv
> ---
> <snip>
> <Then this and call is dropped>
> ---
> Scheduling destruction of SIP dialog
> '28aa1a24047e1bdc3328f645766ddbbb at public IP' in 32000 ms (Method:
> INVITE)
> set_destination: Parsing <sip:216.82.224.202;lr;ftag=as3ed791f3> for
> address/port to send to
> set_destination: set destination to 216.82.224.202, port 5060
> Reliably Transmitting (no NAT) to 216.82.224.202:5060:
> BYE sip:+18005551212 at 209.247.16.221:5060;transport=udp SIP/2.0
> Via: SIP/2.0/UDP public IP:5060;branch=z9hG4bK5e8d995d;rport
> Route: <sip:216.82.224.202;lr;ftag=as3ed791f3>
> From: "8881231234" <sip:+18881231234 at public IP>;tag=as3ed791f3
> To: <sip:+18005551212 at 216.82.224.202>;tag=VPST50603522629853
> Call-ID: 28aa1a24047e1bdc3328f645766ddbbb at public IP
> CSeq: 103 BYE
> User-Agent: Asterisk PBX
> Max-Forwards: 70
> Content-Length: 0
> --------------END---------------
>
> Doesn't matter if I have my SIP phone setting as nat=yes or nat=no.
>
> Settings:
>
> Outbound to Bandwidth.com: nat=no
> Inbound from Bandwidth.com: nat=no
> <Tried nat=yes on 1 and both. No effect>
>
> SIP Phone:
> nat=yes <doesn't matter if it's nat=no>
> qualify=yes
>
> SonicWall stuff I can't really post, but if you ask about it, I can
> answer. Basically, we have an interface that's the phone system that
> is assigned a static IP. SIP transformation is on and consistent NAT
> is off under VOIP settings. The phone interface has VOIP/SIP allowed
> and just blocks intrusion attempts.
>
> Question: Why does it sometimes work and sometimes not? This makes no
> sense and it happens on all phones. Any suggestions?
>
>
>   


We see this on occasion. It sounds a lot like Asterisk doing its usual
routine of deciding that you can't POSSIBLY have a call going through
because it can't receive an ACK response properly.  Asterisk tries
several times to send an ACK and get a response. If the remote system
routes ACKs differently than it routes everything else, often times
those ACKs get lost, and Asterisk assumes that the call can't be
working, so it destroys it.

ACK handling is a bit tricky in the real world, and we've run across
countless incorrectly-configured SIP servers that don't handle it
properly, so calls to them last just about exactly 30 seconds and then
drop.

There is, unfortunately, no way to turn off Asterisk's 'intelligent'
behaviour in this scenario short of possibly patching the code.

N.




More information about the asterisk-users mailing list