Multi Question Poll

<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.w3.org/2001/vxml
   http://www.w3.org/TR/voicexml20/vxml.xsd" version="2.0">
<property name="inputmodes" value="dtmf"/>
<property name="termchar" value="*"/>
<!-- Document Variables -->
<var name="callid" expr="session.telephone.dnis"/>
<var name="telephone" expr="session.telephone.ani"/>
<var name="formid" expr="0"/>
<var name="choice" expr="-1"/>
<var name="voicemail" expr="'nomessage'"/>

<!-- Top Level Menu -->
<menu id="top" dtmf="true">
  <!-- Set the Input Mode to DTMF -->
  <property name="inputmodes" value="dtmf"/>
  <!-- Set the top level prompt -->
  <prompt>
      <audio src="JSRecording1.wav"/>
  </prompt>
  <choice next="#firstPrompt">
     The First Prompt
  </choice>
  <choice next="#secondPrompt">
     The Second Prompt
  </choice>
</menu>

<!--First Prompt-->
<form id="firstPrompt">
     <!-- Bonus questions can change -->
     <block>
        <assign name="formid" expr="'firstPrompt'"/>
     </block>
     <field name="recording2" type="digits?length=1">
     <prompt>
       <audio src="JSRecording2.wav"/>
       <audio src="JSRecording3.wav"/>
     </prompt>
      <filled>
          <assign name="choice" expr="recording2" />
          <if cond="recording2 == '1'">
                    <prompt>An agent will call you back. Goodbye!</prompt>
                    <submit next="http://beta.callfire.com/vxml/servlet/DocumentServer" method="post" namelist="callid telephone formid choice"/>
          <elseif cond="recording2 == '2'" />
                    <submit next="http://beta.callfire.com/vxml/servlet/DocumentServer" method="post" namelist="callid telephone formid choice"/>
          <else/>
          </if>
      </filled>
     </field>
</form>

<!--Second Prompt-->
<form id="secondPrompt">
     <block>
        <assign name="formid" expr="'secondPrompt'"/>
    </block>
    <field name="recording4" type="digits?length=1">
      <prompt>
         <audio src="JSRecording4.wav"/>
      </prompt>
      <filled>
          <assign name="choice" expr="recording4" />
          <if cond="recording4 == '1'">
                <prompt>An agent will call you back. Goodbye!</prompt>
                <submit next="http://beta.callfire.com/vxml/servlet/DocumentServer" method="post" namelist="callid telephone formid choice"/>
          <elseif cond="recording4 == '2'" />
               <goto next="#recordMessage"/>
          <else/>
          </if>
      </filled>
    </field>
</form>

<!--Record Prompt-->
<form id="recordMessage">
        <record name="message" maxtime="300s" finalsilence="2500ms">
                <prompt> <audio src="JSRecording5.wav" /></prompt>
                <noinput>I didn't hear anything, please try again</noinput>
        </record>
        <field name="confirm" type="digits?length=1">
                <prompt>
                     Your message is <audio expr="message"/>
                </prompt>
                <prompt>
                  Do you want to keep it? Press 1 for yes, 2 for no
                </prompt>
                <filled>
                    <if cond="confirm == '1'">
                        <prompt>Goodbye!</prompt>
                        <assign name="voicemail" expr="message"/>
                    <elseif cond="confirm == '2'" />
                        <goto next="#recordMessage"/>
                    <else/>
                    </if>
                   <submit next="http://beta.callfire.com/vxml/servlet/DocumentServer" method="post" namelist="callid telephone formid choice voicemail"/>
                </filled>
        </field>
</form>
</vxml>