CCXML Voxeo 1.0 Development GuideHome  |  Frameset Home

  CCXML Token Applications  |  TOC  |  Multi-Party Conferencing  
This documentation is for CCXML 1.0-Voxeo, which has been superceded by CCXML 1.0-W3C. The CCXML-Voxeo platform is not being updated any longer. The CCXML 1.0-W3C version, however, has many new features and is actively being enhanced. If you're writing a new CCXML application, you should use CCXML 1.0-W3C. Click here for the CCXML 1.0-W3C documentation.

Tutorial: Outbound CCXML Calls with Tokens

This Lesson will show you how to create your first outbound CCXML application using tokens. This lesson also assumes that you have completed the previous tutorials, and is not recommended as a starting point for learning CCXML.

Note: this tutorial requires the enabling of outdial priveleges on the Voxeo network, and the provisioning of a alphanumeric token string to your application. In order to get hooked up with all these neat features, check our Support Guide for all the juicy details.

In this tutorial, we will:


Step 1: creating our initial CCXML structure

From our previous tutorials, we now recognize the following structure as a normal starting point:

<?xml version="1.0" encoding="UTF-8"?>
<!-- NOTE THAT WE *MUST* DECLARE THE xmlns ATTRIBUTE -->
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">
</ccxml>


Step 2: Basic error handing

To start off we are going to add in our good old error handing that we put in all of our documents to deal with catching any unexpected errors, and disconnecting the call should our user hang up.

<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">

  <var name="state0" expr="'init'"/>

  <eventhandler statevariable="state0">

    <transition event="call.CALL_INVALID" name="evt">
      <exit/>
    </transition>

    <transition event="error.*" name="evt">
      <log expr="'an error has occurred (' + evt.error + ')'"/>
      <exit/>
    </transition>

  </eventhandler>   
</ccxml>


Step 3: Finding the initial event

When our CCXML document first gets loaded it tosses a "ccxml.loaded" event. We can catch this to get things started. Note: The ccxml.loaded is a Voxeo extension that we have added that allows you to catch an event to "prime the pump" and get things flowing. Note that the name of this event may change as the W3C reviews the spec and decides what the final name is.


<?xml version="1.0" encoding="UTF-8"?>
<!-- NOTE THAT WE *MUST* DECLARE THE xmlns ATTRIBUTE -->
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">

  <var name="state0" expr="'init'"/>

  <eventhandler statevariable="state0">

    <transition state="'init'" event="ccxml.loaded">

    </transition>

    <transition event="call.CALL_INVALID" name="evt">
      <exit/>
    </transition>

    <transition event="error.*" name="evt">
      <log expr="'an error has occurred (' + evt.error + ')'"/>
      <exit/>
    </transition>

  </eventhandler>   
</ccxml>


Step 4: Hello? Are you there?

Now we add <transition> handlers for the "connection.CONNECTION_CONNECTED" and "connection.CONNECTION_FAILED" events. This will allow us detect that the call has worked or failed. If it has failed, then we go on ahead and exit.

<?xml version="1.0" encoding="UTF-8"?>
<!-- NOTE THAT WE *MUST* DECLARE THE xmlns ATTRIBUTE -->
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">

  <var name="state0" expr="'init'"/>

  <eventhandler statevariable="state0">

    <transition state="'init'" event="ccxml.loaded">
      <assign name="state0" expr="'dialing'"/>           
      <createcall dest="'8315551234'"/>
    </transition>

    <transition state="'dialing'" event="connection.CONNECTION_CONNECTED">
    </transition>

    <transition state="'dialing'" event="connection.CONNECTION_FAILED">
      <log expr="'Failed making outbound call'"/>
      <exit/>
    </transition>


    <transition event="call.CALL_INVALID" name="evt">
      <exit/>
    </transition>

    <transition event="error.*" name="evt">
      <exit/>
    </transition>

  </eventhandler>   
</ccxml>


Step 5: And now we are connected

Next up, run a VoiceXML dialog on the call leg! For this we use our good old <dialogstart> tag that we all know and love. We are also going to add a <transition> for the "dialog.exit" event that we know is coming. You can use any old document for the VoiceXML script. We will let you figure out what you want to use today.


<?xml version="1.0" encoding="UTF-8"?>
<!-- NOTE THAT WE *MUST* DECLARE THE xmlns ATTRIBUTE -->
<ccxml version="1.0" xmlns:voxeo="http://community.voxeo.com/xmlns/ccxml">

  <var name="state0" expr="'init'"/>

  <eventhandler statevariable="state0">

    <transition state="'init'" event="ccxml.loaded">
      <assign name="state0" expr="'dialing'"/>           
      <createcall dest="'8315551234'"/>
    </transition>

    <transition state="'dialing'" event="connection.CONNECTION_CONNECTED">
      <assign name="state0" expr="'connected'"/>           
      <dialogstart src="'hello.vxml'" type="'application/xml+vxml;platform=motorola'" />
    </transition>

    <transition state="'dialing'" event="connection.CONNECTION_FAILED">
      <log expr="'Failed making outbound call'"/>
      <exit/>
    </transition>

    <transition state="'connected'" event="dialog.exit">
      <log expr="'Thats all for now folks.'"/>
      <exit/>
    </transition>

    <transition event="call.CALL_INVALID" name="evt">
              <voxeo:sendemail to="'yourEmail@there.com'"
                        from="'myApp@here.com'"
                        type="'debug'"
                        body=" 'call.CALL_INVALID detected ! ' "/>
      <exit/>
    </transition>

    <transition event="error.*" name="evt">
      <log expr="'an error has occurred (' + evt.error + ')'"/>
              <voxeo:sendemail to="'yourEmail@there.com'"
                        from="'myApp@here.com'"
                        type="'debug'"
                        body=" 'generic error detected ! ' "/>
      <exit/>
    </transition>

  </eventhandler>   
</ccxml>


Step 6: Place that call

All we have to do now is provision a token to your CCXML app and run it. The next step is to send this tokenid to our outbound call servers. You can do this by opening a web browser and entering in:

http://api.voxeo.net/SessionControl/CCXML.start?tokenid=<your token id here>

Thats it! Your phone should be ringing with your newly coded CCXML application! If you need any help in the process feel free to contact Voxeo Support.


  Download the CCXML source code!


What we covered:




  ANNOTATIONS: EXISTING POSTS
voicequilt_prod
8/23/2006 7:08 AM (EDT)
What querystring parameters are passed by your outbound call servers in the request for the application's StartURL?
MattHenry
8/23/2006 11:36 AM (EDT)


Hi there,

Any parameters that you tack on to the initial request will be passed to the application itself. For instance, if your token request looks like this:

http://session.voxeo.net/CCXML.start?tokenid=abc123&var1=foo&var2=bar

..and your start URL looks like this:

http://myserver.com/myApp.php

The the document that will be loaded is:

http://myserver.com/myApp.php?var1=foo&var2=bar

Does this answer your question? If not, just let us know.

~Matt

steve.sax
8/28/2006 2:43 AM (EDT)
Greetings from the Voxeo Support team,

Did you still require assistance with this issue? We are happy to assist you, should you require, but if you feel that no further technical advice is required from us, do let me know, and I will close this ticket out.

Regards,

Steve Sax
steve.sax
9/5/2006 9:26 PM (EDT)

Greetings from the Voxeo Support team,

We hope that you have received a sufficient response to your technical support inquiry. We assume that no further technical assistance is required, and as such, we are closing this ticket thread. If this judgement is in error, we invite you to reopen this ticket, and describe what additional help we can provide.

Cheers,

Steve Sax

badlad
11/29/2006 10:31 AM (EST)
Is there a way I can get the Voxeo session id put on the query string?  I would like to pull it off in our start url just to help with debugging.

Bryan
kallatclient
6/5/2007 12:08 PM (EDT)
Hi,

I plan to use CCXML to develop a web based conferencing application. The idea is the user enters two telephone numbers on a web page and clicks a submit button. Our web application triggers a CCXML token based application which makes two separate calls and joins them together.

My question is, can i interrupt a running CCXML application from an http request? similar to the way we trigger a CCXML app. via http request.

Can i control the execution of a running CCXML conference app. from an http server?

An example scenario is two people are connected through a conference and credit balance of one person run's out. Now the server wishes to disconnect the application. How do i do that?

Please explain.

regards,

Fayyaz Khan Lodhi

login
  CCXML Token Applications  |  TOC  |  Multi-Party Conferencing  

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