Page 1 of 1

Get the empty field with no input event

Posted: Thu Feb 19, 2009 5:28 am
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.

IVR code to get the empty field with no input event

Posted: Thu Feb 19, 2009 10:42 am
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