C.27. IF()

IF(expression?trueVal:falseVal)
Returns a value depending on a condition. If the condition is true, the value following ? is returned, otherwise the value following : is returned.
; If ${Var}=123, return 5, otherwise return 9:
exten => 123,1,Set(foo=${IF($[ ${Var} = 123]?5:9)})

Note

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

[Syntax]
IF(<expr>?[<true>][:<false>])

[Synopsis]
Conditional: Returns the data following '?' if true else the data following ':'

[Description]
Not available
diff output to internal help in Asterisk 1.2:
- none -