| Grammar Entry |
Explanation |
choices |
The primary attribute that is used to specify a simple grammar construct in the CallXML markup language. Note that multiple utterance entries in this attribute are comma-delimited. |
[5 DIGITS] |
Developers can specify a static range that defines the string length that is to be collected from the caller via dtmf or via voice: In this case, a digit string length of "5" (i.e., "22334") would be considered a valid grammar match. |
[2-5 DIGITS] |
Developers can specify a wider range in terms of spoken or dtmf digit entry, where the first number defines the minimum length, and the second number defines the max length: In this instance, a caller could enter a string that was at least two digits (i.e., "47"), and as many as five (i.e., "88754") or anything in-between.
Note: You must add <assign var="settings.choices.completetimeout" value="10000ms"/> to set the wait time for variable digits. 10000ms=10s wait |
| Grammar Entry |
Explanation |
choices |
The primary attribute that is used to specify a simple grammar construct in the CallXML markup language. Note that multiple utterance entries in this attribute are comma-delimited. |
(1) |
Any numeric value specified as a value of a "choices" attribute denotes a dtmf grammar entry that corresponds to the number specified. i.e.; in this case, pressing "dtmf-1" on the telephone keypad will result in a valid grammar match, which would result in the dialog variable being populated with a value of "ONE". |
(one, uno) |
Any plain-text value specified within a "choices" attribute denotes a spoken-word grammar entry, but in this case, the dialog variable is not set to the utterance value (see next table row). |
ONE |
Values that precede the utterances specified in the parenthesis in a complex inline "choices" grammar specify the value that the dialog variable will be populated with upon a match: In this instance, the dialog variable will equate to "ONE" on a valid grammar match. |
| Grammar Entry |
Explanation |
<assign> element |
When specifying complex JSGF constructs, it must be defined as a value of a CallXML variable. This variable name is then populated into the "choices" element. |
<![CDATA[ .... ]]> |
Any JSGF grammar content must be enclosed within a CDATA tag to prevent the grammar content from being parsed as XML data: Without a CDATA tag, any grammars defined would cause a failure to parse, and a subsequent fatal application error. |
#JSGF 1.0; |
Header that is used to declare the construct as a JSGF grammar, which is absolutely required when coding complex CallXML grammar structures using JSGF syntax. |
grammar MYRULENAME; |
Specifies the Top-Level-Rulename that is used for JSGF grammar execution. See the JSGF specification for additional details. |
public <MYRULENAME> |
Defines a single sub-rule in the JSGF grammar, which contains the actual utterance entries that can be defined within a grammar. See the JSGF specification for additional details. |
(yes|dtmf-1) |
Specifies the voice utterance ("yes") or the dtmf inpit (dtmf-1) that can be recognized. Note that multiple entries are pipe-delimited (|) |
choices |
The primary attribute that is used to specify a simple grammar construct in the CallXML markup language. In this case, the value of this attribute is that of the previously-defined CallXML variable that the grammar is defined in, and must be preceded by a "jsgf:" declaration. |