When you have several tasks that need to be executed after an IVR call completes, the best way to accomplish this is to
<submit> all of this data to a separate server side script to handle the backend stuff via an HTTP POST request.
If a picture is worth 1,000 words, then pseudocode is worth 10,000
Heres the outline of a simplistic vxml page that detects an IVR call hangup and posts data to a server script:
Code: Select all
<?xml version="1.0">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
this is a simple form that doesn't really do anything.
</block>
</form>
</vxml>
<catch event="connection.disconnect">
<script>
<![CDATA[
// Log call
var callEnd = new Date();
var duration = Math.floor((callEnd.getTime() - start_time.getTime())/1000);
var time_stamp = Math.floor(start_time.getTime()/1000);
]]>
</script>
<log>
Call ended at time:<value expr="time_stamp"/>
Call duration (in seconds):<value expr="duration"/>
</log>
<submit
next="logdisconnect.php"
method="post"
namelist="duration time_stamp"/>
</catch>
lastly, here is a simplistic server side script written in php that will read data from the POST variables and do some processing on it:
(logdisconnect.php)
Code: Select all
<?php
// post call processing
$duration = $_POST['duration']; //get the duration of the call (in seconds)
$time_stamp = $_POST['time_stamp']; //get the timestamp of when call ended
//now here you would probably do something more interesting with any other data passed in, like storing it in a database, etc
echo "<?xml version=\"1.0\"?>";
?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form>
<block>
The call was successfully logged
</block>
</form>
</vxml>
There is something very important to note here: the post call processing script MUST return a valid VXML document. Even though you never hear any of the voiceXML in the post call processing script, it must return valid VXML because its being passed to the Plum VXML interpreter. If it throws an exception, this has the potential to start an infinite loop. As an example of how this can occur, consider the following example:
Let's say there is a disconnect handler that does not contain valid vxml.
Here is an example of what might happen:
1.caller disconnects (hangs up the phone)
2.the disconnect handler executes
3.the content of the disconnect handler throws some exception. After the exception executes, the IVR platform throws a disconnect.
The disconnect handler executes again
The process repeats ad infitum..
The Plum Voice Platform is robust enough to handle infinite recursion/looping, so that message you are seeing about the maximum account being exceeded is actually an indication that your VXML script is behaving badly by throwing a disconnect over and over, and when some arbitrary limit set by the IVR platform is exceeded it throws that error message in the IVR logs so that the application developer can fix it.
(I think the limit is set to 1,000 disconnects or some similarly large number)
If you need more clarification let us know.
Happy coding..
Sincerely,
Plum Support