[Asterisk-code-review] res_ael: Use Gosub in for loop expressions (...asterisk[13])
Sean Bright
asteriskteam at digium.com
Thu Apr 11 15:37:59 CDT 2019
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/11267
Change subject: res_ael: Use Gosub in for loop expressions
......................................................................
res_ael: Use Gosub in for loop expressions
In AEL2, if a 'for' statement contains macro* calls, like:
for (&iterator(${TRY},A); "${A}" != ""; &iterate(A)) {
The AEL2 parser will translate these into calls to the deprecated Macro
dialplan application and use the antiquated pipe delimiter.
Instead, convert these into calls to the Gosub dialplan application and
use commas as argument separators.
ASTERISK-18593 #close
Reported by: Luke-Jr
* 'macro' in this context means AEL2 macros, not the 'Macro' application
Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc
---
M res/ael/pval.c
1 file changed, 3 insertions(+), 7 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/11267/1
diff --git a/res/ael/pval.c b/res/ael/pval.c
index bbfeb2d..03e9061 100644
--- a/res/ael/pval.c
+++ b/res/ael/pval.c
@@ -3541,18 +3541,14 @@
strcpy(buf2, strp3);
strp3 = strchr(buf2,'(');
if (strp3) {
- *strp3 = '|';
- }
- while ((strp3=strchr(buf2,','))) {
- *strp3 = '|';
+ *strp3 = ',';
}
strp3 = strrchr(buf2, ')');
if (strp3)
*strp3 = 0; /* remove the closing paren */
-
for_init->appargs = strdup(buf2);
free(for_init->app);
- for_init->app = strdup("Macro");
+ for_init->app = strdup("Gosub");
} else { /* must be a regular app call */
char *strp3;
strcpy(buf2, strp2);
@@ -3599,7 +3595,7 @@
for_inc->appargs = strdup(buf2);
- for_inc->app = strdup("Macro");
+ for_inc->app = strdup("Gosub");
} else { /* must be a regular app call */
char *strp3;
strcpy(buf2, strp2);
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11267
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc
Gerrit-Change-Number: 11267
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190411/cf65cf79/attachment.html>
More information about the asterisk-code-review
mailing list