[asterisk-commits] file: branch 1.6.0 r121505 - /branches/1.6.0/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jun 10 09:12:51 CDT 2008


Author: file
Date: Tue Jun 10 09:12:51 2008
New Revision: 121505

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121505
Log: (empty)

Modified:
    branches/1.6.0/channels/chan_sip.c

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=121505&r1=121504&r2=121505
==============================================================================
--- branches/1.6.0/channels/chan_sip.c (original)
+++ branches/1.6.0/channels/chan_sip.c Tue Jun 10 09:12:51 2008
@@ -7473,8 +7473,13 @@
 		ast_string_field_set(p, url, NULL);
 	}
 
-	/* 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) {
+	/* 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. */
+	if (p->stimer && p->stimer->st_active == TRUE && p->stimer->st_active_peer_ua == TRUE 
+	    && sipmethod != SIP_ACK && sipmethod != SIP_CANCEL) {
 		char se_hdr[256];
 		snprintf(se_hdr, sizeof(se_hdr), "%d;refresher=%s", p->stimer->st_interval, 
 			strefresher2str(p->stimer->st_ref));
@@ -8767,6 +8772,7 @@
 		
 		snprintf(i2astr, sizeof(i2astr), "%d", p->stimer->st_interval);
 		add_header(&req, "Session-Expires", i2astr);
+		snprintf(i2astr, sizeof(i2astr), "%d", st_get_se(p, FALSE));
 		add_header(&req, "Min-SE", i2astr);
 	}
 




More information about the asterisk-commits mailing list