[svn-commits] file: branch 13 r432118 - /branches/13/res/res_pjsip.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Feb 21 12:51:46 CST 2015


Author: file
Date: Sat Feb 21 12:51:44 2015
New Revision: 432118

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432118
Log:
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

Modified:
    branches/13/res/res_pjsip.c

Modified: branches/13/res/res_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/res/res_pjsip.c?view=diff&rev=432118&r1=432117&r2=432118
==============================================================================
--- branches/13/res/res_pjsip.c (original)
+++ branches/13/res/res_pjsip.c Sat Feb 21 12:51:44 2015
@@ -2234,6 +2234,7 @@
 {
 	char enclosed_uri[PJSIP_MAX_URL_SIZE];
 	pj_str_t local_uri = { "sip:temp at 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 @@
 
 	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;
 	}
 




More information about the svn-commits mailing list