| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
|
<send delay> element/attribute pairing.
<html>
<title>Limiting Call Length: token trigger</title>
<!-- note that the CCXML 1.0 platform uses a unique start URL -->
<form name="SampleForm" action="http://api.voxeo.net/SessionControl/CCXML10.start" method="POST">
<input type="hidden" name="tokenid" value="---- YOUR TOKENID HERE ----">
Enter your phone number:<br>
<input type="text" name="phoneNum" size="10" maxlength="10" value=""><br><br>
<br><br>
<input type="reset" value="Clear">
<input type="submit" name="submit" value="Call Rick Astley!">
</form>
</html>
<?PHP
header('Cache-Control: no-cache');
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo "<ccxml version=\"1.0\">";
echo "<var name=\"phoneNum\" expr=\"'tel:+1" . $_REQUEST["phoneNum"] ."'\" />";
?>
<meta name="author" content="Steve Sax"/>
<meta name="copyright" content="2007 Voxeo Corporation"/>
<meta name="maintainer" content="YOUR_EMAIL@HERE.COM"/>
<var name="state0" expr="'init'"/>
<var name="myCallID" expr="''"/>
<var name="myDialog"/>
<eventprocessor statevariable="state0">
<!-- *** CCXML front-end loaded / Making outbound call *** -->
<transition state="init" event="ccxml.loaded">
<log expr="'-- Application Starting --'"/>
<log expr="'-- Making Outbound Call --'"/>
<assign name="state0" expr="'calling'"/>
<createcall dest="phoneNum" timeout="'10s'"/>
</transition>
<!-- *** If outbound call fails *** -->
<transition state="calling" event="connection.failed">
<log expr="'-- Outbound Call Failed / Exiting App --'"/>
<exit/>
</transition>
<!-- *** If outbound call is successful *** -->
<transition state="calling" event="connection.connected">
<log expr="'-- Call Answered --'"/>
<assign name="myCallID" expr="event$.connectionid"/>
<assign name="state0" expr="'call_answered'"/>
<!-- *** Creating "timer-like" effect *** -->
<!-- *** For purposes of illustration, we will set this to 30 seconds *** -->
<send data="'callMaxTimeReached'" target="session.id" delay="'30s'"/>
<!-- *** Starting your actual VXML application *** -->
<dialogstart src="'your_vxml.xml'" dialogid="myDialog"/>
</transition>
<transition state="call_answered" event="dialog.exit">
<log expr="'-- VXML App Complete / Exiting App --'"/>
<exit/>
</transition>
<!-- *** If call time reaches 30 seconds, kill the session *** -->
<transition event="callMaxTimeReached">
<log expr="'-- Max Call Time Reached / Disconnecting Call --'"/>
<assign name="state0" expr="'forced_disconnect'"/>
<disconnect connectionid="myCallID"/>
</transition>
<!-- *** Clean-up when call is disconnected *** -->
<transition event="connection.disconnected">
<log expr="'-- Call Leg: ' + event$.connectionid + 'Has Been Disconnected / Exiting App --'"/>
<exit/>
</transition>
<transition event="error.*">
<log expr="'CRIKEY AN ERROR HAS OCCURED: (' + event$.reason + ')'"/>
<exit/>
</transition>
</eventprocessor>
</ccxml>
<?xml version="1.0" encoding="UTF-8" ?>
<vxml version="2.1">
<form id="Form1">
<field name="dummyField">
<grammar type="text/gsl">[bhfryplmfswr]</grammar>
<prompt bargein="false">
<audio src="give_you_up.wav"/>
<break time="500"/>
<audio src="give_you_up.wav"/>
<break time="500"/>
<audio src="give_you_up.wav"/>
<break time="500"/>
<audio src="give_you_up.wav"/>
<break time="500"/>
</prompt>
<noinput>
<goto next="#Form1"/>
</noinput>
</field>
</form>
</vxml>
| ANNOTATIONS: EXISTING POSTS |
| login |
|