<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Essa funciona so coloque sua chave:<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">#!/usr/bin/env perl</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">use warnings;</div><div class="">use strict;</div><div class="">use URI::Escape;</div><div class="">use File::Copy qw(move);</div><div class="">use File::Temp qw(tempfile);</div><div class="">use LWP::UserAgent;</div><div class="">use JSON;</div><div class="">use Encode qw(encode);</div><div class=""><br class=""></div><div class="">$| = 1;</div><div class=""><br class=""></div><div class=""># ----------------------------- #</div><div class=""># User defined parameters: #</div><div class=""># ----------------------------- #</div><div class=""># Speech API key #</div><div class="">my $key = sua chave do google";</div><div class=""><br class=""></div><div class=""># Default language #</div><div class="">my $language = "pt-BR";</div><div class=""><br class=""></div><div class=""># Default max silence timeout #</div><div class="">my $timeout = 2;</div><div class=""><br class=""></div><div class=""># Absolute Recording timeout #</div><div class="">my $abs_timeout = -1;</div><div class=""><br class=""></div><div class=""># Default interrupt key #</div><div class="">my $intkey = "#";</div><div class=""><br class=""></div><div class=""># Input audio sample rate #</div><div class=""># Leave blank to auto-detect #</div><div class="">my $samplerate = "";</div><div class=""><br class=""></div><div class=""># Profanity filter #</div><div class="">my $pro_filter = 0;</div><div class=""><br class=""></div><div class=""># Use speex #</div><div class="">my $use_speex = 0;</div><div class=""><br class=""></div><div class=""># Use SSL #</div><div class="">my $use_ssl = 1;</div><div class=""><br class=""></div><div class=""># Verbose debugging messages #</div><div class="">my $debug = 0;</div><div class=""><br class=""></div><div class=""># ----------------------------- #</div><div class=""><br class=""></div><div class="">my %AGI;</div><div class="">my $ua;</div><div class="">my $fh;</div><div class="">my $tmpname;</div><div class="">my $format;</div><div class="">my @result;</div><div class="">my $name;</div><div class="">my $audio;</div><div class="">my $uaresponse;</div><div class="">my %response;</div><div class="">my $endian;</div><div class="">my $url;</div><div class="">my $silence;</div><div class="">my $filetype;</div><div class="">my $flac;</div><div class="">my $speex;</div><div class="">my $results = 1;</div><div class="">my $grammar = "builtin:dictation"; #"builtin:search";</div><div class="">my $beep = "BEEP";</div><div class="">my $comp_level = -8;</div><div class="">my $ua_timeout = 10;</div><div class="">my $tmpdir = "/tmp";</div><div class="">my $host = "<a href="http://www.google.com/speech-api/v2/recognize" class="">www.google.com/speech-api/v2/recognize</a>";</div><div class=""><br class=""></div><div class=""># Store AGI input #</div><div class="">($AGI{arg_1}, $AGI{arg_2}, $AGI{arg_3}, $AGI{arg_4}) = @ARGV;</div><div class="">while (<STDIN>) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>chomp;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>last if (!length);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$AGI{$1} = $2 if (/^agi_(\w+)\:\s+(.*)$/);</div><div class="">}</div><div class=""><br class=""></div><div class="">$name = " -- $AGI{request}:";</div><div class=""><br class=""></div><div class=""># Reset variables. #</div><div class="">%response = (</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>utterance => -1,</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>confidence => -1,</div><div class="">);</div><div class="">warn "$name Clearing channel variables.\n" if ($debug);</div><div class="">foreach (keys %response) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "SET VARIABLE \"$_\" \"$response{$_}\"\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>checkresponse();</div><div class="">}</div><div class=""><br class=""></div><div class=""># Abort if key is missing or required programs not found. #</div><div class="">if (!$key) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "VERBOSE \"API key is missing. Aborting.\" 3\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>checkresponse();</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>die "$name API key is missing. Aborting.\n";</div><div class="">}</div><div class="">if ($use_speex) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$speex = `/usr/bin/which speexenc`;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>die "$name speexenc is missing. Aborting.\n" if (!$speex);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>chomp($speex);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>warn "$name Found speexenc in: $speex\n" if ($debug);</div><div class="">} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$flac = `/usr/bin/which flac`;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>die "$name flac is missing. Aborting.\n" if (!$flac);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>chomp($flac);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>warn "$name Found flac in: $flac\n" if ($debug);</div><div class="">}</div><div class=""><br class=""></div><div class=""># Setting language, timeout, interrupt keys and BEEP indication #</div><div class="">if (length($AGI{arg_1})) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$language = $AGI{arg_1} if ($AGI{arg_1} =~ /^[a-z]{2}(-[a-zA-Z]{2,6})?$/);</div><div class="">}</div><div class=""><br class=""></div><div class="">if (length($AGI{arg_2})) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if ($AGI{arg_2} == -1) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$silence = "";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>} elsif ($AGI{arg_2} =~ /^\d+$/) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$silence = "s=$AGI{arg_2}";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$silence = "s=$timeout";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$silence = "s=$timeout";</div><div class="">}</div><div class=""><br class=""></div><div class="">if (length($AGI{arg_3})) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$intkey = "0123456789#*" if ($AGI{arg_3} eq "any");</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$intkey = $AGI{arg_3} if ($AGI{arg_3} =~ /^[0-9*#]+$/);</div><div class="">}</div><div class=""><br class=""></div><div class="">if (length($AGI{arg_4})) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$beep = "" if ($AGI{arg_4} eq "NOBEEP");</div><div class="">}</div><div class=""><br class=""></div><div class=""># Answer channel if not already answered #</div><div class="">warn "$name Checking channel status.\n" if ($debug);</div><div class="">print "CHANNEL STATUS\n";</div><div class="">@result = checkresponse();</div><div class="">if ($result[0] == 4) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>warn "$name Answering channel.\n" if ($debug);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "ANSWER\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>@result = checkresponse();</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if ($result[0] != 0) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>die "$name Failed to answer channel.\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">}</div><div class=""><br class=""></div><div class=""># Setting recording file format according to sample rate. #</div><div class="">if (!$samplerate) { ($format, $samplerate) = detect_format(); }</div><div class="">elsif ($samplerate == 12000) { $format = "sln12"; }</div><div class="">elsif ($samplerate == 16000) { $format = "sln16"; }</div><div class="">elsif ($samplerate == 32000) { $format = "sln32"; }</div><div class="">elsif ($samplerate == 44100) { $format = "sln44"; }</div><div class="">elsif ($samplerate == 48000) { $format = "sln48"; }</div><div class="">else { ($format, $samplerate) = ("sln", 8000); }</div><div class=""><br class=""></div><div class=""># Initialise User angent #</div><div class="">if ($use_ssl) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$url = "https://" . $host;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$ua = LWP::UserAgent->new(ssl_opts => {verify_hostname => 1});</div><div class="">} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$url = "http://" . $host;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$ua = LWP::UserAgent->new;</div><div class="">}</div><div class="">$language = uri_escape($language);</div><div class="">$grammar = uri_escape($grammar);</div><div class="">$url .= "?key=$key&lang=$language&pfilter=$pro_filter&lm=$grammar&maxresults=$results";</div><div class="">$ua->agent("Asterisk AGI speeech recognition script");</div><div class="">$ua->env_proxy;</div><div class="">$ua->timeout($ua_timeout);</div><div class=""><br class=""></div><div class=""># Hnadle interrupts #</div><div class="">$SIG{'INT'} = \&int_handler;</div><div class="">$SIG{'HUP'} = \&int_handler;</div><div class=""><br class=""></div><div class=""># Record file #</div><div class="">($fh, $tmpname) = tempfile("stt_XXXXXX", DIR => $tmpdir, UNLINK => 1);</div><div class="">print "RECORD FILE $tmpname $format \"$intkey\" \"$abs_timeout\" $beep \"$silence\"\n";</div><div class="">@result = checkresponse();</div><div class="">die "$name Failed to record file, aborting...\n" if ($result[0] == -1);</div><div class=""><br class=""></div><div class="">if ($debug) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>warn "$name Recording Format: $format, Rate: $samplerate Hz, ",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"Encoding format: ", ($use_speex) ? "speex" : "flac", "\n",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"$name Languge: $language, SSL: ", ($use_ssl) ? "yes, " : "no, ",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"$silence, Interrupt keys: $intkey\n";</div><div class="">}</div><div class=""><br class=""></div><div class=""># Encode sound data #</div><div class="">if ($use_speex) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$filetype = "x-speex-with-header-byte";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$endian = (unpack("h*", pack("s", 1)) =~ /01/) ? "--be" : "--le";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span># Encode file to speex. #</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>system($speex, "--vbr", "--rate", $samplerate, "--headerbyte", "--quiet", $endian,</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"$tmpname.$format", "$tmpname.spx") == 0 or die "$name $speex failed: $?\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>open($fh, "<", "$tmpname.spx") or die "Can't read file: $!";</div><div class="">} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$filetype = "x-flac";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>$endian = (unpack("h*", pack("s", 1)) =~ /01/) ? "big" : "little";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span># Encode file to flac. #</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>system($flac, $comp_level, "--totally-silent", "--channels=1", "--endian=$endian",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"--sign=signed", "--bps=16", "--force-raw-format", "--sample-rate=$samplerate",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>"$tmpname.$format") == 0 or die "$name $flac failed: $?\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>open($fh, "<", "$tmpname.flac") or die "Can't read file: $!";</div><div class="">}</div><div class=""><br class=""></div><div class="">$audio = do { local $/; <$fh> };</div><div class="">close($fh);</div><div class=""><br class=""></div><div class=""># Send adio data for analysis #</div><div class="">$uaresponse = $ua->post(</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>"$url",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Content_Type => "audio/$filetype; rate=$samplerate",</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>Content => "$audio",</div><div class="">);</div><div class="">if (!$uaresponse->is_success) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "VERBOSE \"Unable to get recognition data.\" 3\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>checkresponse();</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>die "$name Unable to get recognition data.\n";</div><div class="">}</div><div class=""><br class=""></div><div class="">foreach (split(/\n/,$uaresponse->content)) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>my $jdata = decode_json($_);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>for ( $jdata->{result}[0]->{alternative}[0] ) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$response{utterance} = encode('utf8', $_->{transcript});</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$response{confidence} = $_->{confidence};</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">}</div><div class="">warn "$name The response was:\n", $uaresponse->content if ($debug);</div><div class=""><br class=""></div><div class="">foreach (keys %response) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>warn "$name Setting variable: $_ = $response{$_}\n" if ($debug);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "SET VARIABLE \"$_\" \"$response{$_}\"\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>checkresponse();</div><div class="">}</div><div class="">exit;</div><div class=""><br class=""></div><div class="">sub checkresponse {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>my $input = <STDIN>;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>my @values;</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>chomp $input;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if ($input =~ /^200 result=(-?\d+)\s?(.*)$/) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>warn "$name Command returned: $input\n" if ($debug);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>@values = ("$1", "$2");</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>} else {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>$input .= <STDIN> if ($input =~ /^520-Invalid/);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>warn "$name Unexpected result: $input\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>@values = (-1, -1);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>return @values;</div><div class="">}</div><div class=""><br class=""></div><div class="">sub detect_format {</div><div class=""># Detect the sound format used #</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>my @format;</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print "GET FULL VARIABLE \${CHANNEL(audionativeformat)}\n";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>my @reply = checkresponse();</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>for ($reply[1]) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>if (/(silk|sln)12/) { @format = ("sln12", 12000); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>elsif (/(speex|slin|silk)16|g722|siren7/) { @format = ("sln16", 16000); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>elsif (/(speex|slin|celt)32|siren14/) { @format = ("sln32", 32000); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>elsif (/(celt|slin)44/) { @format = ("sln44", 44100); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>elsif (/(celt|slin)48/) { @format = ("sln48", 48000); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>else { @format = ("sln", 8000); }</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>return @format;</div><div class="">}</div><div class=""><br class=""></div><div class="">sub int_handler {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>die "$name Interrupt signal received, terminating...\n";</div><div class="">}</div><div class=""><br class=""></div><div class="">END {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>if ($tmpname) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>warn "$name Cleaning temp files.\n" if ($debug);</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>unlink glob "$tmpname.*";</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">}</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal;" class=""><div style="line-height: normal;" class=""><div class=""><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Atenciosamente<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""> </span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Eng. Jose Antonio Sanchez<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Erimat Oeste Telecom<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="http://www.pbxerix.com.br" style="color: purple;" class="">www.pbxerix.com.br</a><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="http://www.virtualpbxip.com.br" style="color: purple;" class="">www.virtualpbxip.com.br</a><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="http://www.erimatoeste.com.br" style="color: purple;" class="">www.erimatoeste.com.br</a><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="mailto:jasanchez@terra.com.br" style="color: purple;" class="">jasanchez@terra.com.br</a><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">17-21393970 17-81437977<o:p class=""></o:p></span></div></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""> </span></div></div></div></div><span><img apple-inline="yes" id="6259C61D-8ABB-4664-9CCD-3A8A948C80AD" src="cid:97CE70A1-F8F4-410A-B75A-94F9B572205D@ERIMAT-OESTE" class=""></span>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Em 1 de fev de 2018, à(s) 14:44, Nuno Cunha <<a href="mailto:nuno.cunha@engdb.com.br" class="">nuno.cunha@engdb.com.br</a>> escreveu:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Olas,<div class=""><br class=""></div><div class=""> Também tentei: </div><div class=""><br class=""></div><div class=""><div class=""> p_channel.exec("Agi", "speech-recog.agi,pt-BR,2");</div></div><div class=""><br class=""></div><div class=""> com o mesmo resultado.</div><div class=""><br class=""></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" class=""><br class=""> <table style="border-top:1px solid #d3d4de" class="">
        <tbody class=""><tr class="">
<td style="width:55px;padding-top:18px" class=""><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" class=""><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" class=""></a></td>
                <td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px" class="">Livre de vírus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea" class="">www.avast.com</a>.                 </td>
        </tr>
</tbody></table>
<a href="x-msg://45/#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1" class=""></a></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">----</div><div class=""><table style="border-collapse:collapse;border-spacing:0px;background-color:transparent;color:rgb(102,102,102);font-family:Montserrat,sans-serif;font-size:13px;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><table style="border-collapse:collapse;border-spacing:0px;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/logo.png" style="border:0px;vertical-align:middle" class=""></td><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/element.png" style="border:0px;vertical-align:middle" class=""></td><td style="padding:0px" class=""><div style="color:rgb(196,0,75);font-size:14px;line-height:14px;font-weight:bold" class="">Nuno Correia dos Santos Cunha</div><br class=""><div style="font-size: 12px; line-height: 12px;" class="">Analista de sistemas</div><div style="font-size: 12px; line-height: 12px; font-weight: bold;" class="">Automação & Controle - Serviços Logann - T&T</div></td><td style="padding:0px" class=""> </td><td style="padding:0px" class=""><div style="color:rgb(0,47,85);font-weight:bold;font-size:12px;line-height:12px" class="">Office:</div><div style="color:rgb(0,47,85);font-weight:bold;font-size:12px;line-height:12px" class="">Skype:</div></td><td style="padding:0px" class=""> </td><td style="padding:0px" class=""><div style="font-size:12px;line-height:12px" class="">(31) 3211-7396</div><div style="font-size:12px;line-height:12px" class="">nuno.cunha.engdb</div></td></tr></tbody></table><table style="border-collapse:collapse;border-spacing:0px;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/element2.png" style="border:0px;vertical-align:middle" class=""></td></tr></tbody></table><table style="border-collapse:collapse;border-spacing:0px;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><a href="http://www.engdb.com.br/" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/eng-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.facebook.com/engdb/" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/face-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.linkedin.com/company-beta/27862?pathWildcard=27862" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/in-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.youtube.com/channel/UCEUvHtjrY3-kD1tFryzCJyA" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/youtube-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""> </td><td style="padding:0px" class="">Avenida Getúlio Vargas, nº 1.300, 9º e 10º andares | Belo Horizonte – MG | CEP 30112-021</td></tr></tbody></table></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div>
<br class=""><div class="gmail_quote">Em 1 de fevereiro de 2018 14:23, Renato Santos <span dir="ltr" class=""><<a href="mailto:renato473@gmail.com" target="_blank" class="">renato473@gmail.com</a>></span> escreveu:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div dir="auto" class="">Acho que está api foi descontinuada pois ela está na V1 e o Google usa a V3</div><br class=""><div class="gmail_quote"><div class=""><div class="h5"><div class="">Em qui, 1 de fev de 2018 às 13:11, Nuno Cunha <<a href="mailto:nuno.cunha@engdb.com.br" target="_blank" class="">nuno.cunha@engdb.com.br</a>> escreveu:<br class=""></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><div class="h5"><div class="">Ola,<div class=""><br class=""></div><div class=""> Em meu AGI (fastAGI, em java) tenho estas duas linhas:</div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><div class=""><font face="monospace, monospace" class=""> p_channel.exec("Playback", "Fale o endereço!");</font></div><div class=""><font face="monospace, monospace" class=""> p_channel.exec("Agi", "speech-recog.agi", "pt-BR");</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> O problema é que após ler a pergunta o tempo de fala parece estar sendo de zero segundos, mal começo a falar e já recebo a mensagem que o endereço não foi compreendido (que é a lógica logo a seguir a estas duas linhas).</div><div class=""><br class=""></div><div class=""> No script
<span style="color:rgb(34,34,34);font-family:monospace,monospace;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">speech-recog.agi tenho as configurações:</span></div><div class=""><span style="color:rgb(34,34,34);font-family:monospace,monospace;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><br class=""></span></div><div class=""><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class=""><font face="monospace, monospace" class=""><div class=""># ----------------------------- #</div><div class=""># User defined parameters: #</div><div class=""># ----------------------------- #</div><div class=""># Speech API key #</div><div class="">my $key = "minha chave...";</div><div class=""><br class=""></div><div class=""># Default language #</div><div class="">my $language = "pt-BR";</div><div class=""><br class=""></div><div class=""># Default max silence timeout #</div><div class="">my $timeout = 2;</div><div class=""><br class=""></div><div class=""># Absolute Recording timeout #</div><div class="">my $abs_timeout = -1;</div><div class=""><br class=""></div><div class=""># Default interrupt key #</div><div class="">my $intkey = "#";</div><div class=""><br class=""></div><div class=""># Input audio sample rate #</div><div class=""># Leave blank to auto-detect #</div><div class="">my $samplerate = "";</div><div class=""><br class=""></div><div class=""># Profanity filter #</div><div class="">my $pro_filter = "false";</div><div class=""><br class=""></div><div class=""># Verbose debugging messages #</div><div class="">my $debug = 0;</div><div class=""><br class=""></div><div class=""># ----------------------------- #</div></font></span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> Testei colocando explicitamente na chamada do agi do Google o tempo de timeout, como mostrado abaixo, mas não mudou o comportamento.</div><div class=""><br class=""></div><div class="">
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial" class=""> p_channel.exec("Playback", "Fale o endereço!");</div>
<div class=""> p_channel.exec("Agi", "speech-recog.agi", "
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline" class="">pt-BR</span>
", <font color="#ff0000" class="">"2"</font>);</div></div><div class=""><br class=""></div><div class=""> Alguma ideia de como ter mais tempo para falar o endereço?</div><div class=""><br class=""></div><div class="">Obrigado,</div><div class=""><br class=""></div><div class=""><div class="m_3515590836011688728m_-8075362843129180750gmail_signature"><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">----</div><div class=""><table style="border-collapse:collapse;background-color:transparent;color:rgb(102,102,102);font-family:Montserrat,sans-serif;font-size:13px;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><table style="border-collapse:collapse;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/logo.png" style="border:0px;vertical-align:middle" class=""></td><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/element.png" style="border:0px;vertical-align:middle" class=""></td><td style="padding:0px" class=""><div style="color:rgb(196,0,75);font-size:14px;line-height:14px;font-weight:bold" class="">Nuno Correia dos Santos Cunha</div><br class=""><div style="font-size: 12px; line-height: 12px;" class="">Analista de sistemas</div><div style="font-size: 12px; line-height: 12px; font-weight: bold;" class="">Automação & Controle - Serviços Logann - T&T</div></td><td style="padding:0px" class=""> <wbr class=""> </td><td style="padding:0px" class=""><div style="color:rgb(0,47,85);font-weight:bold;font-size:12px;line-height:12px" class="">Office:</div><div style="color:rgb(0,47,85);font-weight:bold;font-size:12px;line-height:12px" class="">Skype:</div></td><td style="padding:0px" class=""> </td><td style="padding:0px" class=""><div style="font-size:12px;line-height:12px" class="">(31) 3211-7396</div><div style="font-size:12px;line-height:12px" class="">nuno.cunha.engdb</div></td></tr></tbody></table><table style="border-collapse:collapse;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><img src="http://assinatura.engdb.com.br/img/element2.png" style="border:0px;vertical-align:middle" class=""></td></tr></tbody></table><table style="border-collapse:collapse;background-color:transparent;font-family:Montserrat,sans-serif;letter-spacing:0.1px" class=""><tbody class=""><tr class=""><td style="padding:0px" class=""><a href="http://www.engdb.com.br/" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/eng-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.facebook.com/engdb/" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/face-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.linkedin.com/company-beta/27862?pathWildcard=27862" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/in-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""><a href="https://www.youtube.com/channel/UCEUvHtjrY3-kD1tFryzCJyA" style="background-color:transparent;color:rgb(0,47,85)" target="_blank" class=""><img src="http://assinatura.engdb.com.br/img/youtube-icon.png" style="border:0px;vertical-align:middle" class=""></a></td><td style="padding:0px" class=""> </td><td style="padding:0px" class="">Avenida Getúlio Vargas, nº 1.300, 9º e 10º andares | Belo Horizonte – MG | CEP 30112-021</td></tr></tbody></table></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td><td style="padding:0px" class=""></td></tr></tbody></table></div></div></div></div></div></div></div></div></div></div>
</div></div><div id="m_3515590836011688728m_-8075362843129180750DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" class=""><br class=""> <table style="border-top:1px solid #d3d4de" class="">
        <tbody class=""><tr class="">
<td style="width:55px;padding-top:18px" class=""><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" class=""><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width:46px;height:29px" class=""></a></td>
                <td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px" class="">Livre de vírus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:#4453ea" target="_blank" class="">www.avast.com</a>.                 </td>
        </tr>
</tbody></table>
<a href="x-msg://45/#m_3515590836011688728_m_-8075362843129180750_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1" class=""></a></div></div></div>
______________________________<wbr class="">_________________<br class="">
KHOMP: completa linha de placas externas FXO, FXS, GSM e E1<br class="">
Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7<br class="">
Intercomunicador e acesso remoto via rede IP e telefones IP<br class="">
Conheça todo o portfólio em <a href="http://www.khomp.com/" rel="noreferrer" target="_blank" class="">www.Khomp.com</a><br class="">
______________________________<wbr class="">_________________<br class="">
Para remover seu email desta lista, basta enviar um email em branco para <a href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org" target="_blank" class="">asteriskbrasil-unsubscribe@<wbr class="">listas.asteriskbrasil.org</a></blockquote></div></div><span class="HOEnZb"><font color="#888888" class=""><div dir="ltr" class="">-- <br class=""></div><div class="m_3515590836011688728gmail_signature" data-smartmail="gmail_signature">Enviado do Gmail para celular</div>
</font></span><br class="">______________________________<wbr class="">_________________<br class="">
KHOMP: completa linha de placas externas FXO, FXS, GSM e E1<br class="">
Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7<br class="">
Intercomunicador e acesso remoto via rede IP e telefones IP<br class="">
Conheça todo o portfólio em <a href="http://www.khomp.com/" rel="noreferrer" target="_blank" class="">www.Khomp.com</a><br class="">
______________________________<wbr class="">_________________<br class="">
Para remover seu email desta lista, basta enviar um email em branco para <a href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org" class="">asteriskbrasil-unsubscribe@<wbr class="">listas.asteriskbrasil.org</a><br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">KHOMP: completa linha de placas externas FXO, FXS, GSM e E1<br class="">Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7<br class="">Intercomunicador e acesso remoto via rede IP e telefones IP<br class="">Conheça todo o portfólio em <a href="http://www.Khomp.com" class="">www.Khomp.com</a><br class="">_______________________________________________<br class="">Para remover seu email desta lista, basta enviar um email em branco para <a href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org" class="">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a></div></blockquote></div><br class=""></div></body></html>