Page 1 of 1

Problem with tutorial chapter 2.2

Posted: Mon Jul 30, 2007 9:23 pm
by bmceachen
I am experiencing a strange result with the tutorial code from the chapter titled, "2.2 Gathering user input using builtin grammars."

My application looks like this:
<?xml version="1.0"?>
<vxml version="2.0">
<form id="support">
<field name="hasid" type="boolean">
<prompt>
If you know your customer identification number,
press 1. Otherwise, press 2.
</prompt>
</field>
<filled>
<if cond="hasid==false">
<goto next="#unknowncustomer"/>
</if>
</filled>
<field name="id" type="digits">
<prompt>
Enter your customer identification number.
</prompt>
<filled>
You entered <value expr="id"/>.
<!-- transfer to premium support -->
</filled>
</field>
</form>

<form id="unknowncustomer">
<block>
Please hold for the next available representative.
<!-- transfer to general support -->
</block>
</form>
</vxml>
The following is a description of the behavior:
C: If you know your customer identification number, press 1. Otherwise, press 2.

H: <presses 2>

C: Enter your customer identification number

H: <presses 123>

C: Please hold for the next available representative.
I would expect pressing '2' to set the variable 'hasid' as 'False'. And I would expect the application to then skip to the form 'unknowncustomer' but instead it is prompting and requiring the input for the variable 'id'.

Can someone see why this is happening?

Thanks much.

Problem with IVR tutorial chapter 2.2

Posted: Tue Jul 31, 2007 9:09 am
by support
Hi,

Thanks for pointing out this IVR error in the IVR tutorial. Since the <filled> block is at the <form> level, all the <field> blocks get executed first due to the Form Interpretation Algorithm. To fix this you would type this in to your IVR code:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">

<form id="support">
     <field name="hasid" type="boolean">
          <prompt>
               If you know your customer identification number,
               press 1. Otherwise, press 2.
          </prompt>
          <filled>
               <if cond="hasid==false">
                    <goto next="#unknowncustomer"/>
               </if>
          </filled>
     </field>

     <field name="id" type="digits">
          <prompt>
               Enter your customer identification number.
          </prompt>
          <filled>
               You entered <value expr="id"/>.
               <!-- transfer to premium support -->
          </filled>
     </field>
</form>

<form id="unknowncustomer">
<block>
Please hold for the next available representative.
<!-- transfer to general support -->
</block>
</form>
</vxml>
By putting the <filled> block within the first field, that <filled> block would then be executed properly since it is at the <field> level and not the <form> level. Once again, thanks for pointing out this IVR error to us.

Regards,
Plum Support

Thanks for the tip

Posted: Tue Jul 31, 2007 9:35 am
by bmceachen
Thanks for the explanation!

-Ben