Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

Vxml , using using post to save the audio file to server using php

hi
  I am working on cisco  voice gateway and all i need to is post an audio file which I save on the local RAM at the gateway to my server (IIS 5.0)

the code for submit is
<submit next="http://IPaddrXXX:portXXX/xml/loadsound.php" namelist ="myrec" method="post" enctype="multipart/form-data"/>
the audio file is being saved as myrec.

My loadsound.php goes as follows:-
<?php
 
 $msg = "";
$code = 1;
/*
$tmpFile=$HTTP_POST_FILES['myrec']['tmp_name'];
if (is_uploaded_file($tmpFile))
{
  $wavfile="wav/".date("YmdHis").".wav";
  copy($tmpFile, sprintf("%s",$wavfile));
  $msg = "audio saved";
}
else
{
  $code = 0;
  $msg = "unable to save audio";
}
*/
 $to = "XXXX@yahoo.com";
   $from = "janedoe@anotherfakedomain.com";
    $subject = "This is a test email";
    $message = "Dear John,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";

    $headers  = "From: $from\r\n";

    $success = mail($to, $subject, $message, $headers);
    if ($success)
        echo "The email to $to from $from was successfully sent";
    else
        echo "An error occurred when sending the email to $to from $from" ;  
?>


But What is happening is that even the php script is not being invoked since I do not recieve an email as it should
But if i use
<goto next="http://IPaddrXXX:portXXX/xml/loadsound.php">
It calls the script and sends me a mail.
So the paths and IP addresses,portno. all are fine.
Some problem with POST. Am I doing something wrong while posting it? At times I even get a http 503 .
0
blinker82
Asked:
blinker82
1 Solution
 
dougdayCommented:
I take it that you're sure your email works from other scripts...

What happens if you POST to that php file from a normal html page?  Maybe try creating a dummy html page that uploads a file to this page and "fakes" what your VXML script would be doing?

Just a thought.  I always helps to narrow down the exact source of your problem.
-Doug
0
 
blinker82Author Commented:
ya Doug,
I did that........and it works fine.
But when I call it from my vxml script..........nothing happens.........
Somewhere in an older cisco manual I did read that posting an audio file does not work for PHP using IIS 5.0,
which sounded strange to me.
Any insights there?
0
 
designbaiCommented:
check this may help.

Here is some explantain about the 503 error.

http://www.checkupdown.com/status/E503.html

hope this help.s
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now