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

Sean Bright asteriskteam at digium.com
Wed Jun 30 09:55:44 CDT 2021


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16162 )


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(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/16162/1

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/+/16162
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Idd5bbfd48009e7a741757743dbaea68e2835a34d
Gerrit-Change-Number: 16162
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210630/408f5db6/attachment.html>


More information about the asterisk-code-review mailing list