<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11267">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ael: Use Gosub in for loop expressions<br><br>In AEL2, if a 'for' statement contains macro* calls, like:<br><br> for (&iterator(${TRY},A); "${A}" != ""; &iterate(A)) {<br><br>The AEL2 parser will translate these into calls to the deprecated Macro<br>dialplan application and use the antiquated pipe delimiter.<br><br>Instead, convert these into calls to the Gosub dialplan application and<br>use commas as argument separators.<br><br>ASTERISK-18593 #close<br>Reported by: Luke-Jr<br><br>* 'macro' in this context means AEL2 macros, not the 'Macro' application<br><br>Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc<br>---<br>M res/ael/pval.c<br>1 file changed, 3 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/11267/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/ael/pval.c b/res/ael/pval.c</span><br><span>index bbfeb2d..03e9061 100644</span><br><span>--- a/res/ael/pval.c</span><br><span>+++ b/res/ael/pval.c</span><br><span>@@ -3541,18 +3541,14 @@</span><br><span> strcpy(buf2, strp3);</span><br><span> strp3 = strchr(buf2,'(');</span><br><span> if (strp3) {</span><br><span style="color: hsl(0, 100%, 40%);">- *strp3 = '|';</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- while ((strp3=strchr(buf2,','))) {</span><br><span style="color: hsl(0, 100%, 40%);">- *strp3 = '|';</span><br><span style="color: hsl(120, 100%, 40%);">+ *strp3 = ',';</span><br><span> }</span><br><span> strp3 = strrchr(buf2, ')');</span><br><span> if (strp3)</span><br><span> *strp3 = 0; /* remove the closing paren */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> for_init->appargs = strdup(buf2);</span><br><span> free(for_init->app);</span><br><span style="color: hsl(0, 100%, 40%);">- for_init->app = strdup("Macro");</span><br><span style="color: hsl(120, 100%, 40%);">+ for_init->app = strdup("Gosub");</span><br><span> } else { /* must be a regular app call */</span><br><span> char *strp3;</span><br><span> strcpy(buf2, strp2);</span><br><span>@@ -3599,7 +3595,7 @@</span><br><span> </span><br><span> for_inc->appargs = strdup(buf2);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- for_inc->app = strdup("Macro");</span><br><span style="color: hsl(120, 100%, 40%);">+ for_inc->app = strdup("Gosub");</span><br><span> } else { /* must be a regular app call */</span><br><span> char *strp3;</span><br><span> strcpy(buf2, strp2);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11267">change 11267</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11267"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc </div>
<div style="display:none"> Gerrit-Change-Number: 11267 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>