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

Use * key to go back option.

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
abhay
Posts: 24
Joined: Tue Jul 15, 2008 1:51 am

Use * key to go back option.

Post by abhay »

Hello,

I want to use * key to go back to previous step in my application. I tried to use it, but when user press * call gets disconnected. Can anyone help me regarding how I can use * key?

Thanks
Abhay

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

Re: Use * key to go back option.

Post by support »

Hi abhay,

The following IVR code example demonstrates how you can use the * key on your phone keypad to go to a previous <form> within your application:

stargoback.php

Code: Select all

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

<form id="past">
<block>
<prompt>
This is a past prompt.
</prompt>
<goto next="#present"/>
</block>
</form>


<form id="present">
<field name="myfield">
<grammar root="ROOT" type="application/srgs+xml" mode="dtmf">
  <rule id="ROOT" scope="public">
    <one-of>
      <item repeat="0-255">
	<ruleref uri="#digit"/>
      </item>
      <item> "*" </item>
    </one-of>
  </rule>

  <rule id="digit" scope="public">
    <one-of>
      <item> 0 </item>
      <item> 1 </item>
      <item> 2 </item>
      <item> 3 </item>
      <item> 4 </item>
      <item> 5 </item>
      <item> 6 </item>
      <item> 7 </item>
      <item> 8 </item>
      <item> 9 </item>
    </one-of>
  </rule>
</grammar>
  <prompt>
    Enter some digits.
  </prompt>
  <filled>
    <if cond="myfield.indexOf('*') != -1">
      <goto next="#past"/>
    <else/>
      <prompt>
	You entered <value expr="myfield"/>.
      </prompt>
    </if>
  </filled>
  <nomatch>
    You did not enter a correct input.
    <reprompt/>
  </nomatch>
  <noinput>
    You did not enter anything.
    <reprompt/>
  </noinput>
</field>
</form>
</vxml>
From this example, if the user enters * when they are prompted to enter digits, they will be directed back to the "past" <form> and hear the message, "This is a past prompt." again.

Please let us know if you need any further clarification on this.

Regards,
Plum Support

Post Reply