Re: [Asterisk-Users] Bug in my head or bug in the code?

2003-09-06 Thread Martin Pycko
What does this step show on the CLI ?
exten = 1,1,SetVar(FOO=123**)
exten = 1,2,SetVar(CHECK=${FOO:-1:1})

? If you're going to see CHECK=* then there is a bug in = operator ...

Martin

On Fri, 5 Sep 2003, John Todd wrote:

 I am having Yet Another Regular Expression problem, but this one
 might not be my fault, or at least it might not be obviously my
 fault.  :-)


 exten = 2212,1,SetVar(FOO=123456**)
 exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = *])

 This script continues with a value of 0 in BAR.

 Similarly, none of the following changes made a difference in that
 result, which is expected since the * is not listed in
 README.variables as a character that must be escaped:

 exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = *])
 exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = \*])
 exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = \*])

 I have also tried setting the variable ${BAZ}=*  and then using that
 in my comparison, with the same unexpected results.

 Oddly enough, this almost-identical example below has different, but
 normal, results: BAR=1

 exten = 2212,1,SetVar(FOO=123456##)
 exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = #])


 What gives?  Am I colliding with a problem that is the result of the
 * character being used in expr evaluations and somehow not being
 handled correctly, or am I simply not implementing the syntax
 correctly?

 JT
 ___
 Asterisk-Users mailing list
 [EMAIL PROTECTED]
 http://lists.digium.com/mailman/listinfo/asterisk-users


___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Bug in my head or bug in the code?

2003-09-05 Thread John Todd
I am having Yet Another Regular Expression problem, but this one 
might not be my fault, or at least it might not be obviously my 
fault.  :-)

exten = 2212,1,SetVar(FOO=123456**)
exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = *])
This script continues with a value of 0 in BAR.

Similarly, none of the following changes made a difference in that 
result, which is expected since the * is not listed in 
README.variables as a character that must be escaped:

exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = *])
exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = \*])
exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = \*])
I have also tried setting the variable ${BAZ}=*  and then using that 
in my comparison, with the same unexpected results.

Oddly enough, this almost-identical example below has different, but 
normal, results: BAR=1

exten = 2212,1,SetVar(FOO=123456##)
exten = 2212,2,SetVar(BAR=$[${FOO:-1:1} = #])
What gives?  Am I colliding with a problem that is the result of the 
* character being used in expr evaluations and somehow not being 
handled correctly, or am I simply not implementing the syntax 
correctly?

JT
___
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users