VoiceXML session variables are read-only variables that hold information about the platform during an entire user session. At the beginning of a user session, the VoiceXML Interpreter sets and declares the session variables. These variables follow the usual VoiceXML scoping rules and are at the highest tier of the scope chain.
Session variables are referenced in any VoiceXML document during a call session.
<block>
<prompt>
The Caller ID is
<value expr="session.connection.remote.uri"/>
</prompt>
...
</block>
The following table lists the available session variables:
Session Variable |
Description |
session.connection.aai |
Application-to-application information passed during connection setup. For example, this information can be set by the <transfer> element. |
session.connection.initialuri |
URI of the first page of VoiceXML used in the call. |
session.connection.local.uri |
URI that addresses the local VoiceXML Interpreter device. For a SIP inbound call, this is the value of the INVITE To: header. |
session.connection.originator |
Directly references the local or remote URI. For example, the following ECMAScript returns true if the remote party initiated the connection: var caller_initiate = session.connection.originator == |
Name of the connection protocol. This name can also represent the subobject name for protocol-specific information, as in the following example: session.connection.protocol[session.connection. |
|
session.connection.protocol[session. connection.protocol.name].* |
These subobject variables provide protocol specific information. For example, if session.connection.protocol.name is q931, then session.connection.protocol.q931.mode would specify if the connection is in voice or video mode. For more information, see Connection Protocol Subobjects. |
session.connection.protocol.version |
Connection protocol version. |
session.connection.redirect |
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. Valid values for the reason property are:
|
session.connection.remote.uri |
URI that addresses the remote device. For a SIP inbound call, this is the value of the INVITE From: header. For a PSTN inbound call, this is the calling party number, regardless of the Presentation Restricted setting. |
session.connection.protocol.version |
Version of the connection protocol. |
The session.connection.protocol session variable contains subobject variables that provide protocol-specific information. For example, if session.connection.protocol.name is 'q931', then session.connection.protocol.q931.mode indicates whether the connection is in voice or video mode.
The following table describes the connection subobjects available for the SIP protocol when the VoiceXML Interpreter is used with the call server. These subobjects are available within the session.connection.protocol.sip object.
Subobject Name |
Description |
requesturi |
Request-URI from the SIP INVITE. |
requesturi.voicexml |
VoiceXML parameter from the Request-URI. This information is also available through the session.connection.initialuri variable. |
requesturi.aai |
Application-to-application information from the Request-URI. This information is also available through the session.connection.aai variable. |
The following example shows the variables used when a SIP call is in session:
session.connection.protocol.name="sip"
session.connection.protocol.version="2"
session.connection.protocol.sip.requesturi="sip:dialog@mediaserver.example.net;
voicexml=http://vxmlserver.example.net/cgi-bin/script.vxml;aai=information"