Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

noinput

Executes when the user does not speak within the active field.

<noinput 
cond = "ECMAScript_Expression"
count = "integer"
/>

cond

A condition that must evaluate to true for this element to be selected by the form interpretation algorithm.

count

Used by the VoiceXML interpreter in the event handler selection process, allowing the developer to handle multiple occurrences of the noinput event in a unique manner. The default value is 1.

The noinput event handler catches the noinput event. The Platform throws a noinput event if it doesn't hear spoken or DTMF input within the designated timeout interval.

The noinput element is shorthand for a catch element with its event attribute set to "noinput."

The following example includes three noinput handlers. The first two handlers play a message and give the user another opportunity to supply input; the third terminates the application.

<?xml version="1.0"?>
<vxml version="2.1"
 xmlns="http://www.w3.org/2001/vxml">
   <link event="help">
      
      <grammar mode="voice"
         root="root_rule"
         tag-format="semantics/1.0"
         type="application/srgs+xml"
         version="1.0"
         xml:lang="en-US">
            <rule id="root_rule" scope="public">
                  <one-of>
                        <item weight="1.0">
                              help
                        </item>
                  </one-of>
            </rule>

      </grammar>

      
      <grammar mode="dtmf"
         root="root_rule"
         tag-format="semantics/1.0"
         type="application/srgs+xml"
         version="1.0">
            <rule id="root_rule" scope="public">
                  <one-of>
                        <item>
                              0
                        </item>
                  </one-of>
            </rule>

      </grammar>

   </link>

   <form id="pick_fruit">

   <field name="fruit">
      <prompt>
      Pick a fruit
      </prompt>

      
      <grammar mode="voice"
         root="root_rule"
         tag-format="semantics/1.0"
         type="application/srgs+xml"
         version="1.0"
         xml:lang="en-US">
            <rule id="root_rule" scope="public">
                  <one-of>
                        <item>
                              <one-of>
                                    <item>
                                          apple
                                    </item>
                              </one-of>
                              <tag>out.fruit = "apple";</tag>
                        </item>
                        <item>
                              <one-of>
                                    <item>
                                          orange
                                    </item>
                              </one-of>
                              <tag>out.fruit = "orange";</tag>
                        </item>
                        <item>
                              <one-of>
                                    <item>
                                          pear
                                    </item>
                              </one-of>
                              <tag>out.fruit = "pear";</tag>
                        </item>
                        <item>
                              <one-of>
                                    <item>
                                          repeat
                                    </item>
                              </one-of>
                              <tag>out.fruit = "repeat";</tag>
                        </item>
                  </one-of>
            </rule>

      </grammar>


      <!-- handle the first noinput for this field -->
      <noinput count="1">
         I'm sorry. I didn't hear you.
         <reprompt/>
      </noinput>

      <!-- handle the second noinput for this field -->
      <noinput count="2">
         I'm sorry. I still didn't hear you. Please say apple, orange or pear.
      </noinput>

      <!-- handle the third noinput for this field -->
      <noinput count="3">
         <exit />
      </noinput>

      <!-- handle all help events for this field -->
      <help>
         Say apple, orange, or pear.
      </help>

      <!-- handle all nomatch events for this field -->
      <nomatch>
         I'm sorry. I didn't get that.
         <reprompt/>
      </nomatch>

      <filled>
      <log>Recognized <value expr="fruit"/></log>
      <if cond="'repeat' == fruit">
         <clear namelist="fruit"/>
         <reprompt/>
      <else/>
         you chose <value expr="fruit"/>
         <exit />
      </if>
      </filled>

      </field>
   </form>
</vxml>

Handling Events

Community Additions

ADD
Show:
© 2015 Microsoft