Name

IF — Conditional value selection

Synopsis

IF(expr?[true][:false])

Conditional: returns the data following ? if true, otherwise the data following :.

; Returns foo
exten => 123,1,Set(something=${IF($[2 > 1]?foo:bar)})
; Returns bar
exten => 123,n,Set(something=${IF($[2 < 1]?foo:bar)})

See Also

GotoIf()

Get Asterisk: The Future of Telephony, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.