[Asterisk-code-review] res_pjsip_config_wizard.c: Add port matching support. (asterisk[18])

George Joseph asteriskteam at digium.com
Thu Jul 8 10:31:22 CDT 2021


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/16161 )

Change subject: res_pjsip_config_wizard.c: Add port matching support.
......................................................................

res_pjsip_config_wizard.c: Add port matching support.

In f8b0c2c9 we added support for port numbers in 'match' statements
but neglected to include that support in the PJSIP config wizard.

The removed code would have also prevented IPv6 addresses from being
successfully used in the config wizard as well.

ASTERISK-29503 #close

Change-Id: Idd5bbfd48009e7a741757743dbaea68e2835a34d
---
M res/res_pjsip_config_wizard.c
1 file changed, 2 insertions(+), 12 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c
index e61b7c5..8611be7 100644
--- a/res/res_pjsip_config_wizard.c
+++ b/res/res_pjsip_config_wizard.c
@@ -764,18 +764,8 @@
 
 	if (!ast_variable_find_last_in_list(vars, "match")) {
 		for (host_counter = 0; host_counter < host_count; host_counter++) {
-			char *rhost = AST_VECTOR_GET(remote_hosts_vector, host_counter);
-			char host[strlen(rhost) + 1];
-			char *colon;
-
-			/* If there's a :port specified, we have to remove it. */
-			strcpy(host, rhost); /* Safe */
-			colon = strchr(host, ':');
-			if (colon) {
-				*colon = '\0';
-			}
-
-			variable_list_append_return(&vars, "match", host);
+			variable_list_append_return(&vars, "match",
+				AST_VECTOR_GET(remote_hosts_vector, host_counter));
 		}
 	}
 

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Idd5bbfd48009e7a741757743dbaea68e2835a34d
Gerrit-Change-Number: 16161
Gerrit-PatchSet: 2
Gerrit-Owner: Sean Bright <sean at seanbright.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/20210708/e342b8a5/attachment.html>


More information about the asterisk-code-review mailing list