EVAL_EXTEN()¶
Synopsis¶
Evaluates the contents of a dialplan extension and returns it as a string.
Description¶
The EVAL_EXTEN function looks up a dialplan entry by context,extension,priority, evaluates the contents of a Return statement to resolve any variable or function references, and returns the result as a string.
You can use this function to create simple user-defined lookup tables or user-defined functions.
[call-types]
exten => _1NNN,1,Return(internal)
exten => _NXXNXXXXXX,1,Return(external)
[udf]
exten => calleridlen,1,Return(${LEN(${CALLERID(num)})})
[default]
exten => _X!,1,Verbose(Call type ${EVAL_EXTEN(call-types,${EXTEN},1)} - ${EVAL_EXTEN(udf,calleridlen,1)})
same => n,Read(input,${EVAL_EXTEN(prompts,${CALLERID(num)},1)})
[prompts]
exten => _X!,1,Return(default)
exten => _20X,1,Return(welcome)
exten => _2XX,1,Return(${DB(promptsettings/${EXTEN})})
exten => _3XX,1,Return(${ODBC_MYFUNC(${EXTEN})})
A limitation of this function is that the application at the specified extension isn't actually executed, and thus unlike a Gosub, you can't pass arguments in the EVAL_EXTEN function.
If you need the ability to evaluate more complex logic that cannot be done purely using functions, see 'EVAL_SUB'.
Syntax¶
Arguments¶
-
context
-
extensions
-
priority
See Also¶
Generated Version¶
This documentation was generated from Asterisk branch 20 using version GIT