summaryrefslogtreecommitdiff
path: root/res/res_pjsip.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r--res/res_pjsip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 8923540a9..6e389d5f3 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3091,6 +3091,14 @@ pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint,
/* Update the dialog with the new local URI, we do it afterwards so we can use the dialog pool for construction */
pj_strdup_with_null(dlg->pool, &dlg->local.info_str, &local_uri);
dlg->local.info->uri = pjsip_parse_uri(dlg->pool, dlg->local.info_str.ptr, dlg->local.info_str.slen, 0);
+ if (!dlg->local.info->uri) {
+ ast_log(LOG_ERROR,
+ "Could not parse URI '%s' for endpoint '%s'\n",
+ dlg->local.info_str.ptr, ast_sorcery_object_get_id(endpoint));
+ dlg->sess_count--;
+ pjsip_dlg_terminate(dlg);
+ return NULL;
+ }
dlg->local.contact = pjsip_parse_hdr(dlg->pool, &HCONTACT, local_uri.ptr, local_uri.slen, NULL);