CCXML 1.0-W3C Development GuideHome  |  Frameset Home

  Passing Variables to VXML  |  TOC  |  J: Session and Application Variables  

CCXML 1.0 Objects

One of the new inclusions to the CCXML 1.0 specification is the exposing of the various Objects during application execution, which can contain information that is very useful to the developer. Each instance is identified in a unique manner by it's connection identifier.

Note that not all properties will show up at any given time, depending on the context of the application that is being executed at the time: By contrast, the properties listed below that indicate 'required' are guaranteed to show up within any given event where the Object is active.


CCXML 1.0 Connection Object

Whenever a connection is created, 9either by an indial call, or by an outbound call being generated), an instance of the Connection Object is created within the CCXML 1.0 interpreter. Within the appropriate <transition>, the developer may then access the follwing properties of the Connection Object.

connection propertyrequired?summary
connectionidtrueContains an ECMAScript string that evaluates to a Connection Identifier value, which in turn identifies each instance of the Connection object.
statetrueContains the current state of the Connection instance, (connection.*)
substatefalseContains a protocol-dependent property that allows further refinement of the state of a Connection.
dialogidfalseContains the identifier of any dialogs that are active in the current session.
localfalseContains a URI value that addresses the interpreter platform: For an inbound call, this is the called URI. For a redirected inbound call, this is also the most recent redirection, and any prior values will be contained in the "redirect" property. For an outbound call, this is the calling URI.
remotefalseContains a URI value that addresses the interpreter platform: For an inbound call, this is the called URI. For a redirected inbound call, this is also the most recent redirection, and any prior values will be contained in the "redirect" property. For an outbound call, this is the calling URI.
protocolfalseContains a reference to the Object that defines the protocol used on the active connection. The Object defines data that is applicable to all connections that use the protocol, which contains the following properties:
  • name: the name of the connection protocol
  • version: the version of the connection protocol
redirectfalseThis property is an array representing the connection redirection paths, where applicable, ie: connection.redirect[*]. The last element in the array contains the most recent redirect value, whereas the first array contains the original number.

Each element also defines the following properties:
  • connection[connid].redirect[0].uri: The element's path. This is the "original request", where as connection[connid].local is the final destination
  • connection[connid].redirect[0].reason: This is not fully implemented, and will always evaulate to 'unknown'.
  • connection[connid].redirect[0].pi: This is not fully implemented, and will always evaulate to ''
  • connection[connid].redirect[0].si: This is not fully implemented, and will always evaulate to ''
originatorfalse The value of this method indicates the originator of the connection: For inbound calls, the value is set to "remote", and for an outbound call, this is set to "local".
input (not currently supported)trueContains the identifier, (connectiondid/conferenceid/dialogid) of the single media endpoint (connection, dialog or conference) providing the input stream, if any. If there is no input stream, then the value will be set to "undefined". This property MUST be updated each time a  media operation changes the media source to an endpoint, (such as a <join>, or <unjoin> operation).
outputs (not currently supported)trueAn array containing the identifiers of all media endpoints to which the output stream of a media endpoint is sent. If the media endpoint does not have any media destinations the length of the array will be set to "0".



Connection Object Example


<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0"  xmlns="http://www.w3.org/2002/09/ccxml">
  <var name="currentstate" expr="'init'"/>
  <eventprocessor statevariable="currentstate">
  <transition event="connection.alerting">
      <accept/>
  </transition>      <transition event="connection.connected">
                  <foreach object="event$.connection">
    <log expr="'connection.'+index$+' = '+item$"/>
        <!--
        This will create a log output similar to this:
                  log: connection.aai =
                  log: connection.connectionid = 2829883233140d8b113bc4704373f190
                  log: connection.dialogid =
                  log: connection.input =
                  log: connection.local = 1234567890
                  log: connection.originator = remote
                  log: connection.outputs =
                  log: connection.protocol = [object Object]
                  log: connection.redirect =
                  log: connection.remote = 1234567891
                  log: connection.state = 2
              -->

      </foreach>
      <exit/>
  </transition>
  </eventprocessor>
</ccxml>


  Download the Connection Object sample code!


CCXML 1.0 Conference Object

The Conference Object is brought into being upon any programmatic creation of a CCXML conference, (ie, by invoking the <createconference> element successfully). Note that Voxeo's implementation of the Conference Object is not fully compliant to the w3c specification, (yet!), so these properties are not accessible at this time.

conference propertyrequired?summary
conferenceidtrueContains a unique ECMAScript string value of the Conferenec Identifier, which identifies each active instance of ther Conference Class.
bridgestrueContains an ECMAScript associative array which holds identifier values of all dialogs and connections that are bridged into the current session.
conferencenametrueContains an ECMAScript string value that denotes the value defined in the 'name' attribute of the <createconference> element, (if any has been defined).



CCXML 1.0 Dialog Object

The Dialog Object will be created upon the loading of any dialog, or dialog extension. The properties contained therein may not all be active at any given time, (for instance, if there is no conference connected to the dialog, then we can't expect the 'conferenceid' property to evaluate to anything other than "undefined". The listing below detailsd all of the properties of the Dialog Object that are available to the developer on the Prophecy CCXML 1.0 platform:

dialog propertyrequired?summary
dialogidtrueContains the identifier of any dialogs that are active in the current session.
connectionidfalseContains the identifier of the connection that is driving a media stram to the dialog, (if any are active).
conferenceidfalseContains the identifier of the conference that is driving a media stram to the dialog, (if any are active).
typetrueContains an ECMAScript string value that defines the MIME type of the document that loaded the dialog.
srctrueContains an ECMAScript string that denotes the inittial URL of the dialog.
inputtrueContains the identifier, (connectiondid/conferenceid/dialogid) of the single media endpoint (connection, dialog or conference) providing the input stream, if any. If there is no input stream, then the value will be set to "undefined". This property MUST be updated each time a  media operation changes the media source to an endpoint, (such as a <join>, or <unjoin> operation).
outputstrueAn array containing the identifiers of all media endpoints to which the output stream of a media endpoint is sent. If the media endpoint does not have any media destinations the length of the array will be set to "0".



Dialog Object Example


<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0" xmlns="http://www.w3.org/2002/09/ccxml">

<var name="currentstate" expr="'init'"/>

  <eventprocessor statevariable="currentstate">

    <transition event="connection.alerting">
      <accept/>
    </transition>   
    <transition event="connection.connected">
      <dialogstart src="'myDialog.xml'" type="'application/voicexml+xml'"/>
    </transition>
    <transition event="dialog.started">

    <foreach object="event$.dialog">
      <log expr="'*** DIALOG OBJECT  ' + index$  + ' PROPERTY VALUE = ' + item$"/>

<!-- LOG OUTPUT -->
<!--
      log: *** DIALOG OBJECT conferenceid PROPERTY VALUE = undefined
      log: *** DIALOG OBJECT connectionid PROPERTY VALUE = 4845ef53af6c98d0ed7336ee13730443
      log: *** DIALOG OBJECT dialogid PROPERTY VALUE = c9c119460df53f3dce6e671676d3e85f
      log: *** DIALOG OBJECT duplex PROPERTY VALUE = full
      log: *** DIALOG OBJECT input PROPERTY VALUE = 
      log: *** DIALOG OBJECT outputs PROPERTY VALUE = 
      log: *** DIALOG OBJECT src PROPERTY VALUE = http://yourServer.com/CCXML_apps/myDialog.xml
      log: *** DIALOG OBJECT type PROPERTY VALUE = application/voicexml+xml
-->

    </foreach>

      </transition>
      <transition event="dialog.exit">
        <exit/>
      </transition>
     

    <transition event="connection.disconnected">
    <exit/>
    </transition>
  </eventprocessor>
</ccxml>


  Download the Dialog Object sample code!






  ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page

login
  Passing Variables to VXML  |  TOC  |  J: Session and Application Variables  

© 2008 Voxeo Corporation  |  Voxeo IVR  |  VoiceXML & CCXML IVR Developer Site