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

Good code gone bad!

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
Rov

Good code gone bad!

Post by Rov »

This code worked yesterday.
Today it generates an error.
What could possibly be wrong with it?
Validation failed: no DTD found !Unescaped '<' not allowed in attributes values in Entity, line: 30

30 <var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />


Pet_ROOT.php

Code: Select all

<?php

$dbhost='dbh';
$dbusername='dbun';
$dbuserpass='dbpwd';
$dbname='dbn';
$dbTable='dbt';

$conn = mysql_connect($dbhost, $dbusername, $dbuserpass) or die('Error connecting to mysql'.mysql_error());
mysql_select_db($dbname);

   $Caller_query="SELECT caller_name FROM dbt WHERE  type='".100."' ";
   $Caller_result=mysql_query($Caller_query)or die(mysql_error());
   $Caller_row=mysql_fetch_array($Caller_result)or die(mysql_error());

   $Owner_query="SELECT owner_name FROM dbt WHERE  type='".100."' ";
   $Owner_result=mysql_query($Owner_query)or die(mysql_error());
   $Owner_row=mysql_fetch_array($Owner_result)or die(mysql_error());

   $Pet_query="SELECT pet_name FROM dbt WHERE  type='".100."' ";
   $Pet_result=mysql_query($Pet_query)or die(mysql_error());
   $Pet_row=mysql_fetch_array($Pet_result)or die(mysql_error());

mysql_close($conn);
?>
<vxml version="2.0">
<form id="SetGlobalVariables">
<block>

<var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />
<assign name="application.CallerName" expr="program_name"/>

<var name="owner_name" expr=" '<? echo ($Owner_row[0]) ?>' " />
<assign name="application.OwnerName" expr="owner_name"/>

<var name="pet_name" expr=" '<? echo ($Pet_row[0]) ?>' " />
<assign name="application.PetName" expr="pet_name"/>

<goto next="Intro.vxml"/>
</block>
</form>
</vxml>

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

IVR problem fixed by adding lines to code

Post by support »

Hi Rov,

Looking through your IVR code, we noticed that you are missing these lines:

Code: Select all

header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
within your php code. You should add these lines in your IVR code to try to debug this IVR error.

Regards,
Plum Support
Last edited by support on Wed Feb 17, 2010 4:01 pm, edited 2 times in total.

Rov

Post by Rov »

Okay, I inserted the lines you suggested.
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
But now I'm getting a different error.
Start tag expected, '<' not found in Entity, line: 26
26 echo("<?xml version=\"1.0\"?>\n");


Did I put your code in the wrong place?

Code: Select all

<?php

$dbhost='dbh';
$dbusername='dbun';
$dbuserpass='dbpwd';
$dbname='dbn';
$dbTable='dbt';

$conn = mysql_connect($dbhost, $dbusername, $dbuserpass) or die('Error connecting to mysql'.mysql_error());
mysql_select_db($dbname);

   $Caller_query="SELECT caller_name FROM dbt WHERE  type='".100."' ";
   $Caller_result=mysql_query($Caller_query)or die(mysql_error());
   $Caller_row=mysql_fetch_array($Caller_result)or die(mysql_error());

   $Owner_query="SELECT owner_name FROM dbt WHERE  type='".100."' ";
   $Owner_result=mysql_query($Owner_query)or die(mysql_error());
   $Owner_row=mysql_fetch_array($Owner_result)or die(mysql_error());

   $Pet_query="SELECT pet_name FROM dbt WHERE  type='".100."' ";
   $Pet_result=mysql_query($Pet_query)or die(mysql_error());
   $Pet_row=mysql_fetch_array($Pet_result)or die(mysql_error());

mysql_close($conn);
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n"); 
?>
<vxml version="2.0">
<form id="SetGlobalVariables">
<block>

<var name="caller_name" expr=" '<? echo ($Caller_row[0]) ?>' " />
<assign name="application.CallerName" expr="program_name"/>

<var name="owner_name" expr=" '<? echo ($Owner_row[0]) ?>' " />
<assign name="application.OwnerName" expr="owner_name"/>

<var name="pet_name" expr=" '<? echo ($Pet_row[0]) ?>' " />
<assign name="application.PetName" expr="pet_name"/>

<goto next="Intro.vxml"/>
</block>
</form>
</vxml>

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

Check call logs to help debug IVR issue

Post by support »

Hi,

Have you tried checking your IVR call logs for the last VXML file? This would you in debugging this IVR issue.

Regards,
Plum Support

Post Reply