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

Cancel the user when it press many times the validate field

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
soso
Posts: 62
Joined: Tue Apr 22, 2008 8:11 am

Cancel the user when it press many times the validate field

Post by soso »

Hi,

I've a problem to create a form.

I've a form with two fields: message, and validate.

When the user press #, on the first form, I call another voicexml page.

On this page, the user can press "*" to return previous page, but it makes in most 3 times, after a disconnect is executed.

Can you help me?

I try to make this code:

Code: Select all


<form id="message">

  <field name="msg">

  </field>

  <field name="validate">

    <filled>
       <if cond="validate=='#'">
          <goto next="#send" />
       </if>
   </filled>
  </field>

</form>

<form id="send">
  <field name="getid">

    <filled>
      <if cond="getid=='*'">
        <goto next="#message" />
     </if>

    </filled>

  </field>

</form>
But the problem is that the user can enter many "*".

I would like to cancel the user if it press most 3 "*".

Thanks by advance.

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

IVR code for max diconnect reached

Post by support »

Hi,

Here is some sample IVR code that will allow you to achieve this effect Please note the <if> conditionals in the <filled> block below.

starcountdisconnect.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<var name="starcount" expr="0"/>

<form id="message">
  <field name="validate">
  <grammar type="application/x-jsgf" mode="dtmf">
    "#"
  </grammar> 
  
  <prompt>
    Please press the pound key to go to the next form.
  </prompt>

    <filled>
       <if cond="validate=='#'">
          <goto next="#send" />
       </if>
   </filled>
  </field>
</form>

<form id="send">
  <field name="getid">
  <grammar type="application/x-jsgf" mode="dtmf">
    "*"
  </grammar>

  <prompt>
    Please press the star key to go to the previous form.
  </prompt> 

    <filled>
      <if cond="getid=='*' && starcount++ < 2">
        <goto next="#message"/>
      </if>
        <goto next="#canceluser"/>
    </filled>
  </field>
</form>

<form id="canceluser">
<block>
<prompt>
The user has been cancelled.
</prompt>
<disconnect/>
</block>
</form> 

</vxml>
Hope this helps.

Regards,
Plum Support

Post Reply