summaryrefslogtreecommitdiff
path: root/res/res_pjsip/location.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-10-01 12:27:05 +0000
committerKinsey Moore <kmoore@digium.com>2014-10-01 12:27:05 +0000
commite3da76a352e90aacd52baf61d6450544debdf4cd (patch)
tree810ee813b0a4b785c28eea91ffbd9b07663f667d /res/res_pjsip/location.c
parentac095304e6ad65b38c1e15e49ffe2ed09f15ce17 (diff)
PJSIP: Handle defaults properly
This updates the code behind PJSIP configuration options with custom handlers to deal with the assigned default values properly where it makes sense and adjusting the default value where it doesn't. Before applying this patch, there were several cases where the default value for an option would prevent that config section from loading properly. Reported by: Thomas Thompson Review: https://reviewboard.asterisk.org/r/4019/ ........ Merged revisions 424263 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/location.c')
-rw-r--r--res/res_pjsip/location.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index d6015c758..d036ffa15 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -290,9 +290,14 @@ static int permanent_uri_handler(const struct aco_option *opt, struct ast_variab
{
struct ast_sip_aor *aor = obj;
const char *aor_id = ast_sorcery_object_get_id(aor);
- char *contacts = ast_strdupa(var->value);
+ char *contacts;
char *contact_uri;
+ if (ast_strlen_zero(var->value)) {
+ return 0;
+ }
+
+ contacts = ast_strdupa(var->value);
while ((contact_uri = strsep(&contacts, ","))) {
struct ast_sip_contact *contact;
char contact_id[strlen(aor_id) + strlen(contact_uri) + 2 + 1];