[Home]

Summary:ASTERISK-17311: "Require: timer" header still being sent
Reporter:Michael Frager (mfrager)Labels:
Date Opened:2011-01-28 18:45:16.000-0600Date Closed:2011-05-03 14:00:29
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Interoperability
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) trace_20110128130702.pcap
Description:This field is causing calls to drop after exactly 20 minutes.

Here is the code in question:

channels/chan_sip.c: Line 9651

       /* Add Session-Timers related headers if the feature is active for this session.
          An exception to this behavior is the ACK request. Since Asterisk never requires
          session-timers support from a remote end-point (UAS) in an INVITE, it must
          not send 'Require: timer' header in the ACK request.
          This should only be added in the INVITE transactions, not MESSAGE or REFER or other
          in-dialog messages.
       */
       if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE
           && sipmethod == SIP_INVITE) {
               char se_hdr[256];
               snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval,
                       strefresher2str(p->stimer->st_ref));
               add_header(req, "Require", "timer");     /* <- PROBLEM!!! */
               add_header(req, "Session-Expires", se_hdr);
               snprintf(se_hdr, sizeof(se_hdr), "%d", st_get_se(p, FALSE));
               add_header(req, "Min-SE", se_hdr);
       }  



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

Related to issue: 17005
Comments:By: Leif Madsen (lmadsen) 2011-01-31 15:18:21.000-0600

I don't understand how the information provided points to a bug.

Can you provide the configuration options, the console output, and the SIP trace to show what is going on?

We need enough information to analyse what is going on, and to be able to reproduce the issue.

By: Leif Madsen (lmadsen) 2011-01-31 15:19:37.000-0600

Oh now I see the /* <-- PROBLEM! */ note. It wasn't clear the first time I looked.

The requested information may still be useful.

By: Michael Frager (mfrager) 2011-01-31 16:27:52.000-0600

This packet capture: trace_20110128130702.pcap contains the issue.

Filter by this call ID: 1304beb93b90bc0742138bcd0fcf5a5c@69.175.101.218:5060

Packet 573 - INVITE sip:+19562423479@67.16.125.60:5060;transport=udp SIP/2.0

with header:

Require: timer

then

Packet 646 - SIP/2.0 420 Bad Extension

with header:

Unsupported: timer


----


The section of code noted in the original description is the only location I could find where the "Require" header is being generated.

By: David Vossel (dvossel) 2011-01-31 16:40:51.000-0600

I have no idea why that line is still there. It needs to go away.  We should never have "timer" in the Require header.

By: Andreas Westermaier (awesterm) 2011-05-01 19:08:06

Still having this issue on Asterisk 1.8.3.3. UAs from D-Link also responds with "420 Bad Extension" if the "Require: timer" header gets added to the Re-INVITE. So the call drops after Session-Expire/2 seconds.



By: newborn (newborn) 2011-05-03 13:39:09

Strange to see this bug in 1.8x branch. Nothing changes, Asterisk still stepping on the same rakes ...(

By: David Vossel (dvossel) 2011-05-03 13:47:43

Right, i'm fixing this.

By: Digium Subversion (svnbot) 2011-05-03 13:59:07

Repository: asterisk
Revision: 316217

U   branches/1.8/channels/chan_sip.c

------------------------------------------------------------------------
r316217 | dvossel | 2011-05-03 13:59:07 -0500 (Tue, 03 May 2011) | 9 lines

Never put the Require: timer header in an Invite.

This has already been discussed and should have been resolved earlier.  View
revsion 285565's log for more information about why it is important to not
put timer in the Require header.

(closes issue ASTERISK-17311)
Reported by: mfrager

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=316217

By: Digium Subversion (svnbot) 2011-05-03 14:00:28

Repository: asterisk
Revision: 316218

_U  trunk/
U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r316218 | dvossel | 2011-05-03 14:00:27 -0500 (Tue, 03 May 2011) | 16 lines

Merged revisions 316217 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
 r316217 | dvossel | 2011-05-03 13:59:06 -0500 (Tue, 03 May 2011) | 9 lines
 
 Never put the Require: timer header in an Invite.
 
 This has already been discussed and should have been resolved earlier.  View
 revsion 285565's log for more information about why it is important to not
 put timer in the Require header.
 
 (closes issue ASTERISK-17311)
 Reported by: mfrager
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=316218