[Home]

Summary:ASTERISK-17717: Doing a "channel originate ..." and getting back a 404 leaves the ast_channel up until the sip transaction times out
Reporter:Terry Wilson (twilson)Labels:
Date Opened:2011-04-19 12:27:28Date Closed:2012-01-16 15:19:01.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:If we do a "channel originate SIP/blah@example.com ..." and get back a 404, Asterisk ACKs the 404 but leaves the Asterisk channel (not just the SIP transaction) up until it times out at 32 seconds. I believe both the channel and the transaction should be torn down after ACKing a final response.

****** STEPS TO REPRODUCE ******

*CLI> sip set debug on
*CLI> channel originate SIP/nonexistingextension@localhost application Playback tt-monkeys
< wait up to 32 seconds >
*CLI> core show channels

****** ADDITIONAL INFORMATION ******

*CLI> channel originate SIP/dontexist@localhost application Playback tt-monkeys
 == Using SIP RTP CoS mark 5
Audio is at 5060
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x800000000000 (testlaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 127.0.0.1:5060:
INVITE sip:dontexist@localhost SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e
Max-Forwards: 70
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>
Contact: <sip:Anonymous@127.0.0.1:5060>
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX SVN-branch-1.8-r311874
Date: Tue, 19 Apr 2011 17:09:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 319

v=0
o=root 1295078512 1295078512 IN IP4 127.0.0.1
s=Asterisk PBX SVN-branch-1.8-r311874
c=IN IP4 127.0.0.1
t=0 0
m=audio 13736 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:127.0.0.1:5060 --->
INVITE sip:dontexist@localhost SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e
Max-Forwards: 70
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>
Contact: <sip:Anonymous@127.0.0.1:5060>
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX SVN-branch-1.8-r311874
Date: Tue, 19 Apr 2011 17:09:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 319

v=0
o=root 1295078512 1295078512 IN IP4 127.0.0.1
s=Asterisk PBX SVN-branch-1.8-r311874
c=IN IP4 127.0.0.1
t=0 0
m=audio 13736 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
<------------->
--- (14 headers 14 lines) ---
Sending to 127.0.0.1:5060 (no NAT)
Using INVITE request as basis request - 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
No matching peer for 'Anonymous' from '127.0.0.1:5060'
[Apr 19 10:09:28] NOTICE[15601]: chan_sip.c:21352 handle_request_invite: Sending fake auth rejection for device "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2

<--- Transmitting (no NAT) to 127.0.0.1:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e;received=127.0.0.1
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>;tag=as10bca39b
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 INVITE
Server: Asterisk PBX SVN-branch-1.8-r311874
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="3487339e"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '60786bbc661a81e6328648490604eb27@127.0.0.1:5060' in 32000 ms (Method: INVITE)
Scheduling destruction of SIP dialog '60786bbc661a81e6328648490604eb27@127.0.0.1:5060' in 32000 ms (Method: INVITE)

<--- SIP read from UDP:127.0.0.1:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e;received=127.0.0.1
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>;tag=as10bca39b
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 INVITE
Server: Asterisk PBX SVN-branch-1.8-r311874
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="3487339e"
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Transmitting (no NAT) to 127.0.0.1:5060:
ACK sip:dontexist@localhost SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e
Max-Forwards: 70
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>;tag=as10bca39b
Contact: <sip:Anonymous@127.0.0.1:5060>
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX SVN-branch-1.8-r311874
Content-Length: 0


---
[Apr 19 10:09:28] NOTICE[15601]: chan_sip.c:19172 handle_response_invite: Failed to authenticate on INVITE to '"Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2'

<--- SIP read from UDP:127.0.0.1:5060 --->
ACK sip:dontexist@localhost SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK1bbad04e
Max-Forwards: 70
From: "Anonymous" <sip:Anonymous@anonymous.invalid>;tag=as7fb34ed2
To: <sip:dontexist@localhost>;tag=as10bca39b
Contact: <sip:Anonymous@127.0.0.1:5060>
Call-ID: 60786bbc661a81e6328648490604eb27@127.0.0.1:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX SVN-branch-1.8-r311874
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
*CLI> !date
Tue Apr 19 10:09:30 PDT 2011
*CLI> core show channels
Channel              Location             State   Application(Data)            
SIP/localhost-000000 (None)               Down    (None)                        
1 active channel
0 active calls
0 calls processed
*CLI>
*CLI> !date
Tue Apr 19 10:09:49 PDT 2011
*CLI> core show channels
Channel              Location             State   Application(Data)            
SIP/localhost-000000 (None)               Down    (None)                        
1 active channel
0 active calls
0 calls processed
*CLI> Really destroying SIP dialog '60786bbc661a81e6328648490604eb27@127.0.0.1:5060' Method: INVITE
Really destroying SIP dialog '60786bbc661a81e6328648490604eb27@127.0.0.1:5060' Method: INVITE
*CLI> !date
Tue Apr 19 10:10:01 PDT 2011
*CLI> core show channels
Channel              Location             State   Application(Data)            
0 active channels
0 active calls
0 calls processed
Comments:By: David Woolley (davidw) 2012-01-05 05:46:38.739-0600

The sip_pvt structure needs to be retained until the timeout in case the ACK is lost and the response is repeated.

By: Terry Wilson (twilson) 2012-01-05 08:26:07.380-0600

Yes, I misspoke when I said both should be torn down. This is really about needing to tear down the channel-not the transaction.