[Asterisk-code-review] aelparse: Accept an included context with timings. (asterisk[18])

George Joseph asteriskteam at digium.com
Fri Aug 6 09:19:39 CDT 2021


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

Change subject: aelparse: Accept an included context with timings.
......................................................................

aelparse: Accept an included context with timings.

With Asterisk 1.6.0, in the main parser for the configuration file
extensions.conf, the separator was changed from vertical bar to comma.
However, the first separator was not changed in aelparse; it still had
to be a vertical bar, and no comma was allowed.

Additionally, this change allows the vertical bar for the first and
last parameter again, even in the main parser, because the vertical bar
was still accepted for the other parameters.

ASTERISK-29540

Change-Id: I882e17c73adf4bf2f20f9046390860d04a9f8d81
---
M main/pbx_include.c
M main/pbx_timing.c
M utils/extconf.c
3 files changed, 4 insertions(+), 4 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/main/pbx_include.c b/main/pbx_include.c
index 1bdc396..188bce1 100644
--- a/main/pbx_include.c
+++ b/main/pbx_include.c
@@ -94,7 +94,7 @@
 	new_include->rname = p;
 	strcpy(p, value);
 	/* Strip off timing info, and process if it is there */
-	if ((c = strchr(p, ',')) ) {
+	if ( (c = strchr(p, '|')) || (c = strchr(p, ',')) ) {
 		*c++ = '\0';
 		new_include->hastime = ast_build_timing(&(new_include->timing), c);
 	}
diff --git a/main/pbx_timing.c b/main/pbx_timing.c
index b3ef089..1f76ab8 100644
--- a/main/pbx_timing.c
+++ b/main/pbx_timing.c
@@ -217,7 +217,7 @@
 
 	/* count the number of fields in the timespec */
 	for (j = 0, num_fields = 1; info[j] != '\0'; j++) {
-		if (info[j] == ',') {
+		if (info[j] == '|' || info[j] == ',') {
 			last_sep = j;
 			num_fields++;
 		}
diff --git a/utils/extconf.c b/utils/extconf.c
index 674f5df..afc893c 100644
--- a/utils/extconf.c
+++ b/utils/extconf.c
@@ -3822,7 +3822,7 @@
 
 	/* count the number of fields in the timespec */
 	for (j = 0, num_fields = 1; info[j] != '\0'; j++) {
-		if (info[j] == ',') {
+		if (info[j] == '|' || info[j] == ',') {
 			last_sep = j;
 			num_fields++;
 		}
@@ -4525,7 +4525,7 @@
 	new_include->rname = p;
 	strcpy(p, value);
 	/* Strip off timing info, and process if it is there */
-	if ( (c = strchr(p, '|')) ) {
+	if ( (c = strchr(p, '|')) || (c = strchr(p, ',')) ) {
 		*c++ = '\0';
 		new_include->hastime = ast_build_timing(&(new_include->timing), c);
 	}

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

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: I882e17c73adf4bf2f20f9046390860d04a9f8d81
Gerrit-Change-Number: 16246
Gerrit-PatchSet: 2
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.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/20210806/6220dccb/attachment.html>


More information about the asterisk-code-review mailing list