Asterisk phpagi scrit have text to speech issue


I have installed asterisk and now I want to use text-to-speech. For that I have festival on my system.

I want to use php agi script and want some text to be played.
festival-1.95 is available in centos system.

Below is my php script.

[quote]#!/usr/bin/php -q
#!/usr/local/bin/php -q

<? set_time_limit(30); ini_set( "include_path", "/home/sources/" ); include('phpagi.php'); error_reporting(E_ALL); $agi = new AGI(); $agi->answer(); $agi->stream_file("demo-congrats","#"); $agi->stream_file("enter-some-digits============","#"); $result = $agi->get_data('beep', 3000, 20); $keys = $result['result']; $agi->stream_file("you-entered==============","#"); $agi->say_digits($keys); $agi->hangup(); ?>


But when I try to call the .php file from the asterisk agi, it is giving the following on CLI :

[quote]*CLI> == Using SIP RTP CoS mark 5
– Executing [6565@default:1] Answer(“SIP/1000-00000000”, “”) in new stack
– Executing [6565@default:2] AGI(“SIP/1000-00000000”, “testAgi-3.php”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/testAgi-3.php
– Playing ‘demo-congrats’ (escape_digits=#) (sample_offset 0)
[Feb 10 13:27:53] WARNING[4479]: file.c:650 ast_openstream_full: File enter-some-digits============ does not exist in any format
– <SIP/1000-00000000> Playing ‘beep.gsm’ (language ‘en’)
[Feb 10 13:27:53] WARNING[4479]: file.c:650 ast_openstream_full: File you-entered============== does not exist in any format
– <SIP/1000-00000000> Playing ‘digits/0.gsm’ (language ‘en’)
– <SIP/1000-00000000>AGI Script testAgi-3.php completed, returning 4
== Spawn extension (default, 6565, 2) exited non-zero on ‘SIP/1000-00000000’

any help ?


All support on was terminated some time ago. It is not even the final version of the 1.6.0 branch. Even 1.6.2.x is no longer in mainstream support, and security fix support will end in a couple of months.

I’m not sure if Festival is supported from AGI. If it is, it is certainly not going to be done by trying to pronounce the names of missing recording files.

It is not clear to me why you are not doing this directly from extensions.conf; AGI is over-used.

Thank you for the reply.

As per your suggestion I will use it directly from the extensions.conf.

One more thing would like to ask you is :
can I use the asterisk- ?