From 2494fa613ba4fd1eb0cdbea7b8c05e43f84f890f Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 10 Jun 2008 14:12:51 +0000 Subject: [PATCH] git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@121505 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a092b2790e..54d9cba2a9 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7473,8 +7473,13 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in 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 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init) 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); }