Page 420 - Asterisk™: The Future of Telephony
P. 420
EndWhile() Ends a while loop
EndWhile()
Returns to the previously called While() application. See While() for a complete de-
scription of how to use a while loop.
exten => 123,1,Set(COUNT=1)
exten => 123,2,While($[ ${COUNT} < 5 ])
exten => 123,3,SayNumber(${COUNT})
exten => 123,4,Set(COUNT=$[${COUNT} + 1]
exten => 123,5,EndWhile()
See Also
While(), ExitWhile(), GotoIf()
Exec() Executes an Asterisk application dynamically
Exec(appname(arguments))
Allows an arbitrary application to be invoked even when not hard-coded in to the
dialplan. Exits exactly the same as the underlying application, or abnormally, if the
underlying application cannot be found. The arguments are passed to the called
application.
This application allows you to dynamically call applications by pulling them from a
database or other external source.
exten => 123,1,Set(MYAPP=SayDigits(12345))
exten => 123,2,Exec(${MYAPP})
See Also
The EVAL, TryExec(), ExecIf()
ExecIf() Conditionally executes an Asterisk application
ExecIf(expression,application,arguments)
If expression is true, executes the given application with arguments as its arguments,
and returns the result. For more information on Asterisk expressions, see Chapter 6 or
the channelvariables.txt file in the doc/ subdirectory of the Asterisk source.
If expression is false, execution continues at the next priority.
exten => 123,1,ExecIf($[ ${CALLERIDNUM} = 101 ],SayDigits,12345)
exten => 123,2,SayDigits(6789)
392 | Appendix B: Application Reference