From: Joshua Colp Date: Wed, 29 Apr 2015 00:18:46 +0000 (-0500) Subject: Merge "res_pjsip_outbound_registration: Add debugging messages." into 13 X-Git-Tag: 13.4.0-rc1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95ab9fdb1aee82771c3001fd07572c993f76b72e;p=thirdparty%2Fasterisk.git Merge "res_pjsip_outbound_registration: Add debugging messages." into 13 --- 95ab9fdb1aee82771c3001fd07572c993f76b72e diff --cc res/res_pjsip_outbound_registration.c index 1c00473fb4,3c5947e07d..df592263b0 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@@ -562,10 -580,12 +584,12 @@@ static int handle_registration_response if (!response->client_state->auth_attempted && (response->code == 401 || response->code == 407)) { pjsip_tx_data *tdata; - if (!ast_sip_create_request_with_auth(&response->client_state->outbound_auths, - response->rdata, response->tsx, &tdata)) { + if (!ast_sip_create_request_with_auth_from_old(&response->client_state->outbound_auths, + response->rdata, response->old_request, &tdata)) { ao2_ref(response->client_state, +1); response->client_state->auth_attempted = 1; + ast_debug(1, "Sending authenticated REGISTER to server '%s' from client '%s'\n", + server_uri, client_uri); if (pjsip_regc_send(response->client_state->client, tdata) != PJ_SUCCESS) { response->client_state->auth_attempted = 0; ao2_cleanup(response->client_state); @@@ -652,14 -676,17 +680,20 @@@ static void sip_outbound_registration_r response->client_state = client_state; ao2_ref(response->client_state, +1); + pjsip_regc_get_info(client_state->client, &info); + ast_debug(1, "Received REGISTER response %d(%.*s) from server '%.*s' for client '%.*s\n", + param->code, (int) param->reason.slen, param->reason.ptr, + (int) info.server_uri.slen, info.server_uri.ptr, + (int) info.client_uri.slen, info.client_uri.ptr); + if (param->rdata) { struct pjsip_retry_after_hdr *retry_after = pjsip_msg_find_hdr(param->rdata->msg_info.msg, PJSIP_H_RETRY_AFTER, NULL); + pjsip_transaction *tsx; response->retry_after = retry_after ? retry_after->ivalue : 0; - response->tsx = pjsip_rdata_get_tsx(param->rdata); + tsx = pjsip_rdata_get_tsx(param->rdata); + response->old_request = tsx->last_tx; + pjsip_tx_data_add_ref(response->old_request); pjsip_rx_data_clone(param->rdata, 0, &response->rdata); }