diff options
author | Joshua Colp <jcolp@digium.com> | 2015-02-21 18:51:44 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-02-21 18:51:44 +0000 |
commit | f0d018e249177b755cafc9cf8d1fbd6e53839df7 (patch) | |
tree | 9e2e3f7a396528cdb12fce94f69add1966d82d01 /res | |
parent | c40d78c31e2a805653e815a7d45da5e5db557ec3 (diff) |
res_pjsip: Add a log message when creating a UAC dialog to a target URI that is invalid.
ASTERISK-24499 #close
Reported by: Rusty Newton
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@432118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_pjsip.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index 4427c4ecf..133546126 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -2234,6 +2234,7 @@ pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint, { char enclosed_uri[PJSIP_MAX_URL_SIZE]; pj_str_t local_uri = { "sip:temp@temp", 13 }, remote_uri, target_uri; + pj_status_t res; pjsip_dialog *dlg = NULL; const char *outbound_proxy = endpoint->outbound_proxy; pjsip_tpselector selector = { .type = PJSIP_TPSELECTOR_NONE, }; @@ -2244,7 +2245,12 @@ pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint, pj_cstr(&target_uri, uri); - if (pjsip_dlg_create_uac(pjsip_ua_instance(), &local_uri, NULL, &remote_uri, &target_uri, &dlg) != PJ_SUCCESS) { + res = pjsip_dlg_create_uac(pjsip_ua_instance(), &local_uri, NULL, &remote_uri, &target_uri, &dlg); + if (res != PJ_SUCCESS) { + if (res == PJSIP_EINVALIDURI) { + ast_log(LOG_ERROR, "Could not create dialog to endpoint '%s' as URI '%s' is not valid\n", + ast_sorcery_object_get_id(endpoint), uri); + } return NULL; } |