summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2008-07-03 16:25:59 +0000
committerOlle Johansson <oej@edvina.net>2008-07-03 16:25:59 +0000
commit2491cc6e6531092c201f6119d9984feb46a9c367 (patch)
treedc505470d7020c3fe38296a76fb4f1f4ac67a6f9 /channels
parente99eece42af74a4167ae80050421e277cfff5bc5 (diff)
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e75a1c936..6f5e263d0 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -7711,8 +7711,8 @@ static int respprep(struct sip_request *resp, struct sip_pvt *p, const char *msg
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));
@@ -7854,10 +7854,12 @@ static int reqprep(struct sip_request *req, struct sip_pvt *p, int sipmethod, in
/* 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));