[asterisk-bugs] [Asterisk 0012467]: Can't add 0 in front of function result within if() block of AEL

noreply at bugs.digium.com noreply at bugs.digium.com
Mon Apr 21 05:16:07 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12467 
====================================================================== 
Reported By:                atis
Assigned To:                murf
====================================================================== 
Project:                    Asterisk
Issue ID:                   12467
Category:                   PBX/pbx_ael
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.19 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-17-2008 08:23 CDT
Last Modified:              04-21-2008 05:16 CDT
====================================================================== 
Summary:                    Can't add 0 in front of function result within if()
block of AEL
Description: 
I'm trying to construct syntax that will allow to use function result
directly in mathematical expression, and in case if function result is
empty (NULL), interpret that as 0. This works fine from .conf file or
realtime table:

Set(calls_missed_queue=$[0${DB(agent_globals/${target_num}/calls_missed_queue_${call_from_queue})}+1])

Here's the line from AEL that doesn't work:

if
(${GROUP_COUNT(${target_num}@agent_queue_b)}=1+0${DB(skip_group/${target_num}/agent_queue_b)});

Seems that there's no way how to use this within if() check directly, it
returns error at AEL compile time ("aelparse -d -n -w -q extensions.ael")




====================================================================== 

---------------------------------------------------------------------- 
 atis - 04-21-08 05:16  
---------------------------------------------------------------------- 
Ok, true, this warning doesn't stop aelparse from generating output file.

I noticed another thing with this - this syntax seems to be working in
Set() - for example:

  Set(test_if=$[0${DB(skip_group/${target_num}/agent_queue_b)}+1]);
  if (${GROUP_COUNT(${target_num}@agent_queue_b)}=${test_if}) {

gives no warnings.

Ok, i don't completely understand all the internals of ast_expr2 and why
is it so, but from my point of view i find it strange that syntax
$[0${whatever}] works in Set() but doesn't work in if(). Maybe it's
possible to add another check after ast_expr2, to see if it's constant
concatenated?

So, You propose do add ~~ for concatenation? That seems a bit weird and
not intuitive. I would like something more traditional, for example
"0$"{whatever} or "0${whatever}" 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-21-08 05:16  atis           Note Added: 0085738                          
======================================================================




More information about the asterisk-bugs mailing list