ExecIf()

Executes an Asterisk application under specific conditions.

        
          ExecIf(expression,application,arguments)
        
      

If expression evaluates to true, the defined application is executed with the provided arguments, and the return value is returned. See doc/README.variables (1.2) / doc/channelvariables.txt (1.4) for more information about standard expressions for Asterisk.

If expression evaluates to false, execution moves to the next priority in the extension.

exten => 123,1,ExecIf($[${CALLERID(num)} = 101],SayDigits,123)
exten => 123,n,SayDigits(678)
[Note]

Internal help for this application in Asterisk 1.4: 

  -= Info about application 'ExecIf' =- 

[Synopsis]
Executes dialplan application, conditionally

[Description]
Usage:  ExecIF (<expr>|<app>|<data>)
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.

diff output to internal help in Asterisk 1.2: 

5c5
< Executes dialplan application, conditionally
---
> Conditional exec
12d11
< 

See also.  the section called “Exec()