From: Kevin Harwell Date: Wed, 20 Nov 2019 18:56:08 +0000 (-0600) Subject: res_pjsip_outbound_registration: add support for SRV failover X-Git-Tag: 17.1.0-rc1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c99930375bb73072a20e30893fecd1c382f5671;p=thirdparty%2Fasterisk.git res_pjsip_outbound_registration: add support for SRV failover ASTERISK-28624 Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561 --- diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c index df50cf40fe..acc4b1d3a1 100644 --- a/res/res_pjsip_outbound_registration.c +++ b/res/res_pjsip_outbound_registration.c @@ -1033,7 +1033,17 @@ static int handle_registration_response(void *data) ast_debug(1, "Processing REGISTER response %d from server '%s' for client '%s'\n", response->code, server_uri, client_uri); - if ((response->code == 401 || response->code == 407) + if (response->code == 408 || response->code == 503) { + if ((ast_sip_failover_request(response->old_request))) { + int res = registration_client_send(response->client_state, response->old_request); + /* The tdata ref was stolen */ + response->old_request = NULL; + if (res == PJ_SUCCESS) { + ao2_ref(response, -1); + return 0; + } + } + } else if ((response->code == 401 || response->code == 407) && (!response->client_state->auth_attempted || response->rdata->msg_info.cseq->cseq != response->client_state->auth_cseq)) { int res;