Page 1 of 1
debugging vxml & php
Posted: Fri Dec 07, 2007 4:43 pm
by jbrohan
Do any of you experienced people have a trick for tracing a variable between vxml and php. In just php I could put in some echo statements and trace my error. With this voice programming it's not so simple. I have a variable which is the termchar of a recording and I need to use it to update a database. The other variables seem OK, but this one is giving me gyp it's always zero.
IVR example for tracing a variable
Posted: Fri Dec 07, 2007 5:11 pm
by support
Hi,
I'm not sure what you mean by a "trick" for tracing a variable...here's an IVR example that might help you with what you need. Note the use of the
<submit> tag below.
vxmlpart.vxml:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<record name="myrecording" beep="true">
<prompt>
Please record a message after the beep.
</prompt>
<filled>
You just recorded the following message:
<value expr="myrecording"/>
You terminated your recording by pressing <value expr="myrecording$.termchar"/>.
<assign name="termchar" expr="myrecording$.termchar"/>
<submit next="submittest.php" method="post" namelist="termchar"/>
</filled>
</record>
</form>
</vxml>
submittest.php:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
$termchar= $_POST[termchar];
?>
<vxml version="2.0">
<form>
<var name="termchar" expr="'<?php echo($termchar)?>'"/>
<block>
<prompt> Your termination character is <value expr="termchar"/>. </prompt>
</block>
</form>
</vxml>
Hope this helps.
Regards,
Plum Support