<?xml version="1.0" encoding="UTF-8"?>
<!-- @ Copyright 1998-2003 W3C (MIT, ERCIM, Keio), All Rights Reserved. See http://www.w3.org/Consortium/Legal/. @ -->
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml" xmlns:conf="http://www.w3.org/2002/vxml-conformance">
  <property name="termtimeout" value="10s"/>
  <property name="termchar" value="#"/>

  <!-- allows some processing and prompt time -->
  <var name="processingTime" expr="5000"/>
  <var name="start" expr="new Date()"/>

  <link dtmf="1" event="com.example.dtmf1"/>

  <catch event="com.example.dtmf1">
    <var name="elapsed" expr="new Date() - start"/>
    <conf:comment>elapsed time = <value expr="elapsed"/></conf:comment>
    <if cond="elapsed &gt; 10000 &amp;&amp; elapsed &lt; (elapsed+processingTime)">
      <conf:pass/>
    <else/>
      <conf:fail expr="'expected between 10s and 15s; got ' + elapsed + ' milliseconds'"/>
    </if>
  </catch>

  <catch>
    <conf:fail expr="'catch-all caught ' + _event"/>
  </catch>

  <form id="form1">
    <nomatch>
      <conf:fail reason="bad DTMF was recognized"/>
    </nomatch>
    <field name="field1">
      <conf:dtmf value="1"/>
      <nomatch>
        <conf:fail reason="bad DTMF was recognized"/>
      </nomatch>
    </field>
  </form>
</vxml>
