Definition
The contents within this tag will execute if the variable value is equal to the result of the expression.
Value
The contents within this tag are more nodes to execute. This tag can also contain an "else" tag.
Attributes
Attribute | Required | Values | Description |
---|---|---|---|
name | N | any text | A unique name for the tag |
expr | Y | any text | A JavaScript expression to evaluate. Examples = " '${call.lastinput}' + ' 2 3'" or "1+2" or "${call.lastinput} + 10" |
Examples
This gives the user three attempts to press the correct button, then it ends the call.
<menu maxDigits="1" timeout="5500" name="menu">
<play type="tts">This is the play tag. Press 1 for more information.</play>
<keypress pressed="1">
<play type="tts">Nice job pressing one!</play>
<goto>hangup</goto>
</keypress>
<keypress pressed="default">
<goto>counter</goto>
</keypress>
</menu>
<if name="counter" expr="${count} > 2">
<play type="tts" voice="female2">Too many mistakes. Bye for now!</play>
<goto>hangup</goto>
</if>
<play type="tts">Oh dear. You are taking a long time. Try again.</play>
<setvar varname="count">${count} + 1</setvar>
<goto>menu</goto>
<hangup name="hangup"/>
Comments
0 comments
Please sign in to leave a comment.