Skip to end of metadata
Go to start of metadata

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.

Example: Custom dialplan functions

Any variables in the evaluated data will be resolved in the context of that extension. For example, ${EXTEN} would refer to the EVAL_EXTEN extension, not the extension in the context invoking the function. This behavior is similar to other applications, e.g. Gosub.

Example: Choosing which prompt to use

Extensions on which EVAL_EXTEN is invoked are not different from other extensions. However, the application at that extension is not executed. Only the application data is parsed and evaluated.

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.

Syntax

EVAL_EXTEN(context,extensions,priority)
Arguments
  • context
  • extensions
  • priority

See Also

Import Version

This documentation was imported from Asterisk Version GIT-19-1e29935

  • No labels