CCXML 1.0-W3C Development Guide Home  |  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

dialogid Data 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.
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.
immediate Data 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
puneetb
2/17/2011 5:05 PM (EST)
If I specify immediate="false", when is the dialog terminated if not immediately?

Thanks.
Puneet
voxeoJeffK
2/18/2011 12:36 PM (EST)
Hello Puneet,

A dialogterminate with immediate="false" will cause a connection.disconnect.hangup to be thrown in the VXML dialog. This allows the VXML to perform any cleanup actions should it catch that event. Using immediate-"true" causes the VXML dialog to be terminated without waiting.

Regards,
Jeff Kustermann
Voxeo Support

EDIT:

Upon researching this with our engineers this is not quite correct. immediate="true" only concerns the actions taken at the CCXML context. The VXML session will receive a connection.disconnect.hangup either way. The difference is whether CCXML will wait for any response from the VXML session.

login



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