[Asterisk-Users] match a set of numbers in GoToIf against a variable

John Millican john at millican.us
Fri Oct 14 16:56:06 MST 2005


Hello all,
Okay when you are done laughing at the simplicity of this question could 
someone show me please what I have wrong in the following statement?
GoToIf($[${numdial} != [1-9] ]?15:3);
What this is supposed to do is if numdial is not a single digit from 1 to 9 
inclusive goto 15, if it is a singledigit from 1 to 9 inclusive goto 3.  
Should be pretty simple but not working for me, always goes to 15.  from what 
I read on the wiki this should work, but obviously I must have read it wrong.

I can get this to work:
exten => 1,2, GoToIf($[${numdial} = 1 ]?15:3);
exten => 1,3, GoToIf($[${numdial} = 2 ]?15:4);
exten => 1,4 ,GoToIf($[${numdial} = 3 ]?15:5);
...
exten => 1,15, do other stuff
but I don't want to put this in 9 times.

Thanks in advance,
John M



More information about the asterisk-users mailing list