summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2013-09-04 14:32:25 +0000
committerKevin Harwell <kharwell@digium.com>2013-09-04 14:32:25 +0000
commit1be7514a59b78f6510b8651685068a3a7111ac17 (patch)
treefd5c32e53e1c9bf6459ebea02a772a3a8e25143f /res
parentb8f6f8ebe12d7d51d7ebad4e4815eef7c8b4691a (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@398227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip_outbound_registration.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index 166b55777..be72081b4 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -209,6 +209,8 @@ static int handle_client_registration(void *data)
{
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);
@@ -217,6 +219,12 @@ static int handle_client_registration(void *data)
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);
if (pjsip_regc_send(client_state->client, tdata) != PJ_SUCCESS) {
@@ -364,6 +372,7 @@ static int handle_registration_response(void *data)
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);