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

Get the empty field with no input event

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

Get the empty field with no input event

Post by soso »

Hi,

I've a field on a form wich accept a key pound to continue the program.

But, I would like to test if the field is empty, but when I enter the '#', I've a noinput event.

I would like to make : if the user press #, then play the x name audio file, and reprompt. If the user press no key, the noinput event is executed.

How tell me do I write this code?

Thanks by advance.

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

IVR code to get the empty field with no input event

Post by support »

Hi,

Here's some IVR code that should help you achieve this. Please note how the IVR <grammar> is implemented and the <if> conditional:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="input">
<grammar type="application/srgs+xml" root="ROOT" mode="dtmf">
  <rule id="ROOT">
    <one-of>
      <item>
        "#"
      </item>
      <item>
        1
      </item>
    </one-of>
  </rule>
</grammar>

<prompt>
Please enter something.
</prompt>

<filled>
<if cond="input=='#'">
<audio src="http://nonexistent.domain.com/nameofyourfile.wav">
  Play audio file.
</audio>
<clear namelist="input"/>
<else/>
<prompt>
  You entered <value expr="input"/>.
</prompt>
</if>
</filled>
</field>
</form>
</vxml>
Hope this helps.

Regards,
Plum Support

Post Reply