CCXML 1.0-W3C Development GuideHome  |  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 conference.unjoined event to the CCXML document afterwards.


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


attributes
connectionidData 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.
hintsData 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"; for instance:


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


Note that 'hints.headers' stores what headers to add to the sip request, and that only headers starting with an 'x-' prefix are sent.
reasonData 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
0 posts - click the button below to add a note to this page

login



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