CCXML 1.0-Voxeo Development Guide Home  |  Frameset Home

  Intro to CCXML  |  TOC  |  Intro to Event Handling  
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: Hello World

This simple tutorial will step you through the creation and deployment of a "Hello World" application.
When we are done, you will have a basic understanding of creating a CCXML application and have begun the
process of familiarizing yourself with the syntax.

In this tutorial, we will:



Step 1: basic syntax

Like any XML markup, CCXML requires an XML header.  Every XML document you write, including CCXML documents,
will need a header like this:


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


Next, you should add the main <ccxml> element pair. This will contain all other CCXML elements,
essentially defining the start and end of your XML document.


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

</ccxml>



Step 2: assigning a variable

In CCXML, variables have to be defined before they can be used. The name of a variable is always absolute, while its value is, as with most CCXML attributes, a fully qualified ECMAScript expression. Thus even for a simple string, we have to use single quotes to encapsulate it. If we don't, the persnickety interpreter would treat it as a language expression (i.e., as a nonexisting variable) and fail.


<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">
  <var name="MyVariable" expr="'This is a CCXML Variable'"/>
</ccxml>



Step 3: outputting log information

There is no official way within CCXML to send debug information to a logging system, but Voxeo has created a method that unifies your approach, that allows you  to see debug information via the realtime logger.  Like CallXML and VoiceXML, normal output will flow through the logger, which is accessible in your VAM Account (you do have a VAM Account, right?).  But sometimes... only sometimes you want to insert specific debug messages into the logging stream.  Let's try that here, using the variable we just defined:


<?xml version="1.0" encoding="UTF-8"?>
<cxml version="1.0">
  <var name="MyVariable" expr="'This is a CCXML Variable'"/>

  <log expr="'Hello World. I just made a variable: ' + MyVariable"/>
</ccxml>


Notice again that the <log> tag is subject to the same rules regarding ECMAScript expressions as
<var> because of the "expr" attribute.  Don't be scared.


Step 4: don't let the door slam when you <exit>

Here the show is over already. The <exit> tag will terminate the session, resulting in a hangup on
all lines.  This tag is critical that should, if you are a highly skilled, phone-markup coder, be included in every script.  Applications that do not have an <exit> point may never be terminated, resulting in a dead session.  Thick-necked thugs may ring your door-bell to deliver a heavy sack beating should these dead sessions accumulate too often.  Definite "termination behavior" for each CCXML session is always a good idea.  It improves your document and your longevity.


<?xml version="1.0" encoding="UTF-8"?>
<ccxml version="1.0">
  <var name="MyVariable" expr="'This is a CCXML Variable'"/>
  <log expr="'Hello World. I just made a variable: ' + MyVariable"/>
  <exit/>

</ccxml>


Important Note:

This application may sound peculiar when you call it.  Since we have not yet learned how to actually
answer an incoming phone call, you may hear what telco experts refer to as a "fast busy.", or a more ominous "Error 728". Not to worry though, soon we will learn how to answer the phone (then, we will tackle the feat of not getting the phone cord all twisted up). 

Your CCXML hello world application is now done.  You can log  into your Voxeo Account to create a new application, selecting the CCXML platform and getting a new phone number to try it with.


What we covered:

  CCXML source code.


  ANNOTATIONS: EXISTING POSTS
awirtz
11/19/2004 6:06 PM (EST)
On the topic of not twisting your phone cord, the secret is this:
The phone base should be positioned on the same side of your desk as your favored ear.  Answer the phone with the nearest hand, and do not move the receiver to the other hand.  This eliminates the twisting since twisting occurs in the process of switching hands.  So simple, yet so profound. ;)
(If you for some reason are unable to move your phone base to correspond to your favored ear, you can still avoid twisting the cord by either using the ear nearer the phone or by answering and hanging up with the hand further from the phone.)
gogi60839
1/30/2007 5:56 PM (EST)
Or better yet.... how about investing in a wireless reciever. Your voice application will still work over most wireless handsets: I have tested several and I can guarantee it!!
waitbusters
2/15/2007 2:37 AM (EST)
You think that guy is still waiting for a reply two years later? ;-)
awirtz
7/25/2007 3:28 PM (EDT)
Me still waiting for a reply?  Maybe. ;-)

High quality wireless handsets might be okay, but I have had some difficulty with reco over cell phones on occasion.  Then again, my own brain has trouble doing voice reco over GSM sometimes, so go figure. :-P

-Aaron

login

  Intro to CCXML  |  TOC  |  Intro to Event Handling  

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