Extensions array


#1

hi, its possible to do this???

[globals]

extensionsarray= [100,101,102,103 ]

[applications]

exteb => _22.,1,Answer()
exteb => _22.,2,DBget(Dual/${extensionsarray} = ${CALLERIDNUM})



ANY IDEAS OR HELP???
tHANK YOU


#2

[quote=“jaynro”]hi, its possible to do this???

[globals]

extensionsarray= [100,101,102,103 ]

[applications]

exteb => _22.,1,Answer()
exteb => _22.,2,DBget(Dual/${extensionsarray} = ${CALLERIDNUM})
[/quote]

It is possible to store a string into a variable in Asterisk, although I do not believe an array. So, in your example you are simply storing a string that contains:

[100,101,102,103 ]

Also, your applications section should be exten not exteb. Also, I do not use DBGet, so not sure if your application call is correct:

voip-info.org/wiki/index.php … +cmd+DBget


#3

What are you trying to do with that snippet? You might be able to do something with an macro instead.


#4

extensions.conf

[globals]
extensionsarray= [100,101,102,103 ]

[applications]
exten => _22.,1,Answer()
exten => _22.,2,DBget(Dual/${extensionsarray} = ${CALLERIDNUM})

instead of …

[applications]
extensions.conf
exten => _22.,1,Answer()
exten => _22.,2,DBget(Dual/100 = ${CALLERIDNUM})
…priority n+ 101… etc

exten => _22.,7,DBget(Dual/101 = ${CALLERIDNUM})


exten => _22.,12,DBget(Dual/102 = ${CALLERIDNUM})

any idea???
thanks