<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11268">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  Friendly Automation: Approved for Submit

</div><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;"><span>diff --git a/res/ael/pval.c b/res/ael/pval.c</span><br><span>index f927077..4e9a525 100644</span><br><span>--- a/res/ael/pval.c</span><br><span>+++ b/res/ael/pval.c</span><br><span>@@ -3540,18 +3540,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>@@ -3598,7 +3594,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/+/11268">change 11268</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/+/11268"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I3d73716033b8e3e42e0209d355bf5f10c97045fc </div>
<div style="display:none"> Gerrit-Change-Number: 11268 </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-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>