CallXML 3.0 Development GuideHome  |  Frameset Home

  Outbound Sample Code  |  TOC  |  Answering Machine Detection  

Token Initiated Calls with CallXML

The ability to create an outbound call by simply clicking a ‘submit’ button on a web form is one of the most useful offerings on the Voxeo network. Token initiated calls follow the same rules as regular <transfer> calls, in that the same conditions must be checked against in regards to call status and errors.

Reminder: Outbound dialing requires the use of outbound dialing priveleges, which must be provisioned by voxeo support. If you have not contacted us to get these permissions, click here to learn how you can get hooked up with this feature.

For further information, token calls are detailed fully in Lesson 9, but for the truly lazy, we reprint the code here:

Start.html


<title>Demonstration Session Trigger Application</title>
<form name="SampleForm"
  action="http://api.voxeo.net/SessionControl/CallXML.start"  method="POST">
  <input type="hidden" name="tokenid" value="sometoken">
  <input type="hidden" name="resulturl" value="http://mywebserver.com/Start.html">

  Phone number to call:<br>
  <input type="text" name="Phone" size="20" maxlength="20" value=""><br><br>
  Enter your text to say here:<br>
  <input type="text" name="TTS" size="100" value=""><br><br>
  <input type="reset" value="Clear">
   
  <input type="submit" name="submit" value="Give me a call!">
</form>


MyTokenApp.asp


<?xml version="1.0" encoding="UTF-8"?> 
<callxml version="3.0">
<%
'------------------------------------------------------------------------
' Need to use ASP to grab the variables from the querystring.
'------------------------------------------------------------------------
Phone  = request.querystring("phone")
Message = request.querystring("TTS")
'----------------------------------------------------------------------------
' Now we will transfer those ASP variables to callxml variables
'----------------------------------------------------------------------------
response.write "<assign var=""Phone""  value=""" & Phone  & """/>"
response.write "<assign var=""Message"" value=""" & Message & """/>"
%>
  <call value="$Phone;" maxtime="30s"/>
  <on event="answer">
    <do label="MessageBlock" repeat="3">
      <say>$Message;</say>
      <wait value="3s"/>
    </do>
  </on>

  <on event="callfailure">
    <log value="Call failed to connect."/>
  </on>
</callxml>





  ANNOTATIONS: EXISTING POSTS
damienmiller
1/4/2007 2:55 PM (EST)
The link to Chapter 9 is broken in the above article.
mikethompson
1/4/2007 4:58 PM (EST)
Hi Damien,

I brought this dead link to the attention of our documentation keepers.  They have notified me the link has been fixed in the latest internal build of the docs.  Once the build goes live, the link will work again.

Best,
Mike Thompson
Voxeo Corporation
jpw
3/16/2008 12:43 AM (EDT)
In this example, how does the execution 'get to' mytokenapp.asp ? And what is the 'resulturl' parameter for?
VoxeoBrian
3/16/2008 9:58 AM (EDT)
Hello JPW,

In the example above, the execution gets passed to mytokenapp.asp, from being the start URL of the application that is associated with the token being launched.

Lets break it down

This simple <form> action here is called to our session initiator at api.voxeo.net

<form name="SampleForm"
  action="http://api.voxeo.net/SessionControl/CallXML.start"  method="POST">

It has input that it sends along, as a hidden type:

<input type="hidden" name="tokenid" value="sometoken">

The value of "sometoken" will be the long UID Token string that you can associate with your applications in the Application Manager.  In this case, the startURL of that application, would be http://mywebserver.com/mytokenapp.asp

In regards to the input above that is mapped to "resultURL", this seems really innocuous to the operation of the application.  Really it just defines the URL of the initial HTML application that will be used for launching the token, again, it is also of a "hidden" type, and not visible on the HTML page.

You can see in our other documentation examples on token initiated calls, it is stricken from the record.


http://docs.voxeo.com/callxml/3.0/t_9cxml30.htm

Let me know if this helps.

Regards,

Brian

login
  Outbound Sample Code  |  TOC  |  Answering Machine Detection  

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