Search:
     
3CX Phone System for Windows Download the Free Edition

Asterisk cmd ExecIf

ExecIf

Synopsis

Executes dialplan application, conditionally.

Usage:

Version 1.2 and 1.4
 ExecIF (<expr>|<app>|<data>)

Version 1.4.24.1
 ExecIF (<expr>?<app>|<data>)

Version 1.6
 ExecIf(expression?appiftrue(args)[:appiffalse(args)])

Description

If <expr> is true, execute and return the result of <app>(<data>).
If <expr> is true, but <app> is not found, then the application will return a non-zero value.

It is important not to have any spaces as it does not seem to like that (gives a could not find application if spaces are present).

Also note that the separator between the expression is a comma or a vertical bar, not a question mark (as is the case with GotoIf)(Version 1.2 and 1.4).
As of 1.6 the syntax is inline with GotoIf and the 1.2/1.4 syntax will give you errors.


Example

Version 1.2 and 1.4
exten => s,n,ExecIf($[${SYSTEMSTATUS} = SUCCESS]|Background|dictate/playback)

Version 1.4.24.1
exten => s,n,ExecIf($[${SYSTEMSTATUS} = SUCCESS]?Background|dictate/playback)

Version 1.6
exten => s,n,ExecIf($[${SYSTEMSTATUS} = SUCCESS]?Background(dictate/playback))




See also



Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Created by: JustRumours,Last modification on Wed 19 of Jan, 2011 [17:26 UTC] by gmalsack


Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

 





Search: