CallXML 2.0 Development Guide Home  |  Frameset Home

  tutorial Hello World with ASP  |  TOC  |  tutorial Cache Control  
This documentation is for CallXML 2, which has been superceded by CallXML 3. The CallXML 2 language is not being updated any longer. CallXML 3, however, has many new features and is actively being enhanced. If you're writing a new CallXML application, you should use CallXML 3. Click here for the CallXML 3.0 documentation.

Tutorial: Multi-party conferencing in CallXML

This tutorial is based on the things you accomplished in previous tutorials. If you have not yet done those tutorials, you'll need to go through them first.


In this tutorial, we will:

step 1: creating our initial callxml structure

From our previous tutorials, we now recognize the following structure as a normal starting point, with one exception. We are using CallXML version 2.0 for multi-party conferencing.


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

  <block>
  </block>

</callxml>



step 2: preparing to create a new conference

When we create a conference, we will need to give it a name. You may use any name befitting your slick conference, but we recommend "Tyler," "Marla," or even "Robert Paulson." Alternatively, we may want a flexible application supporting numerous concurrent conferences -- to this end, let's leave Tyler and the gang behind and use a strictly numeric name. The <inputdigits> element allows us collect digits and fill in the aptly named variable "conferenceName".


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


  <inputdigits
      label      = "getconid"
      value      = "enterConferenceID.wav"
      var        = "conferenceName"
      maxdigits  = "10"
      termdigits  = "#"
      cleardigits = "false"
      maxtime    = "30s"
      maxsilence  = "5s">

    <ontermdigit value="#"/>
    <onmaxsilence>
      <playaudio value="noInput.wav"/>
      <goto value="#getconid"/>
    </onmaxsilence>
    <onmaxtime/>
    <onmaxdigits/>
  </inputdigits>


  <block>
  </block>

</callxml>


step 3: creating a multi-party conference

Now that we have a conference name, let's do two things:
Playing audio we know how to do by now, no suprises there. To create a multi-party conference, we will use the <createconference> element and supply two attributes, the name to use for this conference and a variable name to store the conference identifier. In CallXML, a conference name is used to uniquely identify a conference -- if you try to create a conference with a name already in use, you will get back the conference identifier for the existing conference. We will use the conference identifier later to join the conference. For this example, we will supply the conference name we collected above. Our code should now look like this:


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

  <inputdigits
      label      = "getconid"
      value      = "enterConferenceID.wav"
      var        = "conferenceName"
      maxdigits  = "10"
      termdigits  = "#"
      cleardigits = "false"
      maxtime    = "30s"
      maxsilence  = "5s">

    <ontermdigit value="#"/>
    <onmaxsilence>
      <playaudio value="noInput.wav"/>
      <goto value="#getconid"/>
    </onmaxsilence>
    <onmaxtime/>
    <onmaxdigits/>
  </inputdigits>


  <playaudio value="joinConference.wav"/>
  <block label="test">
    <createconference name="$conferenceName;" var="conferenceid" />
  </block>

</callxml>


It is worth noting a second time the <createconference> tag will only "create" a new conference if the conference name does not already exist on the server. Even though our application may seem like it is creating a new conference each time, only the first call would do this. This is why every member of Project Mayhem can call our application without creating bunches of unnecessary conferences.



step 4: joining a multi-party conference

Almost done. We just need to join the conference and add some event handling to allow users to rejoin the conference after leaving it. To join a conference, we will use the <joinconference> element and supply two attributes; the conference identifier we obtained when creating the conference, and any termdigits for the conference. Our completed code should look like this:

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

  <inputdigits
      label      = "getconid"
      value      = "enterConferenceID.wav"
      var        = "conferenceName"
      maxdigits  = "10"
      termdigits  = "#"
      cleardigits = "false"
      maxtime    = "30s"
      maxsilence  = "5s">

    <ontermdigit value="#"/>
    <onmaxsilence>
      <playaudio value="noInput.wav"/>
      <goto value="#getconid"/>
    </onmaxsilence>
    <onmaxtime/>
    <onmaxdigits/>
  </inputdigits>


  <playaudio value="joinConference.wav"/>
  <block label="test">
    <createconference name="$conferenceName;" var="conferenceid" />
    <joinconference id="$conferenceid;" termdigits="#"/>
    <ontermdigit>
      <playaudio value="leaveConference.wav" termdigits="123"/>
      <wait value="3000s" termdigits="123"/>
      <ontermdigit value="2">
        <goto value="#test"/>
      </ontermdigit>
      <ontermdigit value="3">
        <goto value="#getconid"/>
      </ontermdigit>
    </ontermdigit>
  </block>

  <onerror>
  <sendemail from="MyApp@here.com"
    to="YourEmail@there.net" type="debug">
    We caught an error in our application.  Details follow...
  </sendemail>
  </onerror>

</callxml>



Your multi-party conferenceing application is now done. You and your friends can now call the number associated with your callxml application, and discuss the finer points of making soap all night long.


Download the code

  CallXML 2.0 source code.

What we covered:



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

login
  tutorial Hello World with ASP  |  TOC  |  tutorial Cache Control  

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