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

Checking if URI is alive before <subdialog>

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
Polad
Posts: 21
Joined: Wed Dec 15, 2010 3:50 am

Checking if URI is alive before <subdialog>

Post by Polad »

Dear support team,
I need your advice. I implemented dynamic IVR in VXML. At first page it checks the mobile number status using <subdialog> element. It called URI and regarding to return value redirect customers to appropriate flows. Today we faced issue with URI which based on another server. The server was restarted, so during several minutes customer cannot enter IVR. So now I need to assign property which will be checking if URI assigned in <subdialog> is alive first. If the URI unreachable then I need redirect customers to another flow or .vxml. Could you please help me with this?

Thanks beforehand.

Please find my code below:

<?xml version="1.0" ?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml" xml:lang="en-US" >

<var name="V_MSISDN" expr="session.telephone.ani"/>

<filled>
<goto next="#sub"/>
</filled>

<form id="sub">
<subdialog name ="sub" src="http://192.168.215.1:8082/ws.aspx?P_LOG ... =GET_GROUP" namelist="V_MSISDN">

<filled>
<if cond="sub.ret == 0">

<goto next="start.vxml"/>

<elseif cond="sub.ret == 1" />

<goto next="start.vxml"/>


<elseif cond="sub.ret == 2" />

<goto next="start.vxml"/>


<elseif cond="sub.ret == 66" />

<prompt>
<audio src = "black.wav"/>

</prompt>
<exit/>

</if>
</filled>
</subdialog>
</form>
</vxml>

I need to check this URI first: http://192.168.215.1:8082/ws.aspx?P_LOG ... =GET_GROUP

Thank you.

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

Re: Checking if URI is alive before <subdialog>

Post by support »

Hi Polad,

Thanks for your question.

To redirect your callers to another script if your URI is unreachable, you can set up a catch handler within your script to catch "error.badfetch" events and redirect the caller to another script.

The following example demonstrates how you can do this:

subdialogtest.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.1">
<form id="intro">

<subdialog name="blah" src="subdialogdoesnotexist.php"/>

<block>
  Hello <value expr="blah.stuff"/>.
</block>

<catch event="error.badfetch">
  <goto next="nextscript.php"/>
</catch>

</form>
</vxml>
nextscript.php:

Code: Select all

<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.1">
<form id="techdifficulties">

<block>
  We are currently experiencing technical difficulties. Please try your call again later.
</block>

</form>
</vxml>
From this example, since the subdialog source does not exist, the IVR system throws an error.badfetch event. The catch handler catches this event and then performs a <goto> to go "nextscript.php". Then, in "nextscript.php", the message, "We are currently experiencing technical difficulties. Please try your call again later.", is played.

Hope this helps.

Regards,
Plum Support

Polad
Posts: 21
Joined: Wed Dec 15, 2010 3:50 am

Re: Checking if URI is alive before <subdialog>

Post by Polad »

Dear support team,

Thank you very much. I implement catch handler. It works properly. Thanks again for your wonderful support.

Post Reply