Fellow Monks lend me your ears!
I was browsing the CPAN modules available and came across one that I have missed until now. VoiceXML::Server
I did a quick read of the docs and decided to try the example.
#!/usr/bin/perl -w
use diagnostics;
use strict;
require VoiceXML::Server;
my $server = VoiceXML::Server->new();
# it says not use avoidfirewall if you can help it, so I removed that
+part
$server->Audio("Pick a number between 1 and 99.");
my $num = int(rand(99)) + 1;
while (1) {
my $guess = $server->Listen(grammar => "NATURAL_NUMBER_THRU_99");
if ($guess < $num) {
$server->Audio("No, $guess is too low. Try again.");
} elsif ($guess > $num) {
$server->Audio("No, $guess is too high. Try again.");
} else {
$server->Audio("That's right, my number was $num. OK, " .
"let's play again. I'm thinking of a " .
"different number.");
$num = int(rand(99)) + 1;
}
}
I have tried it with two different webservers with two different results. On this win98 machine running the most recent ActiveState Perl and using the Xitami webserver, it gives a 502 Service temporarily overloaded. On my hosted site, I get "Premature end of script headers".
The debug option does not seem to do anything on either.
Has anyone had any luck with this thing?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|