CCXML 1.0 Development Guide Home  |  Frameset Home


<send>  element

The <send> element allows a developer to direct user-defined events to the CCXML document. Note that all user-defined events must be prefixed by 'user.', for instance:

  <send name="'MyName'" event="user.MyEvent" target=" 'SomePage.xml' "/>



Also note that Voxeo has added to this the ability to perform HTTP requests with this tag, as well. See 'AppendixG' for more details.


usage
<send data="(ECMAScript Expression)" delay="(ECMAScript Expression)" hints="(ECMAScript Expression)" namelist="STRING" sendid="(ECMAScript Expression)" target="(ECMAScript Expression)" targettype="(ccxml/dialog/basichttp)">


attributes
data Data Type: (ECMAScript Expression) Default: Optional
The data attribute is used to specify and ECMAScript string expression evaluating to the event type to be thrown. Event names are case insensitive, and may be alphanumeric in format, but the first character event name cannot be a period ".". If data is left unspecified, and no inline content is denoted, then an error.fetch event will be thrown. Additionally, it is a requirement to use data or inline content exclusively, i.e., if boh are specified, then an error.fetch will be thrown.
delay Data Type: (ECMAScript Expression) Default: none - attribute is optional
The delayattribute is used to specify a length of time that the <send> action should be delayed. Control is immediately returned to the application, but the event indicated in the <send> tag itself will be delayed, hence, there is no noticable application delay as this processes. Also be aware that the strict time formatting in the Voxeo mimplementation allows only milliseconds to be specified, (example: '1000ms'). Be aware that the queue for sending events must be maintained locally and any events waiting to be sent must be purged when the session that issued this request terminates.

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"; 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.
namelist Data Type: STRING Default: none - attribute is optional
The namelist attribute denotes the space-separated list of variable names to be <sent>. The variables will then be available as a variable/value pair in the resultant URI querystring that is sent to the server.
sendid Data Type: (ECMAScript Expression) Default: Optional
The sendid attribute specifies an ECMAScript expression evaluating to a previously defined variable. The value of the attribute must receive an internally generated unique string identifier to be associated with the event being sent. If this attribute is not specified, the event identifier must be dropped.
target Data Type: (ECMAScript Expression) Default: none - attribute is required
The target attribute denotes the user-defined identifier for the target CCXML document. Do note that it is totally legal for a CCXML program to send an event to itself!

targettype Data Type: (ccxml/dialog/basichttp) Default: Optional (ccxml)
The targettype attribute specifies and ECMAScript string expression that evaluates to the type of Event I/O Processor that the event is to be sent to. Allowable values are:
  • ccxml: This specifies that the event must be dispatched to the CCXML Session Event Processor.

  • dialog: This specifies that the event must be dispatched to the Dialog Event Processor.
  • basichttp: This specifies that the event must be dispatched to the Basic HTTP Event Processor.



parents
none


children
none


code samples
<sample Return>
(Assuming that our 'AnyCoolPage.php' was to write our <sent> values to a text file, this is what we would see)

myEvent
myReturnVar=foo
myReturnVar2=foo2
myReturnVar3=foo3

<1.0 send -data-target-delay-targettype> sample
<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">

  <eventprocessor>

    <transition event="connection.alerting" name="evt">
    <accept/>
    </transition>

    <transition event="connection.connected">
      <log expr="'***** CALL WAS ANSWERED *****'"/>
      <dialogstart src="'sendDialog.vxml'" type="'application/voicexml+xml'" dialogid="myDialogID"/>
      <send data="'timeout'" target="myDialogID" delay="'10s'" targettype="'dialog'" />
    </transition>
   
    <transition event="error.dialog.notstarted'" name="evt">
        <log expr="'****** ERROR.DIALOGNOTSTARTED.NAME = ' + evt.name"/>
    </transition>

    <transition event="send.successful">
    <dialogterminate dialogid="myDialogID"/>
    </transition>

    <transition event="dialog.exit">
      <log expr="'***** CALL EXITING *****'"/>
      <exit/>
    </transition>

  </eventprocessor>
</ccxml>

<SendDialog.vxml>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >

  <form>
    <block>
    <prompt>
      The wheels on the bus go round and round.
      Round and round.
      Round and round.
      The wheels on the bus go round and round.
      All through the town.
    </prompt>
    <goto next="SendDialog.vxml"/>
    </block>
  </form>
</vxml>



additional links
W3C Specification


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

login



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