]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Enforce requirements for session timer minimum expiration period and norma...
authorJoshua Colp <jcolp@digium.com>
Sat, 15 Nov 2014 18:27:56 +0000 (18:27 +0000)
committerJoshua Colp <jcolp@digium.com>
Sat, 15 Nov 2014 18:27:56 +0000 (18:27 +0000)
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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@427978 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_pjsip/pjsip_configuration.c

index a57abf7ed95041c9e5442f1de0c01f90602d7088..31b84555ed79afc813aa833006e296828e78ef06 100644 (file)
@@ -960,6 +960,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;