We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How can I perform Post call processing...max count exceeded?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

How can I perform Post call processing...max count exceeded?

Post by jcanter »

I have a question about post call processing. I am writing a voicemail system and I would like to process several things after the call has hungup. After I record the callers information, I have a form to insert the voicemail into the database, I have a form to save the recorded message as a file, I have a form to send a notification to the user about the voicemail and I have a form to log the general call to the IVR. If seems after the caller hangups, the call stops processing at the stage of saving the message to a file. I have tried to force it to continue to process by using a :

Code: Select all

      <catch event="connection.disconnect.hangup">
        <goto next="#InsertMessage"/>
      </catch> 
However, I get a message in the logs about the maxium disconnect count being exceeded. My question is, if I want to continue to process these tags after the call, what would be the proper way to do that. I should note, this functions correctly if I stay on the line until all of the tags have been processed.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR Platform robust enough to handle infinite recursion/loop

Post by support »

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 :P
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
Last edited by support on Thu Feb 25, 2010 5:22 pm, edited 4 times in total.

jcanter
Posts: 47
Joined: Thu Jun 19, 2003 8:54 am

Post by jcanter »

Just so I am clear, each of the 4 forms I told you about call a server side side script already. The first form calls a script that submits the call to the voicemail database, the second form calls a script that saves the recorded message to a file. The thrid form calls a script that sends out a notification to the user and the forth form calls a script that logs the call to a common database. If I read what you are saying, I need to create a script for the plumvp platform to calls that in turns calls these other 4 scripts. Is that correct? I would prefer to keep the 4 scripts seperate so I can keep them more general and not specfic to this one application. I am currently calling all of the scripts in each form with a <subdialog> tag. Is there a way I could call all four scripts from one form? Is it possible to use more than one <subdialog> in one form?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

link onto IVR forum

Post by support »

Yes, that is correct, in that case you would make 4 subdialog calls from the script that handles the disconnect event.

Look in the IVR tag tips forum in the forum thread labeled "subdialog". There is an IVR example that shows how to pass parameters to subdialogs and return values. Although the parameter and data passing is irrelevant to the current topic, it provides a good IVR example for subdialog calling conventions.

You can also access the IVR forum from here:

http://support.plumvoice.com/viewtopic.php?t=77


Plum Support

Post Reply