The contents within this tag will execute if the variable value is equal to the result of the expression.


The contents within this tag are more nodes to execute. This tag can also contain an "else" tag.


Attribute Required Values Description
name N any text A unique name for the tag
loggingEnabled Y any text A JavaScript expression to evaluate. Examples = " '${call.lastinput}' + ' 2 3'" or "1+2" or "${call.lastinput} + 10"


This gives the user three attempts to press the correct button, then it ends the call.

<dialplan name="Root">
    <setvar varname="Counter">0</setvar>
        <menu name="Menu" maxdigits="1" timeout="3500">
            <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>
            <keypress name="keypress" pressed="timeout">
                <setvar varname="Counter">${Counter}+1</setvar>
                <if expr="${Counter} > 2">
                    <play type="tts">Too many mistakes.  Bye for now!</play>
                    <hangup name="hangup">
                <play type="tts">Oh dear.  You are taking a long time.  Try again.</play>