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 to confirm a 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

Problem to confirm a field

Post by soso »

Hi,

I've another problem.

I've a numeric field like:

Code: Select all

<field name="phone">

..

</field>
I want to make the following thing:

If the user wait too much for a long time, I play a message "to coninue, pess #".

I use the code on the maxspeech event like:

Code: Select all

<catch event="maxspeech">
  <assign name="maxspeech" expr="true">
</catch>

<field ...>
<filled>
<if cond="maxspeech==true">

<assign name="phone" expr="undefined" />
<reprompt />

</if>
</filled>
</field>
But the problem, is that when I use the repromp tag, I lost the value on the field.

How do I save the value until the user press #?

Thanks by advance.[/code]

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

IVR code example to confirm a <field>

Post by support »

Hi,

You can use the following IVR code example to help you confirm the IVR tag, <field>:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0"> 
  <form>
  <field name="phone">
    <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>
          <item> "#" </item>
        </one-of>
      </rule> 
    </grammar>
    <prompt>Please enter your phone number followed by the pound sign.</prompt>

  </field>

  <field name="presspound" cond="phone.indexOf('#') == -1">
    <grammar root="ROOT2" type="application/srgs+xml" mode="dtmf">
      <rule id="ROOT2" scope="public">
        <one-of>
          <item> "#" </item>
        </one-of>
      </rule>
    </grammar>
    <prompt>
      Please press pound to continue.
    </prompt>

  </field>

  <block>
    <goto next="nextpage.php"/>
  </block>
  </form>
</vxml>
Hope this IVR example helps.

Regards,
Plum Support
Last edited by support on Wed Feb 24, 2010 12:20 pm, edited 4 times in total.

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

Post by soso »

Hi,

Great ! It's perfect.

Thanks.

Post Reply