CCXML 1.0-W3C Development GuideHome  |  Frameset Home


<dialogterminate>  element

When any VXML dialog has completed, best practices dictate that it should be 'torn down', (or, more properly, 'destroyed'). This is accomplished by using the <dialogterminate> element. When this tag is encountered and executed, a 'dialog.exit' event is returned to the CCXML layer of the application.

Note that if a dialogterminate request cannot be executed if the launched dialog is not yet in a ready state to receive it and act upon it. If this happens, a 'error.dialog.wrongstate' event will be thrown.

Also be aware that when the CCXML application does a <dialogterminate>, the VXML dialog can return data to the CCXML application using the VoiceXML <exit namelist> element, (inherantly throwing a 'dialog.exit event').



usage
<dialogterminate dialogid="(ECMAScript Expression)" hints="(ECMAScript Expression)" immediate="(true|false)">


attributes
dialogidData Type: (ECMAScript Expression)Default: none - attribute is required
The dialogid attribute specifies a character string identifying the dialog. This dialogid will have been generated by <dialogstart> and stored in the ECMAScript variable identified by the "dialogid" attribute.
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.
immediateData Type: (true|false)Default: False
Set to "true" or "false" to specify if the dialog is immediately terminated.



parents
none


children
none


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

<meta name="author" content="Jeff Menkel"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>

<var name="state0" expr="'init'"/>
<var name="myVar" expr="'foo'"/>
<var name="holdMusicDlg" expr="''"/>

  <eventprocessor statevariable="state0">
    <transition state="init" event="connection.alerting">
      <accept/>
    </transition>

    <transition state="init" event="connection.connected">
      <dialogstart type="'application/voicexml+xml'" src="'HoldMusic.vxml'" dialogid="holdMusicDlg"/>     
      <send name="'stopHoldMusic'" target="session.id" delay="'10s'"/>
    </transition> 
 
    <transition state="init" event="stopHoldMusic">
      <dialogterminate dialogid="holdMusicDlg"/>
    </transition>

    <transition event="dialog.exit">
      <log expr="'*** Dialog terminated! ***'"/>
      <exit/>
    </transition>

    <transition event="connection.disconnected">
      <log expr="' *** Disconnection detected! ***'"/>
      <exit/>
    </transition>

    <transition event="error.*">
      <log expr="'*** Doh!  We got an error: [' + event$.reason + '] ***'"/>
      <exit/>
    </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