Page 1 of 1

how do you put a '*' as a valid input for a grammar?

Posted: Tue Jun 06, 2006 4:05 pm
by always24x7
I have a grammar that I would like to use:

<grammar type="application/x-jsgf">1|2|3|9|*|balance|lost|register|repeat|men
u</grammar>

The vxml interpreter barfs on the '*'.

I have tried *, but it did not work either. Is there a way to represent an '*' that will not cause the interpreter to barf?

IVR grammar to fix * error

Posted: Wed Jun 07, 2006 9:10 am
by support
The * in JSGF means "zero or more of the previous token". Because there's no token preceding the star, the JSGF parser throws an IVR error. To tell the JSGF parser to look for the * character you should put it into double quotes. Thus, your IVR <grammar> will look like this instead:

Code: Select all

<grammar type="application/x-jsgf">1|2|3|9|"*"|balance|lost|register|repeat|menu</grammar>