CCXML 1.0-W3C Development GuideHome  |  Frameset Home

  Error Event Field Listing  |  TOC  |  D: Dialog Extensions  

Sending Custom Events


We just so happen to have a simple interface that will allow you send custom events into an existing CCXML session.  Just send an HTTP request from your web-server to http://api.voxeo.net/SessionControl/CCXML.send and be sure include the following parameters:


The event will be fired as a '[name you defined]' event.  Simply transition it, and perform any action you would like (within reason, of course).


The GET request:

http://api.voxeo.net/SessionControl/CCXML.send?sessionid=abc123&eventname=MyEvent


The resulting event:

<transition event="MyEvent">
  <log expr="'*** This is my custom CCXML Event! ***'"/>
</transition>


Two methods to "inject" custom events


Sending custom events via web interface

In order to use CCXML.send via a web interface, we'll need to somehow pass the relevant CCXML session ID and event name to your web interface on the internet, so it can make the proper request.  This can be done through the use of HTML and server-side scripting.  The resulting request will look something like this, assuming you are sending the event "MyEvent" to session ID abc123:


http://api.voxeo.net/SessionControl/CCXML.send?sessionid=abc123&eventname=MyEvent


Sending custom events via application code

If you don't want to bother using a web interface to inject your event, there is one other option: hard code it into your application.  You may integrate the CCXML.send request into your code by utilizing the <send> event:


<send name="'http.get'" target="'http://api.voxeo.net/SessionControl/CCXML.send?sessionid=abc123&eventname=MyEvent'"/>



Adding custom querystring parameters

At this point, you might be asking yourself, "Hey mister, what if I want to send more information to my custom event?"  Well, you can also tack on custom parameters to your CCXML.send request, if you wish:


The GET request:

http://api.voxeo.net/SessionControl/CCXML.send?sessionid=abc123&eventname=Clint&eastwood=day


The resulting event:

<transition event="Clint">
  <log expr="'Go ahead, make my: ' + event$.eastwood"/>
</transition>



Limitations?

In this section we'll try to clear up any lingering questions you may have regarding the ccxml.send interface.

Q: Are there any limitations regarding parameters or attributes being sent as part of the HTTP request string?

A: CCXML.send is a GET request, so you are subject to the character limit of a querystring, which is 255 characters.


Q: What if I want to do this on a local installation of Prophecy?

A: All we need to do is change "http://api.voxeo.net/SessionControl/CCXML.send" to "http://127.0.0.1:9999/CCXML.send" and we can then inject custom events into your local prophecy server.  Note that the default port for this is 9999, and not 9990.


Q: I'm using CCXML 1.0 W3C, so do I need to change CCXML.send to CCXML10.send?

A: Nope.  CCXML.send will work for both CCXML Voxeo and CCXML 1.0 W3C.




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

login
  Error Event Field Listing  |  TOC  |  D: Dialog Extensions  

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