<?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">

<!-- Catch noinput (just to be explicit) -->
<catch event="noinput"> 
   <conf:fail reason="The noinput event should not be thrown if DTMF input is received before the end of playback of record prompts"/>
</catch>

<!-- Catch anything -->
<catch> 
   <conf:fail reason="event caught" expr="_event"/>
</catch>

<form>
    <var name="bFirstRun" expr="true"/>
    <block name="ctrl">
        <if cond="bFirstRun == true">
            <assign name="bFirstRun" expr="false"/>
            <clear namelist="ctrl"/>
            <goto nextitem="recording"/>
        <else/>
            <if cond="recording == undefined">
                <conf:pass/>
            <else/>
                <conf:fail reason="The recording variable must be undefined"/>
            </if>
            <exit/>
        </if>
    </block>
    
    <record name="recording" dtmfterm="true">
        <prompt>This is the first prompt. </prompt>

        <conf:dtmf value="7"/>

        <prompt>This is the second prompt. The dtmf input should be received when
        it is being played back. </prompt>

        <conf:recording value="nonspeech"/>

    </record>

    <block>
        <conf:fail reason="block after record reached"/>
    </block>
</form>

</vxml>
