<?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><conf:fail expr="'catch-all caught ' + _event"/></catch>

<!-- bridge transfer terminated with DTMF fills "inputmode" shadow variable with "dtmf"

Test environment requirements:

1. Valid destination address
2. Destination is available to accept incoming calls
3. Destination answers incoming call
4. Originator presses DTMF sequence matching grammar to disconnect the callee.

-->

<form>
   
   <transfer name="xfer" dest="tel:+18005551212" bridge="true" maxtime="10s">
     <grammar root="root" mode="dtmf" version="1.0"
        xml:lang="en-US" type="application/srgs+xml" >
        <rule id="root" scope="public">
           <one-of>
             <item> 1 </item>
           </one-of>
        </rule>
     </grammar>
   
     <filled>
       <if cond="xfer == 'near_end_disconnect'">^M
         <if cond="typeof(xfer$) != 'object'">
           <conf:fail reason="xfer$ is not an object"/>
         <elseif cond="typeof(xfer$.inputmode) != 'string'"/>^M
           <conf:fail reason="xfer$.inputmode is not a string"/>
         <elseif cond="xfer$.inputmode != 'dtmf'"/>
           <conf:fail expr="'expected dtmf; got ' + xfer$.inputmode"/>
         <else/>^M
           <conf:pass/>
         </if>^M
       <else/>^M
         <conf:fail expr="'expected near_end_disconnect; got ' + xfer"/>
       </if> ^M

     </filled>
   </transfer>
</form>

</vxml>
