IF

IF

The 'IF' step implements the standard 'IF' programming construct.

The IF step can have up to four (4) conditionals for evaluation which are 'And'ed together.

If you add an IF step to your route you MUST add a matching 'End If' to the same route after the IF step.

You may have multiple IF End-IF pairs including nested pairs.

You can also utilise the 'Else' step.

The IF step is extremely powerful and allows you to route calls based on all sorts of conditions including user input.

Example:


Read Digit: Prompt='Press 1 to continue the call or 2 to hangup', Response stored in Route Variable 'responseDigit'
IF <responseDigit=2>
Hangup
Else
Play Message <some message>
End If


In the above psuedo code the Route requests the caller to enter a digit and then depending on the response either hangs up or plays a message.

Conditions

The IF step takes up to four conditions allowing you to compare a variable to another variable or to a literal (fixed value).

All four conditions are 'And'ed together, which simply means that the all have to be true for the If condition to fire.

If any of the conditions evaluate to false then the steps within the If condition will not run UNLESS you have an 'Else' step in which case the steps after the Else Step will run.