[asterisk-commits] oej: branch 1.6.0 r127790 - in /branches/1.6.0: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 3 11:33:06 CDT 2008


Author: oej
Date: Thu Jul  3 11:33:05 2008
New Revision: 127790

URL: http://svn.digium.com/view/asterisk?view=rev&rev=127790
Log:
Merged revisions 127779 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r127779 | oej | 2008-07-03 18:25:59 +0200 (Tor, 03 Jul 2008) | 4 lines

Revert some logic for session timers. We do send in-dialog requests that should not have session-timer
require headers, like MESSAGE and REFER. So in the future, only add them on requests and responses
that are related to INVITEs and re-INVITEs.

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/channels/chan_sip.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&rev=127790&r1=127789&r2=127790
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Thu Jul  3 11:33:05 2008
@@ -7339,8 +7339,8 @@
 	add_header(resp, "Allow", ALLOWED_METHODS);
 	add_header(resp, "Supported", SUPPORTED_EXTENSIONS);
 
-	/* Add Session-Timers related headers if the feature is active for this session */
-	if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) {
+	/* If this is an invite, add Session-Timers related headers if the feature is active for this session */
+	if (p->method == SIP_INVITE && p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE) {
 		char se_hdr[256];
 		snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval, 
 			strefresher2str(p->stimer->st_ref));
@@ -7482,10 +7482,12 @@
 	/* 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. Also, Require: header 
-	   is not applicable for CANCEL method. */
+	   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_ACK && sipmethod != SIP_CANCEL) {
+	    && 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));




More information about the asterisk-commits mailing list