]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merge "res_pjsip_outbound_registration: Add debugging messages." into 13
authorJoshua Colp <jcolp@digium.com>
Wed, 29 Apr 2015 00:18:46 +0000 (19:18 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Wed, 29 Apr 2015 00:18:46 +0000 (19:18 -0500)
1  2 
res/res_pjsip_outbound_registration.c

index 1c00473fb4f815871edd91cf5a5281ae3fb0d593,3c5947e07de571cba1d0d1c0822c75615835444a..df592263b0b4c9dd879b8fae776ab23a564b63a7
@@@ -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);
        }