[asterisk-bugs] [Asterisk 0014897]: expressions are not working

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Apr 14 15:16:49 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14897 
====================================================================== 
Reported By:                johnlange
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   14897
Category:                   Functions/func_math
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           1.4.23 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-04-14 14:54 CDT
Last Modified:              2009-04-14 15:16 CDT
====================================================================== 
Summary:                    expressions are not working
Description: 
In Asterisk 1.4.23.1, expressions don't seem to be working.

According to the docs (doc/channelvariables.txt),  you should be able to
do this:

exten => 1,2,Set(koko=$[2 * ${lala}])
        

In my system I have this:

exten => i,2,Set(TRIES=$[1 + ${TRIES}])

However, it generates this error:

 WARNING[6389]: ast_expr2.fl:407 ast_yyerror: ast_yyerror():  syntax
error: syntax error, unexpected $end, expecting '-' or '!' or '(' or
'<token>'; Input:
1 + 
    ^

I also reversed it:

exten => i,2,Set(TRIES=$[${TRIES} + 1])

But it still didn't work.

I know this worked in the past so is there something I'm not seeing or
are expressions not working in Asterisk?
====================================================================== 

---------------------------------------------------------------------- 
 (0103241) loloski (reporter) - 2009-04-14 15:16
 http://bugs.digium.com/view.php?id=14897#c103241 
---------------------------------------------------------------------- 
John,

I can't reproduce your issue, i will attach my sample dialplan please take
a look. anyway i'm on 1.4 SVN branch. i might overlook on what you are
trying to accomplish i might be wrong here too but anyway...


exten => *99,1,Set(COUNT=0)
exten => *99,n,Set(COUNT=$[${COUNT}+1])
exten => *99,n,GotoIf($[${COUNT} > 3]?15)
exten => *99,n,Noop(DEBUG: Login Try ${COUNT})
exten => *99,n,Read(agentnumber|agent-user)
exten => *99,n,Read(agentpass|agent-pass)
exten =>
*99,n,Set(AGENTNAME=${ODBC_GET_AGENTNAME(${agentnumber},${agentpass})})
exten => *99,n,Noop(DEBUG: Agent Name -> ${AGENTNAME})
exten => *99,n,GotoIf($["${AGENTNAME}" = ""]?2)
exten => *99,n,PauseQueueMember(queue|Sip/${agentnumber})
exten => *99,n,Playback(agent-pause)
exten => *99,n,Hangup() 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-04-14 15:16 loloski        Note Added: 0103241                          
======================================================================




More information about the asterisk-bugs mailing list