[asterisk-users] AEL2 Looping

Rushowr rushowr at phreaker.net
Sat Jul 29 11:24:46 MST 2006


>> context new_pbx_betty_start {
>> 
>>     _X. => { 
>>         for (x=0; ${x} < 3; x=${x} + 1) { 
>>             Verbose(x is ${x} !); 
>>         }                  
>>     };
>> 
>> }
>I would have to see the output of "show dialplan new_pbx_betty_start" to
know exactly >what is going on.  However, I'm guessing that if you remove
the space between the 
>semicolon and the "x=${x} + 1", it will work.

>On pretty much everything except expression evaluation (such as ${x} < 3),
Asterisk
>is sensitive to whitespace.  " x=${x} + 1" was most likely translated
directly into 
>Set( x=$[${x} = 1]).  That means you are setting the variable name, " x",
including 
>the leading space.  That is not the same variable as ${x} which you are
using 
>everywhere else.

Russel,

Stupid question, but isn't the AEL2 parser supposed to handle the above code
first? Hypothetically, if the parser DOES handle the code the example given
by Murf on voip-info (which is the exact code Douglas posted, other than the
name new_pbx_betty_start) should work properly. Also, to answer your
question, removing the space does not help. I'm actually getting a bug
report together concerning this, and I tested it with and without spaces in
multiple places in the for loop definition. I'd give examples but I don't
have access right now. 

Keep up the great work guys!
Rushowr





More information about the asterisk-users mailing list