Summary:ASTERISK-15110: A func_math WARNING for a operation that is not executed in ExecIf
Reporter:Kristijan Vrban (vrban)Labels:
Date Opened:2009-11-10 08:31:10.000-0600Date Closed:2011-06-07 14:10:24
Versions:Frequency of
Description:I get a WARNING for a operation (in ExecIf) that i not executed. See example below. It is redundant to show that WARNING when ExecIf does not execute its operation.


-- Executing [*770000@main-functions:19] ExecIf("SIP/K000100001-0815e520", "0|MATH|10000+NULL") in new stack
[Nov 10 15:11:13] WARNING[16847]: func_math.c:174 math: 'NULL' is not a valid number
Comments:By: Leif Madsen (lmadsen) 2009-11-10 08:46:52.000-0600

Actually, because of the way things are expanded in Applications and Functions (ExecIf() for example), this is expected behaviour. The inside operations are evaluated first, and then ExecIf() determines whether to follow up on the true or false statement.

So what you're seeing is the MATH() function getting evaluated and returning a WARNING prior to anything being evaluated in ExecIf(). If it were to be true, then the value that was evaluated by MATH() would have been returned, otherwise, it is not returned; but it was still evaluated.