[svn-commits] jrose: trunk r401939 - in /trunk: ./ res/ res/res_pjsip/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Oct 25 12:41:45 CDT 2013


Author: jrose
Date: Fri Oct 25 12:41:38 2013
New Revision: 401939

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=401939
Log:
PJSIP: Add log messages when requests are received for non-existent endpoints

(closes issue ASTERISK-22552)
Reported by: Rusty Newton
Review: https://reviewboard.asterisk.org/r/2934/
........

Merged revisions 401938 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip/pjsip_distributor.c
    trunk/res/res_pjsip_endpoint_identifier_user.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/res/res_pjsip/pjsip_distributor.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_distributor.c?view=diff&rev=401939&r1=401938&r2=401939
==============================================================================
--- trunk/res/res_pjsip/pjsip_distributor.c (original)
+++ trunk/res/res_pjsip/pjsip_distributor.c Fri Oct 25 12:41:38 2013
@@ -232,6 +232,16 @@
 	return artificial_endpoint;
 }
 
+static void log_unidentified_request(pjsip_rx_data *rdata)
+{
+	char from_buf[PJSIP_MAX_URL_SIZE];
+	char callid_buf[PJSIP_MAX_URL_SIZE];
+	pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR, rdata->msg_info.from->uri, from_buf, PJSIP_MAX_URL_SIZE);
+	ast_copy_pj_str(callid_buf, &rdata->msg_info.cid->id, PJSIP_MAX_URL_SIZE);
+	ast_log(LOG_NOTICE, "Request from '%s' failed for '%s:%d' (callid: %s) - No matching endpoint found\n",
+		from_buf, rdata->pkt_info.src_name, rdata->pkt_info.src_port, callid_buf);
+}
+
 static pj_bool_t endpoint_lookup(pjsip_rx_data *rdata)
 {
 	struct ast_sip_endpoint *endpoint;
@@ -262,6 +272,7 @@
 			ast_copy_pj_str(name, &sip_from->user, sizeof(name));
 		}
 
+		log_unidentified_request(rdata);
 		ast_sip_report_invalid_endpoint(name, rdata);
 	}
 	rdata->endpt_info.mod_data[endpoint_mod.id] = endpoint;

Modified: trunk/res/res_pjsip_endpoint_identifier_user.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_endpoint_identifier_user.c?view=diff&rev=401939&r1=401938&r2=401939
==============================================================================
--- trunk/res/res_pjsip_endpoint_identifier_user.c (original)
+++ trunk/res/res_pjsip_endpoint_identifier_user.c Fri Oct 25 12:41:38 2013
@@ -102,6 +102,8 @@
 			return NULL;
 		}
 		ast_debug(3, "Retrieved endpoint %s\n", ast_sorcery_object_get_id(endpoint));
+	} else {
+		ast_debug(3, "Could not identify endpoint by username '%s'\n", endpoint_name);
 	}
 	return endpoint;
 }




More information about the svn-commits mailing list