Page 1 of 1

monitoring for system downtime

Posted: Fri Oct 01, 2010 11:29 am
by haroldva
Hi, im pretty new to voice xml so please bear with me. What im trying to accomplish is to make a monitoring program to call certain number with voice xml/scratchpad attached to it. Currently we have two scratchpads that were used by our production servers. Now, we don't know if our production server is down or not.

Base on this thread: http://support.plumvoice.com/viewtopic.php?f=2&t=1563
It suggest to use something like this:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
  <form>
    <block>
   <goto next="http://url-to-your-application" />
    </block>
  </form>
  <catch event="error">
      This is a custom error message.
  </catch>
</vxml>
Now my questions are:
1)

Code: Select all

<goto next="http://url-to-your-application" />

1.1) in this code how can i call the existing voice xml or scratchpad that already has assigned phone number? (fyi: used by production server)
1.2) where should i place the code above if ever i will implement it?
2) inside catch block
2.1) can i do this:

Code: Select all

<goto next="http://site.com/alert.jsp"/>
after the custom error message?
* Note: alert.jsp will send an email to support department that the system i s down.

Hope to hear from you.

Thanks,
Harold

Re: monitoring for system downtime

Posted: Fri Oct 01, 2010 3:21 pm
by support
Hi Harold,

About 1.1, you should set up your phone number to point to the scratchpad and have your scratchpad point to your VoiceXML application using the <goto>.

About 2.1, you are allowed to do a <goto> within your <catch> block to go to your jsp page. Just keep in mind that the page must return valid VoiceXML.

Regards,
Plum Support

Re: monitoring for system downtime

Posted: Wed Oct 06, 2010 7:59 am
by haroldva
Hi, thanks for your reply. I have a follow question, i have this in my scratchpad:

Code: Select all

<form>
    <block>
      <goto next="#welcome" />
    </block>
  </form>
  <catch event="error">      
      <assign name="source" expr="ivr" />
      <submit namelist="source" next="http://site.com/servlet/ServletManager?action=SendAlertEmail" />
      <exit />
  </catch>
The problem here, it seems like the url was not executed. Am i missing something?

Re: monitoring for system downtime

Posted: Wed Oct 06, 2010 10:42 am
by support
Hi,

The reason why the catch tag never executed the URL was because the application would never throw an error. Using a <goto next="#another_form"/> will never throw an error unless "another_form" did not exist. The reason why the original example worked is because you're going to a script located elsewhere, ie. your production server.

Code: Select all

<goto next="http://www.example.com/test_script.php"/>
If test_script.php does not exist or example.com were down, the IVR would receive an error.badfetch. We could then catch that error and act accordingly. However, if your email script exists on the same production server as the IVR application, you would be unable to submit your information to that server. If that's the case, you may want to transfer the caller to another number.

Code: Select all

<form>
  <block>
    <goto next="http://www.example.com/test_script.php"/>
  </block>
</form>
<catch event="error">
<!-- goto form that transfers user to customer support -->
  <goto next="#transfer"/>
</catch>
You would want this code to be in a scratchpad, however, it is not possible to reference a scratchpad from within another scratchpad. To set this up you would want to create this scratchpad and attach it to a number. You would then either goto or submit to a script located on your production server.

Hope this helps.

Regards,
Plum Support

Re: monitoring for system downtime

Posted: Wed Oct 06, 2010 1:42 pm
by haroldva
Hi, Thanks again for the reply. My email script is in different web application on the same server. I was able to execute my jsp page however i got an error message that says:

A serious error of type error.semantic has occurred. Exiting.


scenario:
My jsp will process the request and send email (works fine). It will then forward the request to another jsp which has a vxml content. After this i heard the plum voice error.

In php how do you return an xml after the http get/post?

Thanks,
Harold

Re: monitoring for system downtime

Posted: Wed Oct 06, 2010 1:54 pm
by haroldva
By the way, here's the content of my jsp:

Code: Select all

<?xml version="1.0"?>

<vxml version="2.0">
  <form>
    <block>
      <return />
    </block>
  </form>
</vxml>
Hope to hear from you!

Thanks,
Harold

Re: monitoring for system downtime

Posted: Wed Oct 06, 2010 3:48 pm
by support
Hi,

If your email script is on the same server as your IVR application, if we're unable to reach your application because the server is down, we woudn't be able to reach your email script as well. You may want to consider having the IVR script live in a different location than your email script.

The error.semantic was caused because the email script needs to return vxml content. Forwarding onto another jsp which has vxml code within it will not work.

To return the vxml after using http get/post within php would be like this:

Code: Select all

<?php
echo "<?xml version=\"1.0\"?>";

$post_date = $_POST['date'];
$get_time = $_GET['time'];

//Do anything that needs to be done within the php tags here:
?>

<vxml version="2.0">
  <form>
    <block>
      <return/>
    </block>
  </form>
</vxml>
Hope this helps.

Regards,
Plum Support