[Home]

Summary:ASTERISK-14158: [patch] Invalid syntax with two ampersands in if block
Reporter:Atis Lezdins (atis)Labels:
Date Opened:2009-06-01 11:46:02Date Closed:2010-01-13 13:29:50.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:PBX/pbx_ael
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ael_condition_double_ampersands.patch
Description:Using syntax:

if (${a}=1 && ${b}=2) {

}

would generate a bad .conf file with:

GotoIf($[${a}=1 && ${b}=2]) which would always return false.

While it would be a feature to add support for double ampersands within IF block, it's still a good to warn users about such syntax mistakes
Comments:By: Tilghman Lesher (tilghman) 2010-01-10 16:35:54.000-0600

I think the actual issue is that the '&&', '||', and '==' are not getting properly parsed by the expression parser, even though they're meant to.  I have uploaded a patch that should fix this oversight.

By: Tilghman Lesher (tilghman) 2010-01-12 12:34:58.000-0600

Actually, no, now that I test it, it works perfectly.  I need more information in order to replicate this issue that you're having.

By: Atis Lezdins (atis) 2010-01-13 11:43:26.000-0600

Apparently dialplan expression parser has been fixed (at least in 1.6.1.6)