[asterisk-users] AEL2 Looping

Rushowr rushowr at phreaker.net
Sat Jul 29 16:23:37 MST 2006


Douglas,

Awesome! I don't know why I didn't get to the point of removing all the
spaces, probably got distracted by some shiny object ;-) 

Anyway, thanks for the update!

Rushowr 

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Douglas
Garstang
Sent: Saturday, July 29, 2006 6:58 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion; Asterisk Users
Mailing List - Non-Commercial Discussion
Subject: RE: [asterisk-users] AEL2 Looping

I actually did get it to work, by removing _all_ spaces from the for line...
 
for (x=0;${x}<3;x=${x}+1) {
 
This works for me. It's just a matter of finding WHICH space is breaking it.

	-----Original Message----- 
	From: Rushowr [mailto:rushowr at phreaker.net] 
	Sent: Sat 7/29/2006 12:24 PM 
	To: 'Asterisk Users Mailing List - Non-Commercial Discussion' 
	Cc: 
	Subject: RE: [asterisk-users] AEL2 Looping
	
	

	>> 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
	
	
	_______________________________________________
	--Bandwidth and Colocation provided by Easynews.com --
	
	asterisk-users mailing list
	To UNSUBSCRIBE or update options visit:
	   http://lists.digium.com/mailman/listinfo/asterisk-users
	






More information about the asterisk-users mailing list