EVAL(variable)
Evaluates a variable twice. An example is useful: If the variable
${VAR} contains a string "${VAR2}", that is
what is returned when ${VAR} is called. If
Eval() is used, the nested variable is also evaluated, and
the contents of ${VAR2} are also returned.
; If VAR contains the string "${VAR2}" and VAR2 contains the string "Hel
lo World":
exten => 123,1,Set(foo=${EVAL(${VAR})})
; now foo is "Hello World"
|
|
|
Internal help for this application in Asterisk 1.4: -= Info about function 'EVAL' =-
[Syntax]
EVAL(<variable>)
[Synopsis]
Evaluate stored variables.
[Description]
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}".
diff output to internal help in Asterisk 1.2: - none - |