VoiceXML variables and ECMAScript variables share the same variable space. In other words, variables declared in a <script> element can be used in VoiceXML, and ECMAScript can use variables declared by a <var> element. There are 3 ways that variables can be declared:
Session variables that are N/A are assigned the ECMAScript undefined key word. If session variables are submitted with an HTTP request, the value (on the right side of the equal sign) will be empty for any variable that is undefined.
The following are the currently or previously standard VoiceXML session variables.
|
Variable
|
Description
|
|
session.connection.local.uri**
|
Represents a URI of a VoiceGenie platform.
|
|
session.connection.remote.uri**
|
Represents a URI of the remote caller device.
|
|
session.connection.aai
|
Application-to-Application (User-to-User) Information. Provides data string passed during connection set-up.
For example, if the current VoiceXML application was called by another application's <transfer> or <call>, with aai or aaiexpr set, then the AAI data string will be available as session.connection.aai in the current application (assuming the network configuration supports the transmission of AAI data).
Generally, not supported with SIP. |
|
session.connection.protocol.name
|
Represents the name of the underlying connection protocol.
|
|
session.connection.protocol.version
|
Represents the version of the connection protocol. Not currently supported.
|
|
session.connection.protocol.<name>
|
When session.connection.protocol.name is available, this variable is a member of the session.connection.protocol object, with the <name> specified by session.connection.protocol.name. For instance, if session.connection.protocol.name is 'h323', there will be a session variable session.connection.protocol.h323, which will be an ECMAScript object, with members and values specific to the H.323 protocol.
|
|
session.connection.redirect
|
This variable is an array representing the connection redirection paths. The first element is the original called number, the last element is the last redirected number. Each element of the array contains a uri, pi (presentation information), si (screening information), and reason property. The reason property can be either "unknown", "user busy", "no reply", "deflection during alerting", "deflection immediate response", "mobile subscriber not reachable".
Supported with ISDN (Dialogic, Brooktrout), SIP, H.323.
|
|
session.connection.originator**
|
Represents the originator device. It is equal to either session.connection.local.uri or session.connection.remote.uri. Note that if the local.uri and/or remote.uri variables have not been enabled, the originator variable (if it has been enabled) will be undefined.
|
Application variables defined in the root document can be referenced by the application leaf documents as application.variable. The application.lastresult$ shadow variable can be modified by a VoiceXML application. When any shadow variable is not set, its value will be ECMAScript undefined.
|
Variable
|
Description
|
|
application.lastresult$
|
This read-only variable holds information about the last recognition to occur within this application. It is an array of elements application.lastresult$[i] for the N-best recognition.
|
|
application.lastresult$[i].confidence
|
The confidence level for this result from 0.0 (minimum confidence) to 1.0 (maximum confidence).
|
|
application.lastresult$[i].utterance
|
The raw string of words that were recognized for this result. fieldname$.utterance, lastresult$.utterance, and lastresult$[0].utterance will all be identical and contain the utterance with the best confidence score. lastresult$[i].utterance, where i>0 and i<maxnbest-1, will each contain the utterance for the ith result.
|
|
application.lastresult$[i].inputmode
|
The mode in which user input was provided: dtmf or voice.
|
|
application.lastresult$[i].interpretation
|
The interpretation of this result (set of slot names and values). Each slot is mapped as a property of the object.
|
|
application.lastresult$.markname
|
(VoiceXML 2.1 feature) The name of the mark last executed by the SSML processor before barge-in occurred or the end of audio playback occurred. If no mark was executed, this variable is undefined. For more details, see <mark>.
|
|
application.lastresult$.marktime
|
(VoiceXML 2.1 feature) The number of milliseconds that elapsed since the last mark was executed by the SSML processor, until barge-in occurred or the end of audio playback occurred. If no mark was executed, this variable is undefined. For more details, see <mark>.
|
|
application.lastresult$.recording
|
(VoiceXML 2.1 feature) This variable stores a reference to the recording, or undefined if no audio is collected (like application.lastresult$.utteranceaudio). This shadow variable is only set if the recordutterance property is set to true.
|
|
application.lastresult$.recordingsize
|
(VoiceXML 2.1 feature) This variable stores the size of the recording in bytes, or undefined if no audio is collected (like application.lastresult$.size). This shadow variable is only set if the recordutterance property is set to true.
|
|
application.lastresult$.recordingduration
|
(VoiceXML 2.1 feature) This variable stores the duration of the recording (in milliseconds), or undefined if no audio is collected (like application.lastresult$.duration). This shadow variable is only set if the recordutterance property is set to true.
|
|
Variable
|
Description
|
|
application.lastresult$.activegrammars[]
|
An array containing all the grammar objects that were active at the time of the recognition. This will contain a valid value whenever voice input is recognized.
|
|
application.lastresult$.audiooffset
|
Offset of audio data on bargein (-1 if audio was played to the end). Undefined if last played prompt was not <audio>.
|
|
application.lastresult$.bargein
|
This is true if bargein occurred, false otherwise.
|
|
application.lastresult$.triggeredgrammar
|
The matched result's grammar object. This will contain a valid value any time voice input is recognized. For now, DTMF input will not result in this variable being set to a meaningful value. Note that this variable will be undefined in the case of a nomatch event or a timeout.
|