<?xml version="1.0" encoding="UTF-8"?>

<callxml version="2.0">
  <block label="tryagain">
    <text>Tell me how many ways you love me?</text>
    <block repeat="4">
        <getdigits termdigits="0123456789" maxdigits="1" var="reasons" maxsilence="10s"/>
        <onmaxtime><text>Is it this hard to decide?</text></onmaxtime>
        <ontermdigit value="0"><text>I was not prepared for this. Please try again.</text></ontermdigit>
        <onmaxsilence><text>Silence? Please choose something</text></onmaxsilence>

        <ontermdigit value="9" next="#reason9" />
        <ontermdigit value="8" next="#reason8" />
        <ontermdigit value="7" next="#reason7" />
        <ontermdigit value="6" next="#reason6" />
        <ontermdigit value="5" next="#reason5" />
        <ontermdigit value="4" next="#reason4" />
        <ontermdigit value="3" next="#reason3" />
        <ontermdigit value="2" next="#reason2" />
        <ontermdigit value="1" next="#reasononly" />
        <onmaxdigits><text>Is that a digit? Not sure. Try again.</text></onmaxdigits>
    </block>
    <text>I think we pretty much have explored all the options. Bye.</text>
    <exit />
  </block>

  <block label="reason9" next="#reason8"><text>The way number nine is</text><wait value="2s" /></block>
  <block label="reason8" next="#reason7"><text>The way number eight is</text><wait value="2s" /></block>
  <block label="reason7" next="#reason6"><text>The way number seven is</text><wait value="2s" /></block>
  <block label="reason6" next="#reason5"><text>The way number six is</text><wait value="2s" /></block>
  <block label="reason5" next="#reason4"><text>The way number five is</text><wait value="2s" /></block>
  <block label="reason4" next="#reason3"><text>The way number four is</text><wait value="2s" /></block>
  <block label="reason3" next="#reason2"><text>The way number three is</text><wait value="2s" /></block>
  <block label="reason2" next="#reason1"><text>The way number two is</text><wait value="2s" /></block>
  <block label="reason1" next="#callme"><text>And the top way is</text></block>

  <block label="reasononly" next="#callme"><text>You only need one reason? cool! Let me tell you</text><wait value="2s" /></block>
  <block label="callme" >
      <text>Actually you can quickly tell me now</text>
      <recordaudio value="mailto:address@example.com?subject=Valentine Message&amp;fromname=Valentine&amp;fromaddress=address@example.com&amp;body=You have a valentine response&amp;filename=valentine.wav" maxtime="120s"/> 
      <onmaxsilence next="#thank"/><onmaxtime next="#thank"/> <ontermdigit next="#thank" />
  </block>
  <block label="thank">
      <text>Thank you. I love you too. Now you can call me in person!</text>
  </block>
</callxml>
