[asterisk-users] Re: Arrays ???

Pele Zico daysmen3 at yahoo.co.uk
Wed Aug 2 10:48:38 MST 2006


Benchev wrote:

> On Wednesday 02 August 2006 18:09, Pele Zico wrote:
>> Is their a way of implementing arrays in asterisk??  What im trying to do
>> is allow the user to input numbers (internal and external) from his line
>> thats gets saved via astdb - (follow me purposes) - i would like to look
>> t each number individually and check for CF, CFB CFU etc etc . can this
>> be
>> done or would i have to use AGI.  i prefer not to use agi however
> *CLI> show version
> Asterisk SVN-trunk-r37291
> *CLI> show function ARRAY
> 
> -= Info about function 'ARRAY' =-
> 
> [Syntax]
> ARRAY(var1[|var2[...][|varN]])
> 
> [Synopsis]
> Allows setting multiple variables at once
> 
> [Description]
> The comma-separated list passed as a value to which the function is set
> will be interpreted as a set of values to which the comma-separated list
> of variable names in the argument should be set.
> Hence, Set(ARRAY(var1|var2)=1\,2) will set var1 to 1 and var2 to 2
> Note: remember to either backslash your commas in extensions.conf or quote
> the entire argument, since Set can take multiple arguments itself.
> 
> So probably with 1.4 will come.
> 
> Benchev
> _______________________________________________
> --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


Im aware of ARRAY and would have used it but it only sets variables - you
cant reference the array by name or its elements as is common in other
programming languages.  

Would it be possible to use ASTDB and the "while" application?  For instance
the user inputs 3 numbers to be used for Follow me and the dial plan
iterates thru them checking for CF CW etc etc changing the numbers if needs
be then dialling.  




More information about the asterisk-users mailing list