[Asterisk-code-review] res_pjsip_outbound_registration: add support for SRV failover (asterisk[16])
Friendly Automation
asteriskteam at digium.com
Fri Dec 6 09:20:20 CST 2019
Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13228 )
Change subject: res_pjsip_outbound_registration: add support for SRV failover
......................................................................
res_pjsip_outbound_registration: add support for SRV failover
ASTERISK-28624
Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561
---
M res/res_pjsip_outbound_registration.c
1 file changed, 11 insertions(+), 1 deletion(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index fc52e9e..9ea6054 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -910,7 +910,17 @@
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;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13228
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I8da7c300dd985ab7b10dbd5194aff2f737808561
Gerrit-Change-Number: 13228
Gerrit-PatchSet: 1
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191206/42078258/attachment.html>
More information about the asterisk-code-review
mailing list