Hi Team,
I’m trying to define a field grammar that allows for entry of values 1-99 or *
I’ve tried two approaches: (1) type=“digits?maxlength=2” and (2) setting a field-level jsgf grammar (with mode=“dtmf”) that looks like this: ( 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | “*” )+
Approach 1 gets me the right value but doesn’t recognize “*” input
Approach 2 only yields the 1st digit of input (e.g. I enter 11 but only receive 1 in the field variable) but allows for the entry of “*”
Your help is very much appreciated.
Thanks...Scott
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
Grammar Question
Re: Grammar Question
Hi Scott,
This is the approach you should be using:
This is the approach you should be using:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<property name="inputmodes" value="dtmf"/>
<form id="form1">
<field name="field1" type="digits?maxlength=2">
<grammar type="application/x-jsgf" mode="dtmf">"*"</grammar>
<prompt>Please enter 1-2 digits or star.</prompt>
<filled>
<prompt bargein="false">
You entered: <value expr="field1"/>
</prompt>
<goto next="#form1"/>
</filled>
</field>
</form>
</vxml>
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
-
- Posts: 20
- Joined: Thu Oct 19, 2017 3:40 pm
Re: Grammar Question
That worked. Thanks for your help!