summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerge script <automerge@asterisk.org>2012-12-13 15:17:41 +0000
committerAutomerge script <automerge@asterisk.org>2012-12-13 15:17:41 +0000
commit90c7ab4814ea6c1c087aadcb5661cf2c1abd94dc (patch)
treeef533c7205a383803f86560a06309b2238a5dfa7
parentbc90f6a9d9ce39deff1e8cb940bfbf088c3b50bb (diff)
Merged revisions 377966 via svnmerge from
file:///srv/subversion/repos/asterisk/trunk ................ r377966 | kmoore | 2012-12-13 08:28:57 -0600 (Thu, 13 Dec 2012) | 23 lines Ensure Min-SE is included in outbound INVITEs Asterisk now includes Min-SE in outbound INVITEs when the value is not 90 (the default) and session timers are not disabled. This has the effect of Asterisk following RFC4028 more closely with regard to 422 responses and preventing situations in which Asterisk would be forced to temporarily accept a call to tear it down based on a Session-Expires below the locally configured Min-SE. (issue SWP-5051) Review: https://reviewboard.asterisk.org/r/2222/ Reported-by: Kinsey Moore Patch-by: Kinsey Moore ........ Merged revisions 377946 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377947 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377948 from http://svn.asterisk.org/svn/asterisk/branches/11 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 793e14179..9d5d638ad 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -14052,7 +14052,9 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init,
}
/* Add Session-Timers related headers */
- if (st_get_mode(p, 0) == SESSION_TIMER_MODE_ORIGINATE) {
+ if (st_get_mode(p, 0) == SESSION_TIMER_MODE_ORIGINATE
+ || (st_get_mode(p, 0) == SESSION_TIMER_MODE_ACCEPT
+ && st_get_se(p, FALSE) != DEFAULT_MIN_SE)) {
char i2astr[10];
if (!p->stimer->st_interval) {
@@ -14060,9 +14062,11 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init,
}
p->stimer->st_active = TRUE;
-
- snprintf(i2astr, sizeof(i2astr), "%d", p->stimer->st_interval);
- add_header(&req, "Session-Expires", i2astr);
+ if (st_get_mode(p, 0) == SESSION_TIMER_MODE_ORIGINATE) {
+ 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);
}
@@ -29147,7 +29151,10 @@ static void proc_422_rsp(struct sip_pvt *p, struct sip_request *rsp)
ast_log(LOG_WARNING, "Parsing of Min-SE header failed %s\n", p_hdrval);
return;
}
- p->stimer->st_interval = minse;
+ p->stimer->st_cached_min_se = minse;
+ if (p->stimer->st_interval < minse) {
+ p->stimer->st_interval = minse;
+ }
transmit_invite(p, SIP_INVITE, 1, 2, NULL);
}
@@ -30730,8 +30737,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_log(LOG_WARNING, "Invalid session-minse '%s' at line %d of %s\n", v->value, v->lineno, config);
peer->stimer.st_min_se = global_min_se;
}
- if (peer->stimer.st_min_se < 90) {
- ast_log(LOG_WARNING, "session-minse '%s' at line %d of %s is not allowed to be < 90 secs\n", v->value, v->lineno, config);
+ if (peer->stimer.st_min_se < DEFAULT_MIN_SE) {
+ ast_log(LOG_WARNING, "session-minse '%s' at line %d of %s is not allowed to be < %d secs\n", v->value, v->lineno, config, DEFAULT_MIN_SE);
peer->stimer.st_min_se = global_min_se;
}
} else if (!strcasecmp(v->name, "session-refresher")) {
@@ -31826,8 +31833,8 @@ static int reload_config(enum channelreloadreason reason)
ast_log(LOG_WARNING, "Invalid session-minse '%s' at line %d of %s\n", v->value, v->lineno, config);
global_min_se = DEFAULT_MIN_SE;
}
- if (global_min_se < 90) {
- ast_log(LOG_WARNING, "session-minse '%s' at line %d of %s is not allowed to be < 90 secs\n", v->value, v->lineno, config);
+ if (global_min_se < DEFAULT_MIN_SE) {
+ ast_log(LOG_WARNING, "session-minse '%s' at line %d of %s is not allowed to be < %d secs\n", v->value, v->lineno, config, DEFAULT_MIN_SE);
global_min_se = DEFAULT_MIN_SE;
}
} else if (!strcasecmp(v->name, "session-refresher")) {