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

Trouble Duplicating IVR handling of "*"

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
labbruzzesi
Posts: 7
Joined: Fri Feb 18, 2005 8:09 am
Contact:

Trouble Duplicating IVR handling of "*"

Post by labbruzzesi »

Hello Plum Team.

My team has been trying to duplicate functionality in an existing IVR system. Everything is going pretty well, but there is on particularly complex dialog that is seemingly impossible to duplicate on the Plum Platform (and possibly VXML in general). The following describes that dialog:

Entering runners For Wagers
Selecting runners for a wager is the most complex dialog in the system. The following things are true about the way runners are entered.

1 The dialog allows the entry of multiple runners and multiple legs per race.
2 When multiple runners are entered, they are separated by the star key.
3 To select the next leg, users enter ‘**’ and continue to enter runners for that leg.
· User entry is complete when the user has entered the ‘#’ key.

So the following entries are possibly valid, depending on the race that was chosen:
3# Wager on runner 3.
3*5*1# Wager on runners 3,5,1 first or only leg
3*5*2**4*1*8# Wager on runners 3,5,2 in the first leg and 4,1,8 in the second leg

The current system does runner validation on the previous entry every time the user presses the ‘*’ or ‘#’ key. If a runner entered is invalid, or has already been entered, the user is told immediately after entry of the terminating ‘*’ or ‘#’.

So validation is done where the dashes occur in the following entry string:
3*--5*--11#--

To provide all of the functionality in this dialog using the PLUM platform, we need to be able to have '*' and '#' terminate user input simultaneously, which does not seem possible.

Any ideas on how to approach this problem?


Thank you

Lou Abbruzzesi

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

have IVR sys perform validation after user presses #

Post by support »

Hello,

First off, you are correct, the Plum IVR system can not allow for both * and # termination. However, given your problem, it does seem as though there may be another solution. The most obvious (and easiest) solution I see is to have the IVR system perform validation only after the user presses the # key. This would force you to write either a client side script that validates against possible entries using ECMAScript, or a server side script the does the validation via a submit to another page. However, it would remove the confirmation after each entry.

However, if it is a requirement that you support the previous behavior, we can work some VoiceXML magic to get the job done. Below is an example which does collection in a similar manner to what you are describing. It relies on the Plum IVR Platform's speed and may not work with all VoiceXML vendors. Here I am decreasing the interdigittimeout to 0s, this basically means that as soon as a digit is collected the form item completes and can be evaluated. The speed of the plum IVR platform guarantees that we will be looking for our next digit by the time the user presses the next digit. I have commented out the submits and goto's which would perform the actuall validation to make the example self-contained.

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf"/>

<form id="intro">
  <block>
    <prompt bargein="false">
      To pick a runner, enter its number using your keypad followed by the * key.
      After each entry you will hear a quick confirmation of that runner.
      To continue to the next race press * *.
    </prompt>
    <goto next="#runnerform"/>
  </block>
</form>

<form id="runnerform">
  <property name="interdigittimeout" value="0s"/>
  <var name="runner" expr="''"/>
  <var name="lastd" expr="''"/>
    
  <field name="d" type="digits">
    <grammar>"*"</grammar>
    <filled>
      <if cond="d == '*'">
        <if cond="lastd == ''">
          goto next race.
          <goto next="#runnerform"/>
          <!-- <goto next="nextrace.php"/> -->
        <else/>
          runner is <value expr="runner"/>. 
          <goto next="#runnerform"/>
          <!-- <submit next="checkrunner.php" namelist="runner"/> -->
        </if>
      <else/>
        <assign name="runner" expr="runner + d"/>
        <assign name="lastd" expr="d"/>
        <clear namelist="d"/>
      </if>
    </filled>
  </field>
</form>

</vxml>
The above IVR code is fairly advanced VoiceXML, if you have any questions about the purpose of certain segments feel free to post questions in response. A few things of note, the script assumes that each <goto> , or <submit> will eventually come back to this same dialog in order to replicate the behavior you are describing. Also, there is currently the (likely incorrect) behavior that if the user starts by pressing a single * key they will be pushed to the next race. Finally, there are no considerations made to detect the # key, this should be a fairly trivial change to the above script.

Hope This Helps!

Plum Support

Post Reply