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

Problem with tutorial chapter 2.2

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
bmceachen
Posts: 7
Joined: Mon Jul 30, 2007 3:43 pm

Problem with tutorial chapter 2.2

Post 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.
-Ben

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

Problem with IVR tutorial chapter 2.2

Post 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
Last edited by support on Wed Feb 24, 2010 5:14 pm, edited 4 times in total.

bmceachen
Posts: 7
Joined: Mon Jul 30, 2007 3:43 pm

Thanks for the tip

Post by bmceachen »

Thanks for the explanation!

-Ben
-Ben

Post Reply