[Asterisk-code-review] res pjsip: Add to list of valid characters for from user. (asterisk[15.1])

Kevin Harwell asteriskteam at digium.com
Thu Nov 9 14:39:11 CST 2017


Kevin Harwell has submitted this change and it was merged. ( https://gerrit.asterisk.org/7156 )

Change subject: res_pjsip: Add to list of valid characters for from_user.
......................................................................

res_pjsip: Add to list of valid characters for from_user.

Fixes a regression where some characters were unable to be used in
the from_user field of an endpoint. Additionally, the backtick was
removed from the list of valid characters, since it is not valid,
and it was replaced with a single quote, which is a valid character.

ASTERISK-27387

Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281
(cherry picked from commit 5b13290522f0dc4312d5dca308bda3fdd636d613)
---
M res/res_pjsip/pjsip_configuration.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, approved; Approved for Submit



diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c
index 653cb98..6294437 100644
--- a/res/res_pjsip/pjsip_configuration.c
+++ b/res/res_pjsip/pjsip_configuration.c
@@ -1135,11 +1135,11 @@
 {
 	struct ast_sip_endpoint *endpoint = obj;
 	/* Valid non-alphanumeric characters for URI */
-	char *valid_uri_marks = "-_.!~*`()";
+	char *valid_uri_marks = "-._~%!$&'()*+,;=:";
 	const char *val;
 
 	for (val = var->value; *val; val++) {
-		if (!strchr(valid_uri_marks, *val) && !isdigit(*val) && !isalpha(*val)) {
+		if (!isalpha(*val) && !isdigit(*val) && !strchr(valid_uri_marks, *val)) {
 			ast_log(LOG_ERROR, "Error configuring endpoint '%s' - '%s' field "
 			"contains invalid character '%c'\n",
 			ast_sorcery_object_get_id(endpoint), var->name, *val);

-- 
To view, visit https://gerrit.asterisk.org/7156
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15.1
Gerrit-MessageType: merged
Gerrit-Change-Id: Id80c10a644508365c87b3182e99ea49da11b0281
Gerrit-Change-Number: 7156
Gerrit-PatchSet: 1
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171109/3561674b/attachment-0001.html>


More information about the asterisk-code-review mailing list