diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-10 14:11:16 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-10 14:11:16 +0000 |
commit | d804883827c2980f5402a970c4050e42da1b16c4 (patch) | |
tree | 795952201b82387e3fbbfd99203daf7511bc5dff /channels | |
parent | dd57dea04e9dc323b31a8917eeb8b0b226825592 (diff) |
Fix issue where session timer headers were present when they should not have been.
(closes issue #12706)
Reported by: falves11
Patches:
chan_sip.c.diff uploaded by rjain (license 226)
Tested by: falves11
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@121503 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 0962fc7e9..b5ac72d59 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -7845,8 +7845,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)); @@ -9168,6 +9173,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); } |