Looping through variables, or sort of but not really arrays [was, bizarrely, RE: [Asterisk-Users] is there a web interface to this mailing list?]

Mike Pollitt mike at limeboy.com
Thu Feb 16 02:50:45 MST 2006


Actually, you can do this:

exten => s,1,Set(TRUNK1=foo)
exten => s,n,Set(TRUNK2=bar)
exten => s,n,Set(TRUNK3=gak)
exten => s,n,Set(INDEX=1)
exten => s,n,Set(CURRTRUNK=${TRUNK${INDEX}})
exten => s,n,Dial(${CURRTRUNK}/5555555|60)

and you could increment INDEX (although these are local, (are you local?) so
you'd have to do it locally).

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Douglas
Garstang
Sent: Thursday, 16 February 2006 5:26 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion; Asterisk Users
Mailing List - Non-Commercial Discussion
Subject: RE: [Asterisk-Users] is there a web interface to this mailing list?

Wow. I'm thinking I've got some agreeance with this. The similarity to
assembler actually hit me today like a freight train, after I once again,
'hit the wall' trying to implement something in extensions.conf.
 
In a shell script, you can do something like this:
 
$var"$num"
 
and if var=NUM and num=1, you'd get NUM1, I was trying to loop through some
variables called NUM1, NUM2, NUM3 etc. Grrrr

	-----Original Message----- 
	From: Johnathan Corgan [mailto:jcorgan at aeinet.com] 
	Sent: Wed 2/15/2006 10:54 PM 
	To: Asterisk Users Mailing List - Non-Commercial Discussion 
	Cc: 
	Subject: Re: [Asterisk-Users] is there a web interface to this
mailing list?
	
	

	Douglas Garstang wrote:
	> Yes, programming the dialplan is akin to programming assembler.
	Too funny.  But true.
	
	The first time I did a 'show dialplan' after trying out AEL, I felt
like
	I was seeing an assembler dump of C++ :-)
	
	-Johnathan
	
	_______________________________________________
	--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