[Asterisk-code-review] res_pjsip_outbound_registration: Allow to use multiple proxies for re... (asterisk[16])

Friendly Automation asteriskteam at digium.com
Mon Oct 31 08:40:59 CDT 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19202 )

Change subject: res_pjsip_outbound_registration: Allow to use multiple proxies for registration
......................................................................

res_pjsip_outbound_registration: Allow to use multiple proxies for registration

Current registration code use pjsip_parse_uri to verify outbound_proxy
that is different from the reading this option for the endpoint. This
made value with multiple proxies invalid for registration pjsip settings.
Removing URI validation helps to use registration through multiple proxies.

ASTERISK-30217 #close

Change-Id: I064558e66f04b9f3260c46181812a01349761357
---
M res/res_pjsip_outbound_registration.c
1 file changed, 16 insertions(+), 12 deletions(-)

Approvals:
  Joshua Colp: 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 5654252..b05c7ff 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -1583,20 +1583,8 @@
 		return -1;
 	}
 
-	if (!ast_strlen_zero(registration->outbound_proxy)) {
-		pj_strdup2_with_null(pool, &tmp, registration->outbound_proxy);
-		uri = pjsip_parse_uri(pool, tmp.ptr, tmp.slen, 0);
-		if (!uri) {
-			ast_log(LOG_ERROR, "Invalid outbound proxy URI '%s' specified on outbound registration '%s'\n",
-				registration->outbound_proxy, ast_sorcery_object_get_id(registration));
-			pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
-			return -1;
-		}
-	}
-
 	pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
 
-
 	ast_assert(state->client_state->client == NULL);
 	if (pjsip_regc_create(ast_sip_get_pjsip_endpoint(), state->client_state,
 			sip_outbound_registration_response_cb,

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19202
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I064558e66f04b9f3260c46181812a01349761357
Gerrit-Change-Number: 19202
Gerrit-PatchSet: 4
Gerrit-Owner: Igor Goncharovsky <igor.goncharovsky at gmail.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221031/360f29aa/attachment-0001.html>


More information about the asterisk-code-review mailing list