summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-11-15 18:29:12 +0000
committerJoshua Colp <jcolp@digium.com>2014-11-15 18:29:12 +0000
commit9d2882d274da46529d60a6856dbbad056b067379 (patch)
treedf739acdd55243dd0ec0abdcefe3ecafca863df1
parentd0523b4b3cdc9031a0e7396d5e958803b3acaf53 (diff)
res_pjsip: Enforce requirements for session timer minimum expiration period and normal expiration period.
This change enforces the requirements in PJSIP for session timer configuration. The minimum expiration period must be 90 seconds or higher and the normal expiration period can not be lower than the minimum expiration period. If either of these were done the code would assert at session setup time. ASTERISK-24336 #close Reported by: Leon Rowland ........ Merged revisions 427978 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 427979 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@427980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_pjsip/pjsip_configuration.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 798066777..126c1614c 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -955,6 +955,14 @@ static int sip_endpoint_apply_handler(const struct ast_sorcery *sorcery, void *o
ast_log(LOG_ERROR, "Invalid outbound proxy '%s' specified on endpoint '%s'\n",
endpoint->outbound_proxy, ast_sorcery_object_get_id(endpoint));
return -1;
+ } else if (endpoint->extensions.timer.min_se < 90) {
+ ast_log(LOG_ERROR, "Session timer minimum expires time must be 90 or greater on endpoint '%s'\n",
+ ast_sorcery_object_get_id(endpoint));
+ return -1;
+ } else if (endpoint->extensions.timer.sess_expires < endpoint->extensions.timer.min_se) {
+ ast_log(LOG_ERROR, "Session timer expires must be greater than minimum session expires time on endpoint '%s'\n",
+ ast_sorcery_object_get_id(endpoint));
+ return -1;
}
return 0;