zaf / asterisk-googletts

Asterisk AGI script that uses Google's translate text to speech service.
GNU General Public License v2.0
214 stars 125 forks source link

asterisk-googletts on centos no sound #9

Closed andreafranchi closed 10 years ago

andreafranchi commented 10 years ago

On a fresh centos with astersiknow 11 I try to use asterisk-googletts on a simple extension:

exten => 995,1,Answer exten => 995,2,agi(googletts.agi,"Il motore di sintetizzazione della voce",it) exten => 995,3,agi(googletts.agi,"è stato installato",it) exten => 995,4,agi(googletts.agi,"Arrivederci e grazie.",it) exten => 995,5,HangUp

The console output is: Connected to Asterisk 11.2.1 currently running on localhost (pid = 4148) == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Executing [995@from-internal:1] Answer("SIP/101-00000000", "") in new stack -- Executing [995@from-internal:2] AGI("SIP/101-00000000", "googletts.agi,"Il motore di sintetizzazione della voce",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:3] AGI("SIP/101-00000000", "googletts.agi,"è stato installato",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:4] AGI("SIP/101-00000000", "googletts.agi,"Arrivederci e grazie.",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:5] Hangup("SIP/101-00000000", "") in new stack == Spawn extension (from-internal, 995, 5) exited non-zero on 'SIP/101-00000000' -- Executing [h@from-internal:1] Hangup("SIP/101-00000000", "") in new stack == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/101-00000000' localhost*CLI>

googletts.agi return state 0 that indicate success, but no sound is produced on the phone.

Where I'm wrong? I have similar issue using speech-recog.agi

Thanks in advance

zaf commented 10 years ago

Enable debug on the AGI script (set $debug = 1 in the 'User defined parameters') and capture the full debug output.

andreafranchi commented 10 years ago

ok, done but where i can read debug?

zaf commented 10 years ago

In the console asterisk was started. If you havent started it manually but used an init script or safe_asterisk then this is usually tty9

andreafranchi commented 10 years ago

Sorry, I'm newby. I stopped asterisk, then launch with safe_asterisk, then asterisk -rvvv.

I call 995 by soft phone but the console output is not changed:

Connected to Asterisk 11.2.1 currently running on localhost (pid = 6820) == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Executing [995@from-internal:1] Answer("SIP/101-00000002", "") in new stack -- Executing [995@from-internal:2] AGI("SIP/101-00000002", "googletts.agi,"Il motore di sintetizzazione della voce",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000002>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:3] AGI("SIP/101-00000002", "googletts.agi,"è stato installato",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000002>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:4] AGI("SIP/101-00000002", "googletts.agi,"Arrivederci e grazie.",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/101-00000002>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:5] Hangup("SIP/101-00000002", "") in new stack == Spawn extension (from-internal, 995, 5) exited non-zero on 'SIP/101-00000002' -- Executing [h@from-internal:1] Hangup("SIP/101-00000002", "") in new stack == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/101-00000002'

nullco commented 10 years ago

Hello, i have exactly the same problem, i have already changed the $debug variable to 1, and still cant see any difference in the console output

Connected to Asterisk 11.7.0 currently running on dhcppc13 (pid = 1279) == Using SIP RTP CoS mark 5 -- Executing [6001@users:1] Answer("SIP/demo-alice-00000006", "500") in new stack -- Executing [6001@users:2] AGI("SIP/demo-alice-00000006", "googletts.agi,"bienvenido",es") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi -- <SIP/demo-alice-00000006>AGI Script googletts.agi completed, returning 0 -- Auto fallthrough, channel 'SIP/demo-alice-00000006' status is 'UNKNOWN'

zaf commented 10 years ago

The instructions to get AGI debug info from asterisk in my previous post are quite clear. Asterisk diplays AGI debug output on the terminal it was originally started, this is either the local terminal you are using, if you started asterisk manually (eg using: 'asterisk -U asterisk -G asterisk -cvvv'), or tty9 if you used some init script or safe_asterisk. Please try to keep relevant with the scope of this debug board which is not general asterisk administration and usage support.

nullco commented 10 years ago

Sorry, my bad, i could correctly see the debug output from tty9 and figured out the problem, it said that mpg123 was missing, i had it already installed but missed to add it to /usr/bin, i fixed it by executing the following command:

ln -s /usr/local/bin/mpg123 /usr/bin/mpg123

andreafranchi commented 10 years ago

Now using asterisk -U asterisk -G asterisk -cvvv, the console output is complited:

*CLI> == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Executing [995@from-internal:1] Answer("SIP/101-00000000", "") in new stack -- Executing [995@from-internal:2] AGI("SIP/101-00000000", "googletts.agi,"Il motore di sintetizzazione della voce",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi Can't locate CGI/Util.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /var/lib/asterisk/agi-bin/googletts.agi line 42. BEGIN failed--compilation aborted at /var/lib/asterisk/agi-bin/googletts.agi line 42. -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:3] AGI("SIP/101-00000000", "googletts.agi,"è stato installato",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi Can't locate CGI/Util.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /var/lib/asterisk/agi-bin/googletts.agi line 42. BEGIN failed--compilation aborted at /var/lib/asterisk/agi-bin/googletts.agi line 42. -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:4] AGI("SIP/101-00000000", "googletts.agi,"Arrivederci e grazie.",it") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi Can't locate CGI/Util.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at /var/lib/asterisk/agi-bin/googletts.agi line 42. BEGIN failed--compilation aborted at /var/lib/asterisk/agi-bin/googletts.agi line 42. -- <SIP/101-00000000>AGI Script googletts.agi completed, returning 0 -- Executing [995@from-internal:5] Hangup("SIP/101-00000000", "") in new stack == Spawn extension (from-internal, 995, 5) exited non-zero on 'SIP/101-00000000' -- Executing [h@from-internal:1] Hangup("SIP/101-00000000", "") in new stack == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/101-00000000'

Seem something wrong with perl, but perl is installed:

Setting up Install Process Package 4:perl-5.10.1-136.el6.i686 already installed and latest version

Where is the problem? Thanks

hmayer commented 10 years ago

just do: cpan install CGI::Util

Your problem is relative to missing perl modules ;)

andreafranchi commented 10 years ago

I try cpan install CGI::Util but i receive the following error: -bash: cpan: command not found

I'm using centos 6, does it metter? Tks

hmayer commented 10 years ago

Yes, matter. CentOS don't install perl-CPAN by default. Install perl-CPAN packages and try again.

zaf commented 10 years ago

No, dont install CPAN to install perl modules that your distro repositories already contain. Just run:

yum install perl-CGI

saulortega commented 10 years ago

Hello.

I have the same problem.

My extensions_custom.conf:

[habla] exten => 1245,1,Answer() exten => 1245,n,agi(googletts.agi,"This is a simple google text to speech test in english.",en)

I have installed sox, mpg123, perl-libwww, format_sln, perl-CGI-Session, perl-CGI-Simple, perl-CGI-SpeedyCGI, perl-CGI-Untaint, and internet access.

I'm using Elastix (CentOS 5).

-rwxr-xr-x 1 asterisk asterisk 8880 jul 28 10:16 /var/lib/asterisk/agi-bin/googletts.agi

On googletts.agi: my $debug = 1;

On Asterisk: agi set debug on

When I dial 1245, I not hear anything.

elastix_CLI> == Using SIP RTP TOS bits 184 == Using SIP RTP CoS mark 5 -- Executing [1245@from-internal:1] Answer("SIP/1002-00000002", "") in new stack -- Executing [1245@from-internal:2] AGI("SIP/1002-00000002", "googletts.agi,"This is a simple google text to speech test in english.",en") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi <SIP/1002-00000002>AGI Tx >> agi_request: googletts.agi <SIP/1002-00000002>AGI Tx >> agi_channel: SIP/1002-00000002 <SIP/1002-00000002>AGI Tx >> agi_language: es <SIP/1002-00000002>AGI Tx >> agi_type: SIP <SIP/1002-00000002>AGI Tx >> agi_uniqueid: 1406562880.2 <SIP/1002-00000002>AGI Tx >> agi_version: 1.8.20.0 <SIP/1002-00000002>AGI Tx >> agi_callerid: 1002 <SIP/1002-00000002>AGI Tx >> agi_calleridname: device <SIP/1002-00000002>AGI Tx >> agi_callingpres: 0 <SIP/1002-00000002>AGI Tx >> agi_callingani2: 0 <SIP/1002-00000002>AGI Tx >> agi_callington: 0 <SIP/1002-00000002>AGI Tx >> agi_callingtns: 0 <SIP/1002-00000002>AGI Tx >> agi_dnid: 1245 <SIP/1002-00000002>AGI Tx >> agi_rdnis: unknown <SIP/1002-00000002>AGI Tx >> agi_context: from-internal <SIP/1002-00000002>AGI Tx >> agi_extension: 1245 <SIP/1002-00000002>AGI Tx >> agi_priority: 2 <SIP/1002-00000002>AGI Tx >> agi_enhanced: 0.0 <SIP/1002-00000002>AGI Tx >> agi_accountcode: <SIP/1002-00000002>AGI Tx >> agi_threadid: -1224672368 <SIP/1002-00000002>AGI Tx >> agi_arg_1: This is a simple google text to speech test in english. <SIP/1002-00000002>AGI Tx >> agi_arg_2: en <SIP/1002-00000002>AGI Tx >> -- <SIP/1002-00000002>AGI Script googletts.agi completed, returning 0 -- Executing [1245@from-internal:7] Wait("SIP/1002-00000002", "1") in new stack -- Executing [1245@from-internal:8] Congestion("SIP/1002-00000002", "20") in new stack == Spawn extension (from-internal, 1245, 8) exited non-zero on 'SIP/1002-00000002' -- Executing [h@from-internal:1] Macro("SIP/1002-00000002", "hangupcall") in new stack -- Executing [s@macro-hangupcall:1] GotoIf("SIP/1002-00000002", "1?endmixmoncheck") in new stack -- Goto (macro-hangupcall,s,9) -- Executing [s@macro-hangupcall:9] NoOp("SIP/1002-00000002", "End of MIXMON check") in new stack -- Executing [s@macro-hangupcall:10] GotoIf("SIP/1002-00000002", "1?nomeetmemon") in new stack -- Goto (macro-hangupcall,s,28) -- Executing [s@macro-hangupcall:28] NoOp("SIP/1002-00000002", "End of MEETME check") in new stack -- Executing [s@macro-hangupcall:29] GotoIf("SIP/1002-00000002", "1?noautomon") in new stack -- Goto (macro-hangupcall,s,34) -- Executing [s@macro-hangupcall:34] NoOp("SIP/1002-00000002", "TOUCH_MONITOR_OUTPUT=") in new stack -- Executing [s@macro-hangupcall:35] GotoIf("SIP/1002-00000002", "1?noautomon2") in new stack -- Goto (macro-hangupcall,s,41) -- Executing [s@macro-hangupcall:41] NoOp("SIP/1002-00000002", "MONITOR_FILENAME=") in new stack -- Executing [s@macro-hangupcall:42] GotoIf("SIP/1002-00000002", "1?skiprg") in new stack -- Goto (macro-hangupcall,s,45) -- Executing [s@macro-hangupcall:45] GotoIf("SIP/1002-00000002", "1?skipblkvm") in new stack -- Goto (macro-hangupcall,s,48) -- Executing [s@macro-hangupcall:48] GotoIf("SIP/1002-00000002", "1?theend") in new stack -- Goto (macro-hangupcall,s,50) -- Executing [s@macro-hangupcall:50] AGI("SIP/1002-00000002", "hangup.agi") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi <SIP/1002-00000002>AGI Tx >> agi_request: hangup.agi <SIP/1002-00000002>AGI Tx >> agi_channel: SIP/1002-00000002 <SIP/1002-00000002>AGI Tx >> agi_language: es <SIP/1002-00000002>AGI Tx >> agi_type: SIP <SIP/1002-00000002>AGI Tx >> agi_uniqueid: 1406562880.2 <SIP/1002-00000002>AGI Tx >> agi_version: 1.8.20.0 <SIP/1002-00000002>AGI Tx >> agi_callerid: 1002 <SIP/1002-00000002>AGI Tx >> agi_calleridname: device <SIP/1002-00000002>AGI Tx >> agi_callingpres: 0 <SIP/1002-00000002>AGI Tx >> agi_callingani2: 0 <SIP/1002-00000002>AGI Tx >> agi_callington: 0 <SIP/1002-00000002>AGI Tx >> agi_callingtns: 0 <SIP/1002-00000002>AGI Tx >> agi_dnid: 1245 <SIP/1002-00000002>AGI Tx >> agi_rdnis: unknown <SIP/1002-00000002>AGI Tx >> agi_context: macro-hangupcall <SIP/1002-00000002>AGI Tx >> agi_extension: s <SIP/1002-00000002>AGI Tx >> agi_priority: 50 <SIP/1002-00000002>AGI Tx >> agi_enhanced: 0.0 <SIP/1002-00000002>AGI Tx >> agi_accountcode: <SIP/1002-00000002>AGI Tx >> agi_threadid: -1224672368 <SIP/1002-00000002>AGI Tx >> <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(uniqueid) <SIP/1002-00000002>AGI Tx >> 200 result=1 (1406562880.2) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(answer) <SIP/1002-00000002>AGI Tx >> 200 result=1 (2014-07-28 10:54:40) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(src) <SIP/1002-00000002>AGI Tx >> 200 result=1 (1002) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(dst) <SIP/1002-00000002>AGI Tx >> 200 result=1 (1245) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(billsec) <SIP/1002-00000002>AGI Tx >> 200 result=1 (2) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(dstchannel) <SIP/1002-00000002>AGI Tx >> 200 result=0 <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(disposition) <SIP/1002-00000002>AGI Tx >> 200 result=1 (ANSWERED) <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(accountcode) <SIP/1002-00000002>AGI Tx >> 200 result=0 <SIP/1002-00000002>AGI Rx << GET VARIABLE CDR(channel) <SIP/1002-00000002>AGI Tx >> 200 result=1 (SIP/1002-00000002) <SIP/1002-00000002>AGI Rx << GET VARIABLE DIAL_TRUNK <SIP/1002-00000002>AGI Tx >> 200 result=0 -- <SIP/1002-00000002>AGI Script hangup.agi completed, returning 0 -- Executing [s@macro-hangupcall:51] Hangup("SIP/1002-00000002", "") in new stack == Spawn extension (macro-hangupcall, s, 51) exited non-zero on 'SIP/1002-00000002' in macro 'hangupcall' == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/1002-00000002' elastix_CLI>

saulortega commented 10 years ago

Oh, sorry, this is the solution:

ln -s /usr/local/bin/mpg123 /usr/bin/mpg123

Abe-Telo commented 7 years ago

in centos 6 i did

cd /var/lib/asterisk/agi-bin/
git clone git://github.com/zaf/asterisk-googletts

sudo yum install perl-libwww-perl
sudo yum install perl-DBI
sudo yum install perl-DBD-MySQL
sudo yum install perl-GD
sudo yum install perl-CGI
sudo yum install perl-JSON
sudo yum sox
sudo yum sox-devel

For the mpg123 Create a file repository config file /etc/yum.repos.d/linuxtech.repo

nano /etc/yum.repos.d/linuxtech.repo

Past this ---------------------------------------------------------

[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET

---------------------------------------------------------

yum install mpg123

Note that some dependency you may still need not listed here,

More info here. https://www.digitalocean.com/community/questions/how-to-install-perl-lwp-module-on-centos-7 https://centos.pkgs.org/6/linuxtech/mpg123-1.14.4-1.el6.i686.rpm.html

fabiosangiorgi commented 6 years ago

I solved it with

yum install perl-IO-Socket-SSL.noarch

and add

use IO::Socket::SSL;

in "/var/lib/asterisk/agi-bin/googletts.agi" file

janduy commented 6 years ago

Hello Good evening,

I'm experiencing a similar problem, but apparently in the log it says it has not found SOX and MPG123, but both are installed.

I will attach below the log of my AGI.

LOG:

Thank you.

janduy commented 6 years ago

Good Morning.

I did another test, I disabled in the code line of "googletts.agi" where check the mpg123 and sox both are already installed.

Commented line: Abort if required programs not found. fatal_log ("sox or mpg123 is missing. Aborting.") if (! $ sox || $ mpg123); chomp ($ sox, $ mpg123);

Follow the new error log, I notice that it generates the link with the message, but it does not start in linux, I validated the link, it works.

I'm using CentOS7.

I will send the log after commenting the line, as I mentioned above.

Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi <SIP/8004-0000000b>AGI Tx >> agi_request: googletts.agi <SIP/8004-0000000b>AGI Tx >> agi_channel: SIP/8004-0000000b <SIP/8004-0000000b>AGI Tx >> agi_language: br <SIP/8004-0000000b>AGI Tx >> agi_type: SIP <SIP/8004-0000000b>AGI Tx >> agi_uniqueid: 1515931467.15 <SIP/8004-0000000b>AGI Tx >> agi_version: certified/13.13-cert9 <SIP/8004-0000000b>AGI Tx >> agi_callerid: 8004 <SIP/8004-0000000b>AGI Tx >> agi_calleridname: 8004 <SIP/8004-0000000b>AGI Tx >> agi_callingpres: 0 <SIP/8004-0000000b>AGI Tx >> agi_callingani2: 0 <SIP/8004-0000000b>AGI Tx >> agi_callington: 0 <SIP/8004-0000000b>AGI Tx >> agi_callingtns: 0 <SIP/8004-0000000b>AGI Tx >> agi_dnid: 8002 <SIP/8004-0000000b>AGI Tx >> agi_rdnis: unknown <SIP/8004-0000000b>AGI Tx >> agi_context: ivrtime <SIP/8004-0000000b>AGI Tx >> agi_extension: s <SIP/8004-0000000b>AGI Tx >> agi_priority: 4 <SIP/8004-0000000b>AGI Tx >> agi_enhanced: 0.0 <SIP/8004-0000000b>AGI Tx >> agi_accountcode: <SIP/8004-0000000b>AGI Tx >> agi_threadid: 140167000688384 <SIP/8004-0000000b>AGI Tx >> agi_arg_1: Digite o seu numero de cliente assim eu posso lhe identificar <SIP/8004-0000000b>AGI Tx >> agi_arg_2: pt-BR <SIP/8004-0000000b>AGI Tx >> <SIP/8004-0000000b>AGI Rx << CHANNEL STATUS <SIP/8004-0000000b>AGI Tx >> 200 result=6 <SIP/8004-0000000b>AGI Rx << GET FULL VARIABLE ${CHANNEL(audionativeformat)} <SIP/8004-0000000b>AGI Tx >> 200 result=1 ((alaw)) <SIP/8004-0000000b>AGI Rx << NOOP " -- googletts.agi: Text passed for synthesis: Digite o seu numero de cliente assim eu posso lhe identificar." <SIP/8004-0000000b>AGI Tx >> 200 result=0 <SIP/8004-0000000b>AGI Rx << NOOP " -- googletts.agi: Language: pt-BR, Interrupt keys: , Sample rate: 8000" <SIP/8004-0000000b>AGI Tx >> 200 result=0 <SIP/8004-0000000b>AGI Rx << NOOP " -- googletts.agi: Speed: 1, Caching: 1, Cache dir: /tmp" <SIP/8004-0000000b>AGI Tx >> 200 result=0 <SIP/8004-0000000b>AGI Rx << NOOP " -- googletts.agi: URL passed: https://translate.google.com/translate_tts?ie=UTF-8&q=Digite%20o%20seu%20numero%20de%20cliente%20assim%20eu%20posso%20lhe%20identificar.&tl=pt-BR&total=1&idx=0&textlen=62&client=tw-ob&tk=222746.330494&prev=input" <SIP/8004-0000000b>AGI Tx >> 200 result=0 <SIP/8004-0000000b>AGI Rx << NOOP " -- googletts.agi: failed: -1" <SIP/8004-0000000b>AGI Tx >> 200 result=0 -- <SIP/8004-0000000b>AGI Script googletts.agi completed, returning 0

fabiosangiorgi commented 6 years ago

first  yum install sox sox-devel sox-devel mpg123 perl-LWP-Protocol-https perl-Crypt-SSLeay perl-LWP-Protocol-https perl-Crypt-SSLeay perl-libwww-perl perl-LWP-Protocol-https perl-HTTP-Message perl-XML-Simple perl-Crypt-SSLeay perl-libwww-perl perl-XML-Simple perl-IO-Socket-SSL.noarch

to search for the correct path for sox and mpg123 which soxwhich mpg123 and edit my $sox     = "/usr/bin/sox"; my $mpg123  = "/usr/bin/mpg123"; in /var/lib/asterisk/agi-bin/googletts.agi

edit my $cachedir = "/tmpasterisk";in /var/lib/asterisk/agi-bin/googletts.agi mkdir /tmpastersikchown asterisk:astersik /tmpastersik chmod +x /tmpastersik chown asterisk:astersik /var/lib/asterisk/agi-bin/googletts.agi

Dott. Fabio Sangiorgi fabiosangiorgi@yahoo.it tel. 3331467114 fax 09123860599 Il Domenica 14 Gennaio 2018 13:15, JSilva ha scritto: Good Morning.I did another test, I disabled in the code line of "googletts.agi" where check the mpg123 and sox both are already installed.Commented line: Abort if required programs not found. fatal_log ("sox or mpg123 is missing. Aborting.") if (! $ sox || $ mpg123); chomp ($ sox, $ mpg123);Follow the new error log, I notice that it generates the link with the message, but it does not start in linux, I validated the link, it works.I'm using CentOS7.I will send the log after commenting the line, as I mentioned above.Launched AGI Script /var/lib/asterisk/agi-bin/googletts.agi AGI Tx >> agi_request: googletts.agi AGI Tx >> agi_channel: SIP/8004-0000000b AGI Tx >> agi_language: br AGI Tx >> agi_type: SIP AGI Tx >> agi_uniqueid: 1515931467.15 AGI Tx >> agi_version: certified/13.13-cert9 AGI Tx >> agi_callerid: 8004 AGI Tx >> agi_calleridname: 8004 AGI Tx >> agi_callingpres: 0 AGI Tx >> agi_callingani2: 0 AGI Tx >> agi_callington: 0 AGI Tx >> agi_callingtns: 0 AGI Tx >> agi_dnid: 8002 AGI Tx >> agi_rdnis: unknown AGI Tx >> agi_context: ivrtime AGI Tx >> agi_extension: s AGI Tx >> agi_priority: 4 AGI Tx >> agi_enhanced: 0.0 AGI Tx >> agi_accountcode: AGI Tx >> agi_threadid: 140167000688384 AGI Tx >> agi_arg_1: Digite o seu numero de cliente assim eu posso lhe identificar AGI Tx >> agi_arg_2: pt-BR AGI Tx >> AGI Rx << CHANNEL STATUS AGI Tx >> 200 result=6 AGI Rx << GET FULL VARIABLE ${CHANNEL(audionativeformat)} AGI Tx >> 200 result=1 ((alaw)) AGI Rx << NOOP " -- googletts.agi: Text passed for synthesis: Digite o seu numero de cliente assim eu posso lhe identificar." AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: Language: pt-BR, Interrupt keys: , Sample rate: 8000" AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: Speed: 1, Caching: 1, Cache dir: /tmp" AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: URL passed: https://translate.google.com/translate_tts?ie=UTF-8&q=Digite%20o%20seu%20numero%20de%20cliente%20assim%20eu%20posso%20lhe%20identificar.&tl=pt-BR&total=1&idx=0&textlen=62&client=tw-ob&tk=222746.330494&prev=input" AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: failed: -1" AGI Tx >> 200 result=0 -- AGI Script googletts.agi completed, returning 0— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
janduy commented 6 years ago

@fabiosangiorgi

Hello, I'm going to check the dependencies that I have passed, I believe that almost all I have installed, I followed the dependencies of the "readme" file of the googletts github that I downloaded. I'll check and put the result here.

thank you!

janduy commented 6 years ago

@fabiosangiorgi

The only missing dependencies were these "XML" but it did not work. =(

Have been installed: perl-XML-NamespaceSupport perl-XML-Parser-2.41-10.el7.x86_64 perl-XML-SAX-Base-1.08-7.el7.noarch perl-XML-SAX-0.99-9.el7.noarch perl-XML-Simple-2.20-5.el7.noarch

I did a second test, I put the absolute paths of "SOX" and "MPG123" there is another bizarre error.

Original: my $sox = /usr/bin/which sox; my $mpg123 = /usr/bin/which mpg123;

Changed: my $sox = /usr/bin/sox; my $mpg123 = /usr/bin/mpg123;

[root@bu7bu12 ~]# perl googletts.agi /usr/bin/sox FAIL sox: Not enough input filenames specified

Can't exec "/usr/bin/mpg123": Permissão negada at /var/lib/asterisk/agi-bin/googletts.agi line 87.

I already checked the permissions, I left all "chmod 777"

fabiosangiorgi commented 6 years ago

URL passed:

https://translate.google.com/translate_tts?ie=UTF-8&q=Digite%20o%20seu%20numero%20de%20cliente%20assim%20eu%20posso%20lhe%20identificar.&tl=pt-BR&total=1&idx=0&textlen=62&client=tw-ob&tk=222746.330494&prev=input

not work. In the test sent for the tts the double quote is missing. Test:

https://translate.google.com/translate_tts?ie=UTF-8&q=%22Digite%20o%20seu%20numero%20de%20cliente%20assim%20eu%20posso%20lhe%20identificar.%22&tl=pt-BR&total=1&idx=0&textlen=62&client=tw-ob&tk=222746.330494&prev=input

use in extensions_custom.conf

exten => _.,n,agi(googletts.agi,"${variable}",pt)

janduy commented 6 years ago

@fabiosangiorgi

I understand, you want me to define the variable with the link and then I call it in my dialplan, correct?

I can validate yes, at the moment I'm on the cell phone, as soon as I'm home I'll test.

Regards, Janduy Euclides.

DorianMaliszewski commented 5 years ago

To solve this on RHEL 7 / CentOS 7 verify dependencies.

:100:

youchi99 commented 2 years ago

it works for me thank you

aruto99 commented 2 years ago

Hi, I have a problem with googletts.agi (Astereisk OpenWRT) Its simple dialplan. CLI logs -- Executing [1000@nasz-dialplan:1] Answer("PJSIP/1002-00000006", "") in new stack -- Executing [1000@nasz-dialplan:2] Wait("PJSIP/1002-00000006", "1") in new stack -- Executing [1000@nasz-dialplan:3] AGI("PJSIP/1002-00000006", "googletts.agi,"Witamy. Pierwszy test.",pl") in new stack -- Launched AGI Script /usr/share/asterisk/agi-bin/googletts.agi [Mar 9 11:17:02] ERROR[2860][C-00000006]: pbx_functions.c:651 ast_func_read2: Function CHANNEL not registered -- googletts.agi: Text passed for synthesis: Witamy. Pierwszy test. -- googletts.agi: Language: pl, Interrupt keys: , Sample rate: 8000 -- googletts.agi: Speed: 1, Caching: 1, Cache dir: /tmp -- googletts.agi: URL passed: https://translate.google.com/translate_tts?ie=UTF-8&q=Witamy.%20Pierwszy%20test.&tl=pl&total=1&idx=0&textlen=22&client=tw-ob&tk=870144.769515&prev=input -- googletts.agi: Failed to fetch file: -- googletts.agi: 501 -- googletts.agi: Protocol scheme 'https' is not supported (LWP::Protocol::https not installed) Died at /usr/share/asterisk/agi-bin/googletts.agi line 360, line 32. -- googletts.agi: Cleaning temp files. -- <PJSIP/1002-00000006>AGI Script googletts.agi completed, returning 0 -- Executing [1000@nasz-dialplan:4] Hangup("PJSIP/1002-00000006", "") in new stack == Spawn extension (nasz-dialplan, 1000, 4) exited non-zero on 'PJSIP/1002-00000006'

as we can see there is no LWP::Protocol::https. I looking on the net how can i install this packet but i nowhere find it maybe some one can help me.