From: Sean Bright Date: Wed, 30 Jun 2021 13:07:47 +0000 (-0400) Subject: res_pjsip_config_wizard.c: Add port matching support. X-Git-Tag: 18.6.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=146b59df3f1f024eedac0d94a9ad983fd3b3adf5;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_pjsip_config_wizard.c b/res/res_pjsip_config_wizard.c index e61b7c5cc8..8611be7a9d 100644 --- a/res/res_pjsip_config_wizard.c +++ b/res/res_pjsip_config_wizard.c @@ -764,18 +764,8 @@ static int handle_identify(const struct ast_sorcery *sorcery, struct object_type 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)); } }