Googletts.agi problem

Hi all!

I’m testing the good script googletts.agi ( in order to use the text-to-speech functionalities offered by google. I cannot get it working.
I also tested the speech-recog agi ( and it works!!!

I’m using asterisk 1.8 version and eyebeam client.
No firewall, ok internet connection, ok permission on googletts.agi, ok path of sox and mpg123, ok dependencies required by the script.

My simple dialplan is:

exten => 999,1,Answer()
exten => 999,n,agi(googletts.agi,"Hello, this is a test. ",en)
exten => 999,n,Hangup()

When i call the 999 number with my xlite client, it immediately goes to hungup and i cannot hear anything.
From Asterisk console i see the following output:

– Executing [999@localset:1] Answer(“SIP/103-00000007”, “”) in new stack
– Executing [999@localset:2] AGI(“SIP/103-00000007”, “googletts.agi,“Hello, this is a test.”,“en””) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi
– <SIP/103-00000007>AGI Script googletts.agi completed, returning 0
– Executing [999@localset:3] Hangup(“SIP/103-00000007”, “”) in new stack
== Spawn extension (localset, 999, 3) exited non-zero on ‘SIP/103-00000007’

Any idea? I’m going crazy!!

Thx in advance


Have a look here: … ext.12101/. You might find the info in that thread useful in getting googletts working.

Thanks first of all for your suggest but unluckily no useful information for me at that link!

Just a thing: I’ve tried to download PIAF (Pbx in a flash) version and i’ve discovered that googletts.agi script works well there!!

The PIAF uses asterisk versione 1.8.13
My asterisknow the 1.8.11-cert2 instead.

Is it hard to understand what difference makes googletts.agi working on the PIAF version and not on ASteriskNow??

Thanks in advance,

I am having this same problem using asteriskNow. I am able to use googletts in PIAF, but I can’t get it working in asteriskNow. I get the same output as described above. It seems perhaps the cache is not working properly as there is not output describing playing the file in the /tmp/ directory as I’ve seen in the output on a working system. I would like to get to the bottom of this as I’ve grown to like asteriskNow.

Did you check the config within the googletts.agi ?
Just open with an editor.


User defined parameters:


Default language

my $lang = “de-DE”;

Output speed factor

my $speed = 1.3;

Use of cache mechanism

my $usecache = 1;

Cache directory path

my $cachedir = “/tmp/asterisk-googletts”;

Output audio sample rate

Leave blank to auto-detect

my $samplerate = “”;

SoX Version

Leave blank to auto-detect

my $sox_ver = 12;

Verbose debugging messages

my $debug = 7;


Basecally the problem is not related asterisk but it is the problem in string support in agi file.It will not support comma(,), semicolon (:slight_smile: this type of character in text which we provide for make the tts file using the googletts file.