B.35. Exec()

Führt eine Asterisk-Anwendung dynamisch aus.
Exec(application(arguments))
Allows the execution of an arbitrary dialplan application, even if this application is not hardcoded into the dialplan. Returns the value returned by the application or -2 if the application cannot be found. The arguments are passed to the called application.
This applications enables the calling of applications out of a database or other external source.
exten => 123,1,Set(app=SayDigits(12345))
exten => 123,2,Exec(${app})

Important

A negative return value will mean that execution of the dialplan ends. If this is not desired, use TryExec().

Note

Internal help for this application in Asterisk 1.4:
  -= Info about application 'Exec' =- 

[Synopsis]
Executes dialplan application

[Description]
Usage: Exec(appname(arguments))
  Allows an arbitrary application to be invoked even when not
hardcoded into the dialplan.  If the underlying application
terminates the dialplan, or if the application cannot be found,
Exec will terminate the dialplan.
  To invoke external applications, see the application System.
  If you would like to catch any error instead, see TryExec.
diff output to internal help in Asterisk 1.2:
5c5
< Executes dialplan application
---
> Executes internal application
10,14c10,12
< hardcoded into the dialplan.  If the underlying application
< terminates the dialplan, or if the application cannot be found,
< Exec will terminate the dialplan.
<   To invoke external applications, see the application System.
<   If you would like to catch any error instead, see TryExec.
---
> hardcoded into the dialplan. To invoke external applications
> see the application System. Returns whatever value the
> app returns or a non-zero value if the app cannot be found.