[svn-commits] kharwell: trunk r398227 - in /trunk: ./ res/res_pjsip_outbound_registration.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 4 09:32:26 CDT 2013


Author: kharwell
Date: Wed Sep  4 09:32:25 2013
New Revision: 398227

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398227
Log:
Debug messages for pjsip outbound registration

Added debug messages indicating that an outbound registration attempt was made
and it was successful in pjsip.

(closes issue ASTERISK-22388)
Reported by: Rusty Newton
........

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

Modified:
    trunk/   (props changed)
    trunk/res/res_pjsip_outbound_registration.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Wed Sep  4 09:32:25 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398198,398206,398215
+/branches/12:1-398198,398206,398215,398226

Modified: trunk/res/res_pjsip_outbound_registration.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip_outbound_registration.c?view=diff&rev=398227&r1=398226&r2=398227
==============================================================================
--- trunk/res/res_pjsip_outbound_registration.c (original)
+++ trunk/res/res_pjsip_outbound_registration.c Wed Sep  4 09:32:25 2013
@@ -209,6 +209,8 @@
 {
 	RAII_VAR(struct sip_outbound_registration_client_state *, client_state, data, ao2_cleanup);
 	pjsip_tx_data *tdata;
+	pjsip_regc_info info;
+	char server_uri[PJSIP_MAX_URL_SIZE], client_uri[PJSIP_MAX_URL_SIZE];
 
 	cancel_registration(client_state);
 
@@ -216,6 +218,12 @@
 		(pjsip_regc_register(client_state->client, PJ_FALSE, &tdata) != PJ_SUCCESS)) {
 		return 0;
 	}
+
+	pjsip_regc_get_info(client_state->client, &info);
+	ast_copy_pj_str(server_uri, &info.server_uri, sizeof(server_uri));
+	ast_copy_pj_str(client_uri, &info.client_uri, sizeof(client_uri));
+	ast_debug(3, "REGISTER attempt %d to '%s' with client '%s'\n",
+		  client_state->retries + 1, server_uri, client_uri);
 
 	/* Due to the registration the callback may now get called, so bump the ref count */
 	ao2_ref(client_state, +1);
@@ -364,6 +372,7 @@
 
 	if (PJSIP_IS_STATUS_IN_CLASS(response->code, 200)) {
 		/* If the registration went fine simply reschedule registration for the future */
+		ast_debug(1, "Outbound registration to '%s' with client '%s' successful\n", server_uri, client_uri);
 		response->client_state->status = SIP_REGISTRATION_REGISTERED;
 		response->client_state->retries = 0;
 		schedule_registration(response->client_state, response->expiration - REREGISTER_BUFFER_TIME);




More information about the svn-commits mailing list