<menu>

Specifies a list of alternatives to the user and then transitions to the response provided by the user.

Attributes

This section describes the attributes you can set for this element.

Name

Data type

Default

accept

(exact | approximate)

exact

dtmf

(true | false)

false

id

ID

optional

scope

(document | dialog)

dialog

accept

The accept attribute specifies the default value for the accept attribute specified in every embedded <choice> element. See the <choice> element's accept attribute description for details.

dtmf

The dtmf attribute allows you to enable DTMF assignments for all choices in a menu. You can set the dtmf attribute to true or false (default). If you set the dtmf attribute to true, DTMF assignments such as 1, 2, and 3 will be implicitly assigned to any <choice> element that does not explicitly specify a DTMF sequence. By default, the dtmf attribute is set to false. This means that no implicit DTMF assignment will be made to <choice> elements that do not contain DTMF sequences.

id

The id attribute is the menu identifier. You set this attribute to specify the menu as the target for a <goto> or <submit> elements.

scope

The scope attribute allows you to set the scope of the menu’s grammar. You can set the scope in one of the following ways:

  • dialog (default)—The menu’s grammar is active only in the current menu.
  • document—The menu’s grammar is active throughout the current document. If the current document is the application root document, then the menu’s grammar will be active throughout your application.

Children

Parents

Sample code

<vxml>
    <menu id="nyc_menu" dtmf="true">
        <prompt> Welcome to new york city. Please select a
        borough.
            <enumerate>For <value expr="_prompt"/>, press
            <value expr="_dtmf"/>
            </enumerate>
        </prompt>
        <choice next="http://nyc.example/manhattan.vxml">
            Manhattan
        </choice>
        <choice next="http://nyc.example/bronx.vxml">
            The bronx <grammar> (?the bronx) </grammar>
        </choice>
        <choice next="http://nyc.example/brooklyn.vxml">
            <audio src="./prompts/brooklyn.wav"/>
            <grammar>brooklyn</grammar>
        </choice>
        <choice expr="'http://nyc.example/queens.vxml'">
            Queens
        </choice>
        <choice event="no_service_here">
            Staten island
        </choice>
    </menu>
</vxml>