CallXML

www.callxml.org

 

 

Overview

CallXML is an XML based markup language used to describe the user interface of a telephone, voice over IP, or multi-media call application to a CallXML browser.  A CallXML browser can then use that description to control and react to the call itself.  CallXML includes:

·         Media action elements such as <playAudio> and <recordAudio> to describe what to present to the user during a call.

·         Call action elements such as <answer>, <call>, and <hangup> to describe how to control and route the call itself.

·         Logic action elements such as <assign>, <clear>, and <goto> to describe how to modify variables and interact with traditional server-side web logic such as perl, other cgi languages, PHP, or ASP.

·         event elements such as <onTermDigit>, <onHangup> to describe how to react to things the user can do during the call, such as pressing digits or hanging up.

·         block elements which logically group actions & events together, so that one set of event handling elements can be used for several sequential actions.

 

CallXML compared to HTML

HTML is a markup language used to describe the user interface of a web application. The table below compares some elements from HTML to elements in CallXML:

HTML

CallXML

<html> element  begins an HTML document

<callxml> element begins a CallXML document

<table> element groups other visual elements together

<block> element groups other CallXML action and event elements together

<img> element displays a graphic

<playAudio> element plays an audio file

<a href="URL"> element describes where to go when a user clicks on a web link

<onTermDigit> event element describes what to do when a user presses a button on the phone

CallXML compared to VoiceXML

VoiceXML is designed to make it easy for web developers to create voice recognition based interfaces for either telephones or computer-based applications.  As such, VoiceXML is an excellent solution for voice based applications which provide access to web content and information, including:

·         Applications which allow users to retrieve web content via phone (ie: voice portals, web-by-phone, audiotex, etc)

·         Applications which allow users to interact with web based services using spoken commands (ie: stock quotes, sports scores, etc)

CallXML was designed to make it easy for web developers to create applications that can interact with and control any number or type calls, including:

·         Telephone or Voice over IP call applications which can control the initiation and routing of a phone call itself, supporting such features as outbound dialing, conferencing, and multi-call interactions (ie: conference bridges, internet call waiting, follow-me/find-me, etc)

·         Telephone or Voice over IP call applications which can easily interact and respond to touch-tone based entry and selection (ie: voicemail, interactive voice response, etc)

·         Call Applications which include support for additional media, such as faxes and video (ie: unified messaging, video conferencing, etc)

Because of the natural complexity associated with dealing with voice commands, VoiceXML uses a relatively complex form/field/grammar/filled interface model in its design.  

In contrast, CallXML uses a more simplified block / action / event interface model, which can be easier to learn and which allows for visual design tools which directly represent CallXML markup as simple flow-chart like user interfaces. 

CallXML Example

The following CallXML example provides a basic answering machine application. It will play a greeting and then record an audio message. The audio message will be emailed to bob.jones@xyz.com. 

However, if the caller presses the “*” key any time while the greeting is being played or audio is being recorded, the CallXML browser will terminate the play/record and go to a new URL for more instructions.  Alternatively, if the user hangs up during play or record, the CallXML browser will go to a second new URL.

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

<callxml>

                 <block>

                                <answer/>

<playAudio value="http://xyz.com /greeting.wav/" termDigits="*">

<recordAudio value="mailto:abc@xyz.com" maxTime="30s" termDigits="*"/>

<onTermDigit value="*">

<goto value="http://xyz.com/cgi-bin/get_pin_code.pl"/>

</onTermDigit>

<onHangup>

<goto value="http://xyz.com/end_call.xml"/>

</onHangup>

</block>

</callxml>

If you know HTML…

If you know HTML but not XML, you will find that the two are very similar, although XML requires more precision when coding.  Significant differences include:

·         HTML files are often called “pages”, while XML files are normally called “documents”.

·         All XML elements must be closed.  For example, in HTML you often find the paragraph element (<p>) without a closing element.  This is not allowed in XML.  In XML you have to close the element like this:

<p>hi!</p>

More surprising is the fact that empty elements must be closed as well.  So the HTML break tag <br> would have to be closed in XML with the combined open/close element form:

<br />

For compatibility with existing HTML processors, you should always include a space before the closing slash.  When using elements with names that are identical to existing HTML elements, you should avoid using the equivalent form:

<br></br>

since many HTML processors will break when they see this construct.

·         XML is very strict about nested elements.   While HTML will let you get away with a construct like this:

<p>This is <b>bold <i>italic</b></i>.</p>

XML requires all contained elements to be closed before the containing element can be closed.  So this is the legal way to handle the tags in XML:

<p>This is <b>bold <i>italic</i></b>.</p>

Note that HTML officially requires the same thing, but these errors are so common that most HTML processors deliberately ignore them.

 

CallXML Logic Elements

Variable manipulation elements

CallXML browsers include a per “call” or “session” variable space.  The CallXML logic elements are used to assign and clear values in those variables, and to submit those variables as HTTP GET or POST information to traditional web applications created with languages such as CGI, Perl, Java, and .ASP. 

CallXML variables can be referenced within CallXML element attributes by using the $varname; syntax.

<assign var=“ttt”      default: ""
        value=“123”/>      default: ""

Attributes

Attribute

Description

var

Variable name to use when assigning a value

value

Value to put into the variable

Description

Assigns the value specified by the attribute value to the variable specified by the attribute var. As show above, will assign the value "123" to variable named "ttt”.

In addition to variables explicitly assigned by the callxml markup, CallXML browsers may automatically create variables which contain information related to the call / session.

The following is a list of automatically created global variables associated with each session:

Name

Description

session.Digits

The digit buffer

session.CallerID

The callers phone number

session.CalledID

The number that was called to get here

session.EventSenderID

The session ID of the sender of the last external event

session.CallerAccountID

Voxeo ID of the caller (if known)

session.CalledAccountID

Voxeo ID of the called party (if known)

session.ID

Identifier for the current session

Variable names must start with a letter A through Z or a through z and can contain: A through Z, a through z, 0 through 9, and the underscore.  Variable names can be 1-40 characters in length.  Variable names beginning with the characters "session." or "SESSION." in any case combination are reserved for internal system variables and cannot be created or set by the programmer except that the session.Digits buffer can be cleared by the clearDigits element or the clear var="session.Digits" element.  The session.Digits buffer can be set using the <assign var="session.Digits" value="anything"> element.

Possible events

<onError>

Example

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

<!-- read a first and last name to the caller using
text to speech -->

<callxml>

      <block>

            <assign var=”firstname” value=”jonathan”/>

            <assign var=”lastname” value=”smith”/>

      </block>

      <text>

            Thanks for calling, $firstname; $lastname;.

      </text>

</callxml>

 

<clear var=“ttt”/>

Attributes

Attribute

Description

var

Name of the variable to clear.

Description

Clears variable specified by the attribute var.  As show above, will clear a variable named "ttt".  Effectively this works the same as <assign var="ttt" value="" />

Possible events

<onError>

<clearDigits />

Attributes

none

Description

Clears the session.Digits buffer.

The session.Digits buffer contains any touch-tone digits the user may have pressed before a CallXML action is executed.  This element will clear the digit buffer of any queued digits. 

In addition to the clearDigits element and the ability to clear the session.Digits buffer manually, several CallXML elements have a clearDigits attribute that does the same thing in order to reduce the number of elements required for common tasks.  The <clearDigits> element is used by several higher level CallXML™ elements (q.v.). ????Clarify. Is the clearDigits attribute being conflated with the clearDigits element????

Possible events

<onError>

<goto value=“http://w.v.n/next.voxeo#block      Default: ""
      submit=“*|x,y,z”      Default: "*"
      method=“get|post”       Default: "get" />

Attributes

Attribute

Description

value

Either a full URL (http://w.v.n/yo.voxeo) or a local URI pointing to a <block> label in the same CallXML file (e.g., #main_menu).

Supported URL formats include:
    http://     Read data
    ftp://       Read data

submit

List of variables to submit to the called URL/URI can be “all” or “*” for everything, or a comma delimited list of variables to submit (e.g., submit = “Variable1, Variable2, Variable3, Variable5, Variable9”). 

method

Submit method to use:
    "get" for http get
    "post" for http post

Description

This element can either:

·         Leap to another block of CallXML actions in the current file, by specifying value=”#blocklabel”, or

·         Perform an HTTP GET or POST to fetch a new CallXML document, by specifying value=”url”.

When used to fetch a new CallXML document, the submit attribute can be used to pass CallXML browser variables with the HTTP GET or POST operation used to request the new document. 

The method attribute is used to select whether to use HTTP GET or POST when fetching the new document.

Possible events

<onError>

Example

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

<!—assign two vars, then send them to a perl script xyz.com as GET URL variables -- >

<callxml>

      <block>

            <assign var=”firstname” value=”jonathan”/>

            <assign var=”lastname” value=”smith/>

<goto value=”http://xyz.com/cgi-bin/app.pl”

      submit=”firstname, lastname”/>

      </block>

</callxml>

 

A note about session elements


CallXML browsers may support more than one “call” or “session”.  For example, a CallXML browser may be running on a system connected to multiple phone lines, with an ability to support a unique session for each phone line. 

On such CallXML browsers, CallXML code in one session can run new CallXML code in a second session using the <run> element.  This element is useful for applications that may receive a call in one session and then initiate new outbound calls in other sessions – such as a follow-me/find-me application.

On such CallXML browsers, some applications may require the ability to easily send information between sessions that can potentially interrupt the actions of the other session. 

For example, a conferencing application may want to be able to send a message from the session for each person calling into the conference to the session of the person who created the conference, so that “new caller” tone can be played to the conference creator.  As a result, CallXML includes a basic mechanism to send messages from one session to another.

CallXML logic elements related to sessions are found below:

 

<run      value=“http://w.v.n/next.voxeo|#block      Default: ""
      submit=“*|x,y,z”      Default: "*"
      method=“get|post”      Default: "get"
      var=“varForReturnedSessionID      Default: "" />

Attributes

Attribute

Description

value

Either a full URL (http://w.v.n/yo.voxeo) or a local URI pointing to a <block> label in the same voxeo file (e.g., #main_menu).

Supported URL formats
    http://     Read data
    ftp://       Read data

submit

List of variables to submit to the called URI/URI can be “*” for everything or a comma delimited list of variables to submit.

method

Submit method to use:
    "get" for http get
    "post" for http post

var

Variable name in which to store the new session ID/

Description

This element will run/start a new session, and fetches a CallXML document to use for the session from the URL or URI specified by value. 

The submit attribute can be used to pass copies of CallXML browser variables from the parent session with the HTTP GET or POST operation used to fetch the new document. 

The method attribute is used to select whether to use HTTP GET or POST.  Var specifies the name of a variable in the parent session that will receive the unique identifier of the new session.

Possible events

<onError>

Example

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

<!-- run a new session, starting with CallXML code from xyz.com -->

<!-- pass a few copies of a few variables to the code @ xyz.com -->

<callxml>

      <block>

            <assign var=”firstname” value=”jonathan”/>
            <assign var=”lastname” value=”smith”/>

            <assign var=”parentsession” value=”$session.ID;”/>

            <run value=”http://xyz.com/newsess.asp”

                 submit=”fistname, lastname, parentsession”

                 var=”childsessid”/>

            <!-– the session id of the new session is now -->

            <!-– stored in childsessid -->

      </block>

</callxml>

                               

<sendEvent value=“msg_call_answered”      Default: ""
           session=“sss”      Default: "" />

Attributes

 

Attribute

Description

value

String containing the body of the message.

session

ID of the session to which the event will be sent.

Description

<sendEvent> is a tag that allows one session to send a message to another session.

The attribute value is used to specify the text message to send to the other session.

The attribute session is used to specify the unique identifier of the session to send the message to.

 

Possible events

<onExternalEvent>

 

This event allows the session that is the recipient of a <sendEvent> to process the message.  In use, one session could start another and wait for its child process to send it a message of some sort indicating that the child session had completed its task.  For example, this highly simplified interaction could be used as the basis for a follow me/find me application:


Example

Session 1

<block>
<assign
    var="parent"
    value="$session.ID;" />
<run
    value="Session2.xml"
    submit="*" />
<delay>

<onExternalEvent
    value="foo">
<simline
    value="caught a foo external event." />
</onExternalEvent>
</block>


 

Session 2

<block>
<simline
    value="send an event." />
<sendEvent
    value="foo"
    session="$parent;" />
</block>



CallXML Call Action Elements

CallXML call action elements specify actions the CallXML browser can apply to the call associated with the browser session.  These actions include <answer> to answer a new inbound call, <hangup> to hangup or disconnect the call, <call> to initiate a new outbound call, and <conference> to connect or conference the audio from to different calls or sessions together. 

<answer/>

Attributes

None

Description

This element will “answer” or “pick-up” the call.  Any time a new call is received by a CallXML browser, it will use a browser specific mechanism to determine a URL from which to fetch an initial CallXML document to use for that call.  However, the CallXML browser does not “answer” or “pick-up” the call until this element is executed.

Possible events

<onError>

Example

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

<!-– answer the call, then play a greeting -->

<callxml>

      <block>

            <answer/>

            <playAudio value=”greeting.wav” />

      </block>

</callxml>

<hangup/>

Attributes

None

Description

This element instructs the CallXML browser to “hang-up” or disconnect the call associated with the current session. 

Possible events

<onError>

Example

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

<! – answer the call, then play a greeting, then hangup -- >

<callxml>

      <block>

            <answer/>

            <playAudio value=”greeting.wav”/>

            <hangup/>

      </block>

</callxml>

 

 

<call      value=“pstn:18314395130”     Default: ""
      callerID="pstn:1234567890"   Default: "callerID"
      maxTime=“30s”                Default: "30s" />

Attributes

Attribute

Description

value

URL describing the place to initiate a call to

callerID

CallerID to present when placing the call

maxTime

Maximum amount of time to wait for the call to be answered

 

Description

The Call element allows for new outbound calls to be placed to the specified address. 

The address is specified by the attribute value and is in URL format.  Supported formats include PSTN://  to instruct the browser to call a normal telephone number.

The maximum amount of time to wait for the call to be answered can be specified by the attribute maxTime.

Possible Events

<onError>

<onAnswer type=“person|machine|unknown”>

<onCallFailure>

<onMaxTime>

Example

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

<! – place a call, when it’s answered, play a greeting -- >

<callxml>

      <block>

            <call value=”pstn:14075551212”/>

            <onAnswer>

                  <playAudio value=”greeting.wav”/>

            </onAnswer>

      </block>

</callxml>

 

<conference targetSessions=”sessionID1,
                            sessionID2”      Default: ""
            termDigits=”#”      Default: "" />

Attributes

Attribute

Description

targetSessions

One or more unique session identifiers, separated by commas.

termDigits

List of touch-tone digits which can terminate the conference

Description

This element allows multiple lines in separate sessions to be conferenced together so that the parties on each line can talk to each other simultaneously.

The list of sessions to conference together is specified by the attribute targetSessions, and can be one more unique session identifiers separated by commas.

The termDigits can be used to specify touch-tone digits that will terminate the conference.

Possible events

<onError>

Example

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

<!-- conference with another session -->

<!-- assume we previously stored the id of the other session into the variable “otherSess” -->

<!-- then wait until the conf ends or another event occurs -->

<callxml>

      <block>

            <conference targetSessions=”$othersess;”/>

            <delay value=”nolimit”/>

            </block>

      </callxml>

 

<waitForConferenceEnd />

Attributes

None

Description

This element allows a session that is a target of a conference command to suspend all other processing until the conference is terminated by either party.  This element has been deprecated in favor of the more general “wait” element.

Possible events

<onError>

 

<wait value=”10s|nolimit”         Default: “”
       termDigits=”*”/>           Default: “”

Attributes

Attribute

Description

value

Amount of time to wait. 

termDigits

List of touch-tone digits which can terminate the wait action

 

Description

The wait element is used to instruct the CallXML browser to wait for a specified amount of time. 

The time value is specified by the attribute value and can be in seconds (s), minutes (m), or milliseconds (ms); or can be set to “nolimit” to have no limit on the amount of time to wait. 

termDigits specifies a list of digits that can terminate the wait action. 

Possible Events

<onTermDigit>

<onHangup>

<onError>

Example

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

<!-- play an audio file, then wait up to 30 seconds for the user to press a button or hangup -->

<callxml>

      <block>

            <playAudio value=”waitingonyou.wav”/>

            <delay value=”30s”/>

      </block>

</callxml>


CallXML Media Action Elements

 

 

<getDigits var="pager_msg"               default: none
           maxDigits="9"                 default: nolimit
           termDigits="#*"               default: ""
           includeTermDigit="TRUE|FALSE" default: FALSE
           clearDigits="TRUE|FALSE"      default: FALSE
           maxTime="30s"                 default: 30s
           maxSilence="5s"               default: 5s />

Attributes

Attribute

Description

var

Read digits into the variable specified, “pager_msg” in this example.

maxDigits

The maximum number of digits to read, 4 digits in this example.

termDigits

Digits that can terminate or end the entering of digits;  either # or * in this example.  The termDigits value can be any combo of "1234567890*#ABCD@" or "any" or "".  "any" indicates that any digit will terminate the entry.

includeTermDigit

TRUE to include the term digit with the value placed into var, or FALSE to not include it.

clearDigits

Boolean value indicating whether the queued digits buffer should be cleared when this action starts.  TRUE clears the digits buffer.  FALSE leaves the contents of the digit buffer alone.

maxTime

Maximum time period to wait for digits, 30 seconds in this example.  The time units can be specified in ms (milliseconds), s (seconds), or m (minutes).  If no unit specification is present, seconds are presumed.

maxSilence

Maximum time to wait between digits, 5 seconds in this example.  Time units can be in ms (milliseconds), s (seconds), or m (minutes).  If no unit specification is present, seconds are presumed.

 

Description

????Clarify syntax for "no limit"????The getDigits element reads input touch-tone digits from the call and places them into a variable by the var attribute. 

In the example above, the user would have 30 seconds to enter up to 9 digits on her phone, pausing no more than 5 seconds between digits, and ending the digit input with either the # key or * key. 

This element is typically used for such tasks as gathering PIN codes, pager numbers, and anything else that involves multiple digits coming from the user.   <getDigits> requires an associated <onTermDigit> event element .

Possible events

The follow events may occur while this action is running:

 

<onTermDigit>

<onMaxDigits>

<onMaxTime>

<onMaxSilence>

Example

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

<!-- play a file asking a user to enter their 4 digit pin code, then get the pin code and store it in a variable named user_pin .. wait up to 30 seconds for them to enter the pin. -->

<!-- then tell them what pin code they entered using text to speech -->

<callxml>

      <block>

            <playAudio value=”enterpin.wav”/>

            <getDigits var=”user_pin”

                       maxDigits=”4”

                       maxTime=”30s”/>

            <onMaxDigits>

                  <text> you entered $user_pin; </text>

            </onMaxDigits>

      </block>

</callxml>

           

 

<play… />

<playNumber     

                format=“digits|number”                Default: "digits"

                value=“12345”                Default: ""

                termDigits=“*#”                Default: ""

                clearDigits=“TRUE|FALSE”                Default: "FALSE" />

 

<playMoney                format=“us”                Default: "us"

                value=“1.25”                Default: ""

                termDigits=“*#”                Default: ""

                clearDigits=“TRUE|FALSE”                Default: "FALSE" />

 

<playDate                format=“ddmmyyyyhhss”                Default: as shown

                value=“1012990732”                Default: ""

                termDigits=“*#”                Default: ""

                clearDigits=“TRUE|FALSE”                Default: "FALSE" />

 

<playchars  value=“abcdefgh”

  termdigits=“*#”

  cleardigits=“TRUE|FALSE”/>

 

<playtone  value=“2000hz+1000hz"\”

  termdigits=“*#”

  cleardigits=“TRUE|FALSE”/>

 

<playAudio                format=“audio/vox”                Default: "audio/vox"

                value=“http://www.ttt.com/sample.vox”                Default: ""

                termDigits=“*#”                Default: ""

                clearDigits=“TRUE|FALSE”                Default: "FALSE" />

Attributes

Attribute

Description

format

Formatting string to use for the play (not totally defined yet).

value

The value to play (literal, variable, or URL reference).

termDigits

Digits that can terminate the play.

clearDigits

Boolean variable indicating whether the session.Digits buffer should be cleared on entry.  TRUE clears the digits buffer.  FALSE leaves the contents of the digits buffer alone.

Description

<play … > is used to play an a number, date, money value, numeric value, or audio file. 

For <playAudio>, the format attribute refers to the mime-type of the audio file, in case the CallXML browser cannot automatically determine the mime-type.

Possible events

<onError>

Example

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


<!-- ===================== -->

<!-- Here is our main menu script -->

<!-- ===================== -->

 

<callxml>

<block label=“MainMenu”

       repeat=“3”

       clearDigits=“TRUE”/>

 

      <playAudio format= “audio/vox”

            value=“http://www.blahblah.com/mainmenu.vox

            termDigits=“567890*#”

            clearDigits=“TRUE”/>

     

<!-- ============== -->

<!--  Our event handlers -->

<!-- ============== -->

 

      <onTermDigit value= “*#”>

            Do something here.

</onTermDigit>

 

      <onTermDigit value= “567890”>

            Do something different here.

</onTermDigit>

</block>

</callxml>

<recordAudio      format=“audio/vox”               Default:"audio/vox"
      value=“ftp://www.v.n/msg.vox”    Default: ""
      termDigits=“*#”                  Default: ""
      clearDigits=“TRUE|FALSE”         Default: "FALSE"
      maxTime=“30s”                    Default: "30s"
      maxSilence=“5s”                  Default: "5s"
     
beep="TRUE|FALSE"                Default: "TRUE"
           
/>

Attributes

 

Attribute

Description

format

Formatting string to use for the record (mime type).

value

Where to put the audio (variable or URL reference).

termDigits

Digits that can terminate the play.

clearDigits