20.6 APPLICATION VARIABLES

The type of an application variable is determined by the common VoiceXML variable types and can also be given specific “grammars”, which allow VOICE to accept a wide range of specialized input. These variables can be either state-specific (those that are not retained and passed through the different VOICE modules) or global (every module and state in the system has access to their values). In our Restaurant Search Guide example, the “previouscalls” and “zipcode” variables are global variables, while the “option” variable is state-specific. Once a type is set for a given variable, the VOICE system automatically ensures that each user input matches the type of the given application variable or will prompt the user to enter information that correctly fills the application variable in question. Lines 26–30 in Figure 20.4 outline the “option” variable used in the example given above; “option” uses a grammar that defines precise words that can fill this variable (“zip-code”, “type”, “cuisine”, etc.). When John has heard the first prompt from the system and has decided what information to input into the system, only one of these words will be accepted by VOICE; in our example, this variable determines the next prompt that John will hear, as well as which variables will be filled out.

images

Figure 20.5 Typical user session states used by the Restaurant Search Guide. ...

Get Mobile Intelligence now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.