login | register
Thu 04 of Dec, 2008 [01:47 UTC]

voip-info.org

Discuss [0] History

Asterisk func eval

Created by: murf,Last modification on Sat 14 of Jan, 2006 [05:55 UTC]

Synopsis:

 Evaluate stored variables.

Description:

 EVAL(<variable>)
 
Using EVAL basically causes a string to be evaluated twice.
When a variable or expression is in the dialplan, it will be
evaluated at runtime. However, if the result of the evaluation
is in fact a variable or expression, using EVAL will have it
evaluated a second time. For example, if the variable ${MYVAR}
contains "${OTHERVAR}", then the result of putting ${EVAL(${MYVAR})}
in the dialplan will be the contents of the variable, OTHERVAR.
Normally, by just putting ${MYVAR} in the dialplan, you would be
left with "${OTHERVAR}".


Notes

  • *CLI> show function EVAL

Return value

Returns the resulting string.

Example

exten => s,1,Set(foo=${EVAL(${MYVAR})})


See also



Comments