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