CCXML 1.0-W3C Development Guide Home  |  Frameset Home


<disconnect>  element


The <disconnect> element is used to instruct the platform to disconnect a Connection.  A <disconnect> may also be used to abandon an outbound connection using <createcall> which has not yet entered the "connected" state.  If this occurs, it results in the generation of a "connection.failed" event.  If the connection was bridged when the <disconnect> request was sent, the platform must tear down all bridges to the connection, and send a dialog.disconnect event to the CCXML document afterwards.


usage

<disconnect connectionid="(ECMAScript Expression)" hints="(ECMAScript Expression)" reason="(ECMAScript Expression)">


attributes

connectionid Data Type: (ECMAScript Expression) Default: Optional
The connectionid attribute defines an ECMAScript expression which returns a string that is the id of a call leg that must be disconnected. If the connectionid attribute is left unspecified, then the CCXML interpreter will use the id value of the current event being processed. If the attribute value is invalid or there is no valid default value, an error.semantic event will be thrown.
hints Data Type: (ECMAScript Expression) Default: Optional
The hints attribute can be used to specify information used by the platform to configure the event processor. The value of this attribute should equate to an object that contains an array property of "headers" as shown in the following example:

<script>
  var Hints = new Object();
  Hints.headers = new Object();
  Hints.headers['x-mySipHeader'] = 'hello world';
</script>

Note: The hints.headers stores what headers to add to the sip request, and that only headers starting with an 'x-' prefix are sent.
reason Data Type: (ECMAScript Expression) Default: none - attribute is optional
Not Enabled
The reason attribute returns a user-defined ECMAScript string indicating the reason for the call being redirected. The value returned will be a standard HTTP status code, (i.e., "500" etc).



parents

none


children

none


code samples

<1.0 disconnect-connectionid> sample
<ccxml version="1.0">

  <var name="initState" expr="'state_1'"/>
  <var name="MyCallID"/>

  <eventprocessor statevariable="initState">

    <transition event="connection.alerting" state="state_1">
      <assign name="MyCallID" expr="event$.connectionid"/>
        <log expr="'***** MYCALLID =' + MyCallID + '****' "/>
      <send name="'MyEvent'" target="session.id"/> 
    </transition>


    <transition event="MyEvent">
        <accept connectionid="MyCallID"/>     
    </transition>

    <transition event="connection.connected">
      <log expr="'***** CALL WAS ANSWERED *****'"/>
      <dialogstart src="'null://?text=Congratulations, your call was answered. Now we are going to disconnect you.'" type="'application/x-texttospeech'"/>
    </transition>

    <transition event="dialog.exit">
      <log expr="'***** CALL DISCONNECTING *****'"/>
      <disconnect connectionid="MyCallID"/>
    </transition>

  </eventprocessor>
</ccxml>



additional links

W3C Specification


  ANNOTATIONS: EXISTING POSTS
mtatum111
2/12/2009 5:21 PM (EST)
Shouldn't it be
<assign name="MyCallID" expr="event$.connection.connectionid"/>


instead of

<assign name="MyCallID" expr="event$.connectionid"/>
voxeoJeffK
2/12/2009 5:44 PM (EST)
Hello Melissa,

Within a connection object "event$.connectionid" is valid syntax per the W3C spec. You may be thinking of the array session.connection[xxx].connectionid.

regards,
Jeff Kustermann
Voxeo Support

login



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