[Asterisk-Dev] app_festival normal behaviour??

Moises Silva moises.silva at gmail.com
Sat Nov 26 12:54:46 MST 2005


Hi, i recently installed festival and try to use app_festival. But so far is
nor working, it seems is a problem with the festival server, not the
app_festival itself. However Im not sure if the behaviour of app_festival is
"right". Let me explain:

i have in extensions.conf

 [festival]
exten => _X.,1,Answer
exten => _X.,2,Festival('this is a festival test')
exten => _X.,3,Hangup()

i have the festival server started.
when i dial my test extension, app_festival connects just fine to the
festival server, no error in

 ast_log(LOG_WARNING,"festival_client: connect to server failed\n");


the call just stays there, doing nothing, and checking `ps ax | grep
festival` i realized that the server is no longer running, so i suppose i
have to check why is going down when i try to run app_festival, any way, the
application should return an error or something, dont you think?

i made the next small change to the code of app_festival:

 --- app_festival.c.orig 2005-11-26 13:20:31.559912680 +0000
+++ app_festival.c      2005-11-26 13:23:15.766949416 +0000
@@ -424,8 +424,17 @@
        /* This assumes only one waveform will come back, also LP is unlikely */
        wave = 0;
        do {
+               int fd_read;
                for (n=0; n < 3; )
+               {
+                       fd_read = read(fd,ack+n,3-n);
+                       if ( fd_read == -1 )
+                       {
+                               ast_log(LOG_WARNING, "Unable to read
cache or festival response fd");
+                               return -1;
+                       }
                        n += read(fd,ack+n,3-n);
+               }
                ack[3] = '\0';
                if (strcmp(ack,"WV\n") == 0) {         /* receive a waveform */
                        ast_log(LOG_DEBUG,"Festival WV command\n");


just testing if its still possible to read from the file descriptor,
otherwise return -1 and display a warning, in order
to not being reading indefinitly

best regards.

--
"Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20051126/f2c08d73/attachment.htm


More information about the asterisk-dev mailing list