Hi,
I like to try out some Asterisk-features with vxml. I´ve installed asterisk,vxi,flite.
Now I like to stream a videofile to a softphone when i call a special number. But that won´t work.
Videocalls are working well. So I know that videocalls are supported by the asterisk server but what about the VoiceXML-browser? I just have an trail-licence, may be that´s the reason why this is not working yet? Is there any other possibility to stream video files with asterisk? - I tried that with the Playback() but this is not working any way. Also i was using serveral video formats but non of them were running.
The next thing i´ve tried was TTS with festival. Festival is working (Flite() see below), but not together with vxml. Vxml itself is working when it played a wav file. There is also an Apache running on the system which is using the php-script, that is given in the develloper guide from i6net. I know that the script is running but giving me no sound back. (when i call it at the internetbrowser my musicplayer is starting-but nothing else happens, because there is no file i gave befor to the script)
It would be very nice if somebody can help me.
Thanks to all of you!
Here is a part of my extension.conf file:
exten => 123,1,Flite(Willkommen)
exten => 123,2,Flite(Bitte wählen Sie)
exten => 123,3,Flite(ESSEN)
exten => 123,4,Flite(TRINKEN)
exten => 123,5,Flite(Auf wiedersehen)
exten => 555,1,Answer
exten => 555,2,Wait(3)
exten => 555,3,Vxml(file:///tmp/vxml/video1.vxml)
exten => 555,4,Hangup
And here the vxml file:
<?xml version="1.0"?> Try to show the videophp script:
<?php $format = $_POST["format"]; if (!$format) $format = $_GET["format"]; if (!$format) $format = "wav"; // Default format $text = $_POST["text"]; if (!$text) $text = $_GET["text"]; if ($format=="gsm") { header("Content-Type: audio/x-gsm"); header('Content-Disposition: attachment; filename="file.gsm"'); } else { header("Content-Type: audio/x-wav"); header('Content-Disposition: attachment; filename="file.wav"'); } /* // calc an offset of 24 hours $offset = 3600 * 24; // calc the string in GMT not localtime and add the offset $expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; //output the HTTP header Header($expire); */ if (($text) || ($_FILES['file']['tmp_name'])) { if (($language == "text") && ($format == "gif")) { $text=str_replace("\'", "'", $text); $program = "convert"; chdir("/tmp"); @unlink("/tmp/text.gif"); system("/usr/bin/convert -size 176x144 xc:transparent -fill black -pointsize 15 -draw \"text 5,20 '$text'\" /tmp/text.gif"); $filename="/tmp/text.gif"; } else { $filename="/tmp/text.txt"; $file=fopen($filename, "w"); fwrite($file, $text); fwrite($file, "\n"); fclose($file); $program = "/usr/bin/flite"; exec($program." -f /tmp/text.txt -o /tmp/text.wav", $return, $status); $filename="/tmp/text.wav"; } readfile($filename); unlink($filename); } else { header("HTTP/1.1 404 Not Found"); exit(); } To the configuration of the Vxml browser i added that: ############################ # TTS server configuration # ############################ client.prompt.resource.0.uri VXIString [localhost/tts.php](http://localhost/tts.php) client.prompt.resource.0.method VXIString POST client.prompt.resource.0.cacheDir VXIString /tmp client.prompt.resource.0.format VXIString wav client.prompt.resource.0.maxage VXIInteger -1