We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

Problems IVR skipping to next form in the middle of current

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sheadley
Posts: 2
Joined: Wed Aug 11, 2004 9:48 am

Problems IVR skipping to next form in the middle of current

Post by sheadley »

I am having a problem with this vxml application. The application start out ok by asking for the Height information, but after it asks for the day information it skips to asking for Diastolic information. I have looked at the code and it seems to be with spec, maybe I am missing something.


Any help would be appreciated,


TIA


Steven H.

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml"
      doctype-system="http://vxml.plumgroup.com/vxml-221.dtd"
      doctype-public="-//The Plum Group//Voice Markup Language 2.0//EN" />

  <xsl:template match="/">
    <xsl:apply-templates select="user"/>
  </xsl:template>

  <xsl:template match="user">
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <var name="firstname" expr="'{first-name}'"/>
      <var name="Height" expr="-1"/>
      <var name="Diastolic" expr="-1"/>
      <var name="Systolic" expr="-1"/>
      <var name="Weight" expr="-1"/>
      <var name="Month" expr="-1"/>
      <var name="Day" expr="-1"/>
      <var name="Hour" expr="-1"/>
      <var name="Minutes" expr="-1"/>      
      <var name="aMonth"/>
      <var name="aDay"/>
      <var name="aHour"/>
      <var name="aMinutes"/>
      <var name="aHeight"/>
      <var name="aDiastolic"/>
      <var name="aSystolic"/>
      <var name="aWeight"/>

      <menu id="select" scope="document">
        <prompt>
          <voice gender="female">
             Welcome <value expr="firstname" /> to EYE Life-Style R X System Online.
             You have reached a voice interactive system For Health Monitoring.
             Here you will have a chance to interactively save your health information for your doctors review.
          <break size="medium" />
          To add your Height reading say or press 1.
          <break size="medium" />
          To add your Blood pressure reading say or press 2.
          <break size="medium" />
	  To add you A one C  reading say or press 3.
          <break size="medium" />
          To exit the system say exit or press 4.
          </voice>
        </prompt>
        <choice dtmf="1" next="#addHeight"> add Height</choice>
        <choice dtmf="2" next="#addBP"> add Blood Pressure</choice>
        <choice dtmf="3" next="#addWeight"> add Weight </choice>
	<choice dtmf="4" next="#exit"> exit </choice>
      </menu>

      <form id="exit">
        <var name="status" expr="'done'"/>
        <block>
          <if cond="status == 'done'">
            we are finishing and will now exit.
            <exit/>
          </if>
        </block>
      </form>

      <form id ="addHeight">
        <field name="Height" type="digits">
          <prompt>
            <voice gender="female">
              Please Enter your Height Measurement.
            </voice>
          </prompt>
	  <filled>
            <if cond="Height.length > 3">
              <prompt> Sorry, you entered more than 3 digits. </prompt>
              <assign name="aHeight" expr="undefined"/>
            <else/>
              <assign name="aHeight" expr="Height"/>
            </if>
          </filled>
        </field>
        <field name="Month" type="digits">
          <prompt>
            <voice gender="female">
              Please select the Month by entering the month, one thru twelve 
              using your touch tone phone.
            </voice>
          </prompt>
          <filled>
            <if cond="Month.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
              <assign name="aMonth" expr="undefined"/>
            <else/>
              <assign name="aMonth" expr="Month"/>
            </if>
          </filled>
        </field>
        <field name="Day" type="digits">
          <prompt>
            <voice gender="female">
              Please select the day by entering day, one for Sunday thru seven for Saturday using your touch tone phone.
            </voice>
          </prompt>
          <filled>
            <if cond="Day.length > 2">
              <prompt> Sorry, you entered more than 1 digits. </prompt>
              <assign name="aDay" expr="undefined"/>
            <else/>
              <assign name="aDay" expr="Day"/>
            </if>
          </filled>
        </field>
        <field name="Hour" type="digits">
          <prompt>
            <voice gender="female">
              Please select the numeric hour one thru twenty four by
               entering hour one thru twenty four using your touch tone phone.
            </voice>
          </prompt>
          <filled>
            <if cond="Hour.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
              <assign name="aHour" expr="undefined"/>
            <else/>
              <assign name="aHour" expr="Hour"/>
            </if>
          </filled>
        </field>
        <field name="Minutes" type="digits">
          <prompt>
            <voice gender="female">
              Please select the numeric minutes one thru fifty nine by entering minutes one thru fifty nine 
              using your touch tone phone.
            </voice>
          </prompt>
          <filled>
            <if cond="aMinutes.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
              <assign name="aMinutes" expr="undefined"/>
            <else/>
              <assign name="aMinutes" expr="Minutes"/>
            </if>
          </filled>
        </field>
        <field name="save_to_log" type="digits">
          <prompt>
            <voice gender="female">
              The following entry will be submitted to your Height log
              <break size="medium" />
              Height: <value expr="aHeight" />
              <break size="medium" />
              Taken during Month: <value expr="aMonth" />
              <break size="medium" />
              Taken on Day: <value expr="aDay" />
              <break size="medium" />
              Taken during Hour: <value expr="aHour" /> 
              <break size="medium" />
              Taken during Minutes: <value expr="aMinutes" />
              <break size="medium" />
              Save this information to your Health log? - 
              Select one for yes, two for no?       
            </voice>
          </prompt>
          <filled>
            <if cond="save_to_log==1" >
              <goto next="#HeightUpdate"/>
            <else/>
              <goto next="#select"/>
            </if>
          </filled>
        </field>          
      </form>

      <form id="addBP">
	<field name="Diastolic" type="digits">
	  <prompt>
            Please Enter your diastolic Blood Pressure Measurement.
          </prompt>
	  <filled>
	    <if cond="Diastolic.length > 3">
              <prompt> Sorry, you entered more than 3 digits. </prompt>
              <assign name="aDiastolic" expr="undefined"/>
            <else/>
              <assign name="aDiastolic" expr="Diastolic"/>
            </if>
          </filled>
        </field>
        <field name="Systolic" type="digits">
          <prompt>
            Please Enter your systolic Blood Pressure Measurement.
          </prompt>
          <filled>
            <if cond="Systolic.length > 3">
              <prompt> Sorry, you entered more than 3 digits. </prompt>
              <assign name="aSystolic" expr="undefined"/>
            <else/>
              <assign name="aSystolic" expr="Systolic"/>
            </if>
          </filled>
        </field>
	<field name="Month" type="digits">
	  <prompt>
	    <voice gender="female">
              Please select the Month by entering the month, one thru twelve 
              using your touch tone phone.
            </voice>
          </prompt>
	  <filled>
	    <if cond="Month.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
              <assign name="aMonth" expr="undefined"/>
            <else/>
              <assign name="aMonth" expr="Month"/>
            </if>
          </filled>
        </field>
	<field name="Day" type="digits">
	  <prompt>
	    <voice gender="female">
              Please select the day by entering day, one for Sunday thru seven for Saturday using your touch tone phone.
            </voice>
          </prompt>
	  <filled>
	    <if cond="Day.length > 2">
              <prompt> Sorry, you entered more than 1 digits. </prompt>
              <assign name="aDay" expr="undefined"/>
            <else/>
              <assign name="aDay" expr="Day"/>
            </if>
          </filled>
        </field>
	<field name="Hour" type="digits">
	  <prompt>
	    <voice gender="female">
              Please select the numeric hour one thru twenty four by
               entering hour one thru twenty four using your touch tone phone.
            </voice>
          </prompt>
	  <filled>
	    <if cond="Hour.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
                <assign name="aHour" expr="undefined"/>
            <else/>
              <assign name="aHour" expr="Hour"/>
            </if>
          </filled>
        </field>
	<field name="Minutes" type="digits">
	  <prompt>
	    <voice gender="female">
              Please select the numeric minutes one thru fifty nine by entering minutes one thru fifty nine using your touch tone phone.
            </voice>
          </prompt>
	  <filled>
	    <if cond="Minutes.length > 2">
              <prompt> Sorry, you entered more than 2 digits. </prompt>
              <assign name="aMinutes" expr="undefined"/>
            <else/>
              <assign name="aMinutes" expr="Minutes"/>
            </if>
          </filled>
        </field>
	<field name="save_to_log" type="digits">
	  <prompt>
	    <voice gender="female">
              The following entry will be submitted to your Blood Pressure log
              <break size="medium"/>
              Diastolic: <value expr="aDiastolic"/>
              <break size="medium"/>
              Systolic: <value expr="aSystolic"/>
              <break size="medium"/>
              Taken during Month: <value expr="aMonth"/>
              <break size="medium"/>
              Taken on Day: <value expr="aDay"/>
              <break size="medium"/>
              Taken during Hour: <value expr="aHour"/>
              <break size="medium"/>
              Taken during Minutes: <value expr="aMinutes"/>
              <break size="medium"/>
              Save this information to your Health log? - 
              Select one for yes, two for no?       
            </voice>
          </prompt>
	<filled>
	  <if cond="save_to_log==1">
             <goto next="#BPUpdate"/>
          <else/>
             <goto next="#select"/>
          </if>
        </filled>
      </field>
    </form>

    <form id="addWeight">
      <field name="Weight" type="number">
	<prompt>
            Please Enter your Aye one See in Percentage.
        </prompt>
	<filled>
	  <if cond="Weight.length > 3">
            <prompt> Sorry, you entered more than 3 digits. </prompt>
            <assign name="aWeight" expr="undefined"/>
          <else/>
            <assign name="aWeight" expr="Weight"/>
          </if>
        </filled>
      </field>
      <field name="Month" type="digits">
	<prompt>
	  <voice gender="female">
              Please select the Month by entering the month, one thru twelve 
              using your touch tone phone.
          </voice>
        </prompt>
	<filled>
	  <if cond="Month.length > 2">
            <prompt> Sorry, you entered more than 2 digits. </prompt>
            <assign name="aMonth" expr="undefined"/>
          <else/>
            <assign name="aMonth" expr="Month"/>
          </if>
        </filled>
      </field>
      <field name="Day" type="digits">
	<prompt>
	  <voice gender="female">
              Please select the day by entering day, one for Sunday thru seven for Saturday using your touch tone phone.
          </voice>
        </prompt>
	<filled>
	  <if cond="Day.length > 2">
            <prompt> Sorry, you entered more than 1 digits. </prompt>
            <assign name="aDay" expr="undefined"/>
          <else/>
            <assign name="aDay" expr="Day"/>
          </if>
        </filled>
      </field>
      <field name="Hour" type="digits">
	<prompt>
	  <voice gender="female">
              Please select the numeric hour one thru twenty four by
               entering hour one thru twenty four using your touch tone phone.
          </voice>
        </prompt>
	<filled>
          <assign name="aHour" expr="Hour"/>
	  <if cond="Hour.length > 2">
            <prompt> Sorry, you entered more than 2 digits. </prompt>
            <assign name="aHour" expr="undefined"/>
          <else/>
            <assign name="aHour" expr="Hour"/>
          </if>
        </filled>
      </field>
      <field name="Minutes" type="digits">
	<prompt>
	  <voice gender="female">
              Please select the numeric minutes one thru fifty nine by entering minutes one thru fifty nine using your touch tone phone.
          </voice>
        </prompt>
	<filled>
	  <if cond="aMinutes.length > 2">
            <prompt> Sorry, you entered more than 2 digits. </prompt>
            <assign name="aMinutes" expr="undefined"/>
          <else/>
            <assign name="aMinutes" expr="Minutes"/>
          </if>
        </filled>
      </field>
      <field name="save_to_log" type="digits">
	<prompt>
	  <voice gender="female">
              The following entry will be submitted to your Height log
              <break size="medium"/>
              Aye one see: <value expr="aWeight"/>
              <break size="medium"/>
              Taken during Month: <value expr="aMonth"/>
              <break size="medium"/>
              Taken on Day: <value expr="aDay"/>
              <break size="medium"/>
              Taken during Hour: <value expr="aHour"/>
              <break size="medium"/>
              Taken during Minutes: <value expr="aMinutes"/>
              <break size="medium"/>
              Save this information to your Health log? - 
              Select one for yes, two for no?       
            </voice>
          </prompt>
	<filled>
	  <if cond="save_to_log==1">
            <goto next="#WeightUpdate"/>
          <else/>
            <goto next="#select"/>
          </if>
        </filled>
      </field>
    </form>
     
      <form id="HeightUpdate">
          <block>
	    <submit next="http://webfeo.com/voiceHeight.do"
              method="post" namelist="aHeight aMonth aDay aHour aMinutes"/>
          </block>
      </form>      

      <form id ="BPUpdate">
         <block>
          <submit next="http://webfeo.com/voiceBP.do"
              method="post" namelist="aDiastolic aSystolic aMonth aDay aHour aMinutes"/>
         </block>
      </form>
      
      <form id ="WeightUpdate">
         <block>
          <submit next="http://webfeo.com/voiceWeight.do"
              method="post" namelist="aWeight aMonth aDay aHour aMinutes"/>
         </block>
      </form>
    </vxml>
  </xsl:template>
</xsl:stylesheet>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

global link grammar like "*" in IVR app to redirec

Post by support »

Steven,

The problem you are experiencing is related to the fact that you have the menu scope="document" this enforces the automatic grammar created by the menu to be active for all fields. The problem is that it is providing an exact match to your DTMF intputs and so pressing 2 for the day (for example) will jump to the addBP form. Your best bet is to to set the scope="dialog" (or not at all as it is the default) and if it is still necessary to allow your customers to jump back to the menu use a global link grammar like "*" in your IVR application to redirect them to the menu. Hope this helps!

Regards,
Plum Support

Post Reply