Page 1 of 1

Problem accessing voice message.

Posted: Sun Feb 25, 2007 12:46 pm
by scs2
I am recording a message in my vice application



<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">

<property name="universals" value="all" />

<var name="cSmsg"/>
.........
...........
<record name="recmsg" beep="true" maxtime="60s"
finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">

.....................
...................
<assign name="cSmsg" expr="recmsg"/>
<prompt>
<voice gender="female">
Here's what you recorded
</voice >
</prompt>

<audio expr="cSmsg"/>

<prompt>

.........
........


<submit next="http://www.webapplications.biz/recmsg.php" enctype="multipart/form-data" method="post" namelist="cSmsg" />

</vxml>

and then sending it to recmsg.php,

recmsg.php
---------------
<vxml version="2.1">
<form id="Test">
<block>
<prompt>
<voice gender="female">
<?php
if (IsSet($_POST['cSmsg'])) {
$cSmsg = $_POST['cSmsg'];
}else{
?>
Sorry! Message not received.
<break />
<?php
}
?>

Received message <?php echo $cSmsg; ?>
<break />
<break />
</voice>
</prompt>
</block>
</form>

which plays it back.

I can hear it when in my application but when it is received on the server it is blank. Why?
Any help is greatly appriciated


AQK

IVR developers recommend site for proper file uploading

Posted: Mon Feb 26, 2007 4:57 pm
by support
Hi,

It looks like you're not handling your file upload properly. The handling can be PHP-version-dependent, so IVR developers recommend looking here for more info: handling file uploads in PHP

Regards,
Plum Support

Posted: Tue Mar 13, 2007 8:57 am
by scs2
Hi,

Thanks a lot for your help.

I have changed my code to:

$cSmsg = $_FILES['cSmsg'][tmp_name];

if (is_uploaded_file($cSmsg))

{
echo "Trying to save your message in a wave file.";

copy($cSmsg, "/home/......./voice/msgs/voicemsg.wav");
echo "Your message is saved in voicemsg.wav file.";
}
else
{
echo "Sorry! Your message could not be saved.";
}

and it is working fine now.

Thanks once again for your help.

AQK