[asterisk-users] Festival through AGI can't handle strings longer than 15 chars

Mario mgnospam at fgasoftware.com
Thu Aug 17 13:09:35 MST 2006


Moises,

follow on and you'll find the exact output that I got from Asterisk once 
I raised the more detailed debug level as you suggested. I'm sorry, 
that's quite a long text, but at least I'm sure you have all the info 
available.

However, I now have SOME IMPORTANT notes to add:

1. I'm running Asterisk 1.2.9.1
2. Once I restarted the server, everything worked fine. Thus, it seems 
that the problem could be solved by just restarting the server. 
However... read on.
3. Once restarted the server I changed the text inside my Python AGI and 
the error appeared again.

My CONCLUSION: the error doesn't probably depend on Festival or Exec 
command. To make the error occur, I simply do this:
a) I restart server
b) I run the AGI script with whatever text (as wide as I wish) and it 
will work
c) I shorten the text... it still will work
d) I then widen again the text: now it won't work! It will work only as 
long as I shorten the text (or leave it the same length), but not if I 
widen it.

I suspect that there is some malloc()ed area (I can't  imagine in which 
C module) that gets successfully narrowed based on the AGI passed text, 
but never gets enlarged unless the server restarts... Does it seems 
reasonable? Hope it helps.

Note: this is my 2nd reply. Since I didn't see my 1st reply in the 
newsgroup, I'm now omitting the console log since it is probably useless 
once I understood the cause of the problem (what I'm missing is how to 
fix it). I suspect that because there was too much text, my whole reply 
has been discarded.


Moises Silva wrote:
> One step more, enable the following in logger.conf
>
> console => notice,warning,error,debug,verbose
>
> Application app_festival has some interesting debug messages like:
>
> ast_log(LOG_DEBUG, "Text passed to festival server : %s\n",(char *)data);
>
> and that shows in the console the exact test is passed to the festival 
> server.
>
> I keep looking into the code trying to find the reason of the
> behaviour you describe but I havent succed so far.
>
> Please report any feedback.
>
> Regards
>
> On 8/17/06, Mario <mgnospam at fgasoftware.com> wrote:
>> Thanks for your help, Moises.
>>
>> I did activate the AGI DEBUG as you suggested (thanks for that!).
>> However, I'm now only a little bit more sure that I'm passing the right
>> stuff to the Festival command. Following you'll see what I'm passing for
>> the "short text" (shorter than 15 chars) and for the wider text.
>>
>> As you can see, both the calls seem to work, but for the 2nd I do not
>> hear any sound.
>>
>> At this point, any idea is really welcome. Thanks for your help.
>>
>> *** Short text ***
>>
>> AGI Rx << ANSWER
>> AGI Tx >> 200 result=0
>> AGI Rx << EXEC FESTIVAL "Telefono spento"
>>     -- AGI Script Executing Application: (FESTIVAL) Options: (Telefono
>> spento)
>>   == Parsing '/etc/asterisk/festival.conf': Found
>> AGI Tx >> 200 result=0
>>     -- AGI Script test_command.py completed, returning 0
>>   == Auto fallthrough, channel 'SIP/1-9803' status is 'UNKNOWN'
>>
>> *** Longer text ***
>>
>> AGI Rx << ANSWER
>> AGI Tx >> 200 result=0
>> AGI Rx << EXEC FESTIVAL "Telefono utente spento"
>>     -- AGI Script Executing Application: (FESTIVAL) Options: (Telefono
>> utente spento)
>>   == Parsing '/etc/asterisk/festival.conf': Found
>> AGI Tx >> 200 result=0
>>     -- AGI Script test_command.py completed, returning 0
>>   == Auto fallthrough, channel 'SIP/1-67c2' status is 'UNKNOWN'
>>
>>
>>
>> Moises Silva wrote:
>> > Hi Mario. Have you tried to enable AGI debug?
>> >
>> > CLI> agi debug
>> >
>> > That will show what Asterisk is receiving from your script.
>> >
>> > Also enable all the debug messages in  the logger.conf file for the
>> > console
>> >
>> > Go and try that and post what you see here, and we may be able to help
>> > you
>> >
>> > On 8/17/06, Mario <mgnospam at fgasoftware.com> wrote:
>> >> I'm having a tough problem when using Festival with Asterisk through
>> >> AGI: it seems that when I pass more than 15 chars to the Festival
>> >> command, when from inside an AGI, no sounds (speech) at all is
>> >> generated.
>> >>
>> >> The following (from inside the dialplan) correctly works:
>> >>
>> >>   exten => 333,1,Answer()
>> >>   exten => 333,2,FESTIVAL(Telefono spento uno)
>> >>   exten => 333,3,Hangup
>> >>
>> >> But, when moved from within an AGI, the same Festival command doesn't
>> >> work:
>> >>
>> >>   EXEC FESTIVAL "Telefono spento uno"
>> >>
>> >> the symptom is that no text is played, although the return code from
>> >> command is zero.
>> >>
>> >> One important note: if I shorten the text to "Telefono spento" 
>> (i.e. at
>> >> most 15-chars wide) everything works as expected.
>> >>
>> >> I really can't figure out the reason of this weird behavior. What 
>> I can
>> >> do is to exclude some possible reasons:
>> >>
>> >> 1. It is not a festival-related problem since when called from the
>> >> Dialplan everything works as expected.
>> >> 2. It is not a language-related issue, since I tried this both with
>> >> English and Italian
>> >> 3. It is not a missing call to flush()... yes, I added a flush() 
>> at the
>> >> end of my Python-based AGI call
>> >> 4. It is not a problem related to Python, since I use Python 
>> extensively
>> >> with AGI
>> >>
>> >> Does anyone have a hint on what I can do to investigate or solve this
>> >> problem? Does enyone know if this is a known bug?
>> >>
>> >> Thanks in advance,
>> >>
>> >> Mario
>> >>
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> --Bandwidth and Colocation provided by Easynews.com --
>> >>
>> >> asterisk-users mailing list
>> >> To UNSUBSCRIBE or update options visit:
>> >>    http://lists.digium.com/mailman/listinfo/asterisk-users
>> >>
>> >
>> >
>>
>>
>
>




More information about the asterisk-users mailing list