I've had this same problem before, and I'm banging my head trying to
remember how I solved it.
It's a funky syntax thing, I just can't put my finger on it.
Play around with quotes and spaces. I seem to recall some funky stuff with
the parser, especially in earlier asterisk versions.
Jim
Bruce Nik wrote:
> Thanks for the input Jim. Doing Noop() before the statement
> is run gives me an integer. That is for sure not a string
> because variableA has been calculated by MATH function as I
> stated earlier. Your second suggestion Noop ($[${variableA} <
> 10]) gives me 0. Return should be 0 and that just makes sense
> because I run it at values above 10. But, the problem is that
> the context goes to whatever is after the ? mark and not after the :
>
> Also, as for the testing with an actual integer goes, it just
> works fine. I inputed 15 and it works fine. I can also see
> the return 0 in the main line when it's run but the next line
> shows the context jumping a line which hold "true" context.
>
> I have also tried to use line number instead of context name
> (e.g. true or false) but still the result is the same.
>
> Regards,
> Bruce
>
>> From: [EMAIL PROTECTED]
>> To: [email protected]
>> Date: Thu, 6 Mar 2008 23:10:06 -0500
>> Subject: RE: [on-asterisk] Dialplan problem
>>
>> Bruce Nik wrote:
>>> Hello everyone,
>>>
>>> The first statement seems to work and jumps to the right context.
>>> The second statement yields 0 and always jumps to "true" (which is
>>> odd). Can anyone please tell me whats wrong here?
>>>
>>> Version 1: exten => s,n,GotoIf,($[20 <
>>> 10]?true:false)
>>>
>>> Version 2: exten =>
>>> s,n,GotoIf,($[${variableA} < 10]?true:false)
>>>
>>> Version two is run under a MATH condition where variableA is
>>> returned as an integer bigger than 10. I can see the output to be 0
>>> (being false) and yet the jump is gone to "true" context.
>>
>> Throw in a Noop(${variableA}) in so you can visually confirm the
>> variable contains an integer. Then just for good measure toss in a
>> Noop($[${variableA} < 10]) to make sure you get either 0 or 1 back.
>> If VariableA is null (or undefined) you may need to explicitly set
>> the value of the variable to "0" before running the Gotoif.
>>
>> Jim
>>
>>
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
>> commands, e-mail: [EMAIL PROTECTED]
>>
>
> _________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]