perl script open/save for voiceMessage problems

P

paul.hopgood

I am trying to save a voiceMessage from a voiceXML script transfered
via a BeVocal vxml script to a perl program located in a Yahoo web
server that supports the perl language. I don't know exactly what path
I need to name my file.My test.wav file does not create. Nothing
happens. Any suggestions would be helpful.

Here is my recording.pl file and what is currently coded in it:

#!/usr/bin/perl -w

use CGI qw:)standard);
$|++;

my $pathToRecordings='http://www.deathnotify.com/recordings';
my $newRecording = 'test.wav';

print header;

open (SAVE, "> $deathnotify.com/recordings");
binmode(SAVE);
while (read(param('voiceMessage'),$data,1024))
{ print SAVE $data; }
close(SAVE);

# CONFIRM RECORDING WAS SAVED

print <<INSERT_VXML;
<?xml version="1.0"?>

<vxml version="1.0">
<form id="acceptInput">
<block>
Input was $ENV{'CONTENT_LENGTH'} bytes in length.
The recording was processed and saved.
<return/>
</block>
</form>
</vxml>

INSERT_VXML
 
S

smallpond

I am trying to save a voiceMessage from a voiceXML script transfered
via a BeVocal vxml script to a perl program located in a Yahoo web
server that supports the perl language. I don't know exactly what path
I need to name my file.My test.wav file does not create. Nothing
happens. Any suggestions would be helpful.

Here is my recording.pl file and what is currently coded in it:

#!/usr/bin/perl -w

use CGI qw:)standard);
$|++;

my $pathToRecordings='http://www.deathnotify.com/recordings';
my $newRecording = 'test.wav';

print header;

open (SAVE, "> $deathnotify.com/recordings");
binmode(SAVE);
while (read(param('voiceMessage'),$data,1024))
{ print SAVE $data; }
close(SAVE);

# CONFIRM RECORDING WAS SAVED

print <<INSERT_VXML;
<?xml version="1.0"?>

<vxml version="1.0">
<form id="acceptInput">
<block>
Input was $ENV{'CONTENT_LENGTH'} bytes in length.
The recording was processed and saved.
<return/>
</block>
</form>
</vxml>

INSERT_VXML


This is going to surprise you. open, read and close all
return something: namely, the answer to your question.
 
J

J. Gleixner

I am trying to save a voiceMessage from a voiceXML script transfered
via a BeVocal vxml script to a perl program located in a Yahoo web
server that supports the perl language. I don't know exactly what path
I need to name my file.My test.wav file does not create. Nothing
happens. Any suggestions would be helpful.

Here is my recording.pl file and what is currently coded in it:

#!/usr/bin/perl -w

use CGI qw:)standard);

forgot

use strict;
$|++;

my $pathToRecordings='http://www.deathnotify.com/recordings';
my $newRecording = 'test.wav';

You never use either of these variables.
print header;

open (SAVE, "> $deathnotify.com/recordings");

Where is $deathnotify defined?
What if open() fails?

That's why you 'use strict'.
 
D

Daniel Pfeiffer

Tad said:
You should always enable strictures in Perl programs.


True, as two others had posted over 3 hours befor you said as well.
use strict;




"use strict" would have found the bug in the line above if you
had only asked it to...

I wouldn't call it a bug, I'd call it sloppy copy-pasting and/or
from-memory typing.
 
T

Tad J McClellan

Daniel Pfeiffer said:
True, as two others had posted over 3 hours befor you said as well.


Usenet is not IM.

I wouldn't call it a bug,


Wikipedia would (http://en.wikipedia.org/wiki/Software_bug)

A software bug is an error, flaw, mistake, failure, or fault
in a computer program that prevents it from behaving as intended

and so would I.

I'd call it sloppy copy-pasting and/or
from-memory typing.


The cause of a defect is not the same thing as the defect itself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top