summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-08-12 17:38:14 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-08-12 17:38:14 -0500
commit8b1e919ae46bdab02010a9d25c1c27670b03e87f (patch)
tree053c53ba4bb41e32f43973b2be7a7576ec94bf65 /res
parent234d4a818e1109228e14b034b356f248d42efb65 (diff)
parentaeb859dba9a0fc62e6d46088a0d5c162909541a9 (diff)
Merge "res_pjsip: Fail global load if debug or default_from_user are empty"
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip/config_global.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/res/res_pjsip/config_global.c b/res/res_pjsip/config_global.c
index 8a1b0d449..975c5eefe 100644
--- a/res/res_pjsip/config_global.c
+++ b/res/res_pjsip/config_global.c
@@ -118,6 +118,18 @@ static int global_apply(const struct ast_sorcery *sorcery, void *obj)
struct global_config *cfg = obj;
char max_forwards[10];
+ if (ast_strlen_zero(cfg->debug)) {
+ ast_log(LOG_ERROR,
+ "Global option 'debug' can't be empty. Set it to a valid value or remove the entry to accept 'no' as the default\n");
+ return -1;
+ }
+
+ if (ast_strlen_zero(cfg->default_from_user)) {
+ ast_log(LOG_ERROR,
+ "Global option 'default_from_user' can't be empty. Set it to a valid value or remove the entry to accept 'asterisk' as the default\n");
+ return -1;
+ }
+
snprintf(max_forwards, sizeof(max_forwards), "%u", cfg->max_forwards);
ast_sip_add_global_request_header("Max-Forwards", max_forwards, 1);