| CallXML 3.0 Development Guide | Home | Frameset Home |
|
<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">
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="submitMe" value="Give me a call!">
</form>
action="http://api.voxeo.net/SessionControl/CallXML.start "<input type="hidden" name="tokenid" value= "sometoken"><form> tag that passes three variables ("Phone," "TTS," and "submit"). Any and all such variables are passed into the session initiator script, and then passed from there into the callxml script. Thus, the telephony events are completely transparent from this, the web side.
<?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 *****."/>
<sendemail from="MyApp@here.com"
to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<?php
header('Cache-Control: no-cache');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo "<callxml version=\"3.0\">";
echo "<assign var=\"Phone\" value=\"" . $_REQUEST["Phone"] ."\" />";
echo "<assign var=\"Message\" value=\"'" . $_REQUEST["TTS"] ."'\" />";
?>
<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 *****."/>
<sendemail from="MyApp@here.com"
to="YourEmail@there.net" type="debug">
We caught an error in our application. Details follow...
</sendemail>
</on>
</callxml>
<call> tag. If someone answers the telephone call (<on event="answer"> event is matched), then we simply read the text message entered on the website. That’s all there is to it. You are now empowered to make snazzy buttons and integrate the web and the phone in ways your children will talk about for years...| ANNOTATIONS: EXISTING POSTS |
| login |
|