Click to See Complete Forum and Search --> : [vxml]Field Type Question


littleJune
August 25th, 2009, 10:19 PM
I want to receive only * or # as legal input from user

Can I use field elememt like this (change the termchar)

...
<field name="demo" type="boolean?y=#;n=*">
...
...
</field>

vxmlavenger
January 13th, 2010, 01:07 PM
Hmm. I've never seen the boolean type used that way. There may be an platform-specific extension out there somewhere like that, but all I've ever seen is

type="boolean"

I think what you need is to create your own very simple grammar, like in the following form:

<form id="push_something">
<field name="demo">
<grammar type="application/x-jsgf" mode="dtmf"> "#" | "*" </grammar>
<prompt>Please press the pound or star key.</prompt>
</field>
</form>
</vxml>

Instead of using the built-in boolean grammar, that form specifies a simple grammar that only accepts "#" or "*".

If you want to map "#" to "y" and "*" to "n" in the "demo" var, you could extend that grammar in the following way:

<grammar type="application/x-jsgf" mode="dtmf"> "#" {y} | "*" {n} </grammar>

There are some nice, simple examples of JSGF grammars on the docs for the PlumVoice platform:

http://www.plumvoice.com/docs/hosting/

Another common grammar type used in IVR is SRGS+XML. See same docs.

Good luck!