<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="">Voce precisa ter o cadastro no google , precisa também se inscrever no grupo&nbsp;<span style="color: rgba(0, 0, 0, 0.85098); font-family: 'Helvetica Neue';" class="">chromium-dev</span><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="">&nbsp;</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="">&nbsp;</span></div></div></div></div><span><img apple-inline="yes" id="CC3FB3B4-7E89-48B8-B32E-1ABFA2FAEF45" 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) 15:26, Nuno Cunha &lt;<a href="mailto:nuno.cunha@engdb.com.br" class="">nuno.cunha@engdb.com.br</a>&gt; escreveu:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Ola José,<div class=""><br class=""></div><div class="">&nbsp; &nbsp;Mesmo comportamento!</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;Não vejo algum erro na chamada do google recognizer no CLI... apenas meu AGI pegando o valor da variável&nbsp;&nbsp;"<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="">confidence" (que deve ser = 0...) e o playback de endereço não compreendido.</span></div><div class=""><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=""><br class=""></span></div><div class=""><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="">&nbsp; &nbsp;Forcei uma chave errada e vi que não há informação sobre isto no debug do console do Asterisk...&nbsp;</span></div><div class=""><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=""><br class=""></span></div><div class=""><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="">&nbsp; Coloquei aqui o que saiu no CLI. Se tiver um tempo para dar uma olhada e ver se há algo estranho ai, agradeço demais.</span></div><div class=""><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=""><br class=""></span></div><div class=""><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="">Obrigado,</span></div><div class=""><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=""><br class=""></span></div><div class=""><br class=""></div><div class=""><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Rx &lt;&lt; EXEC "Playback" "PerguntarEnderecoOrigem"</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- AGI Script Executing Application: (Playback) Options: (PerguntarEnderecoOrigem)</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- &lt;PJSIP/6001-00000000&gt; Playing 'PerguntarEnderecoOrigem.gsm' (language 'en')</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; 200 result=0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Rx &lt;&lt; EXEC "Agi" "speech-recog.agi,pt-BR"</font><font face="monospace, monospace" class="">&nbsp; &nbsp; -- AGI Script Executing Application: (Agi) Options: (speech-recog.agi,pt-BR)</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- Launched AGI Script /var/lib/asterisk/agi-bin/speech-recog.agi</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_request: speech-recog.agi</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_channel: PJSIP/6001-00000000</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_language: en</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_type: PJSIP</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_uniqueid: 1517504895.0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_version: 13.19.0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_callerid: 6001</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_calleridname: Nuno</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_callingpres: 0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_callingani2: 0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_callington: 0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_callingtns: 0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_dnid: 100</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_rdnis: unknown</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_context: SolicitarEnderecosOrigemDestino</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_extension: s</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_priority: 2</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_enhanced: 0.0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_accountcode:</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_threadid: 139981899122432</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; agi_arg_1: pt-BR</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt;</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- &lt;PJSIP/6001-00000000&gt;AGI Script speech-recog.agi completed, returning 0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; 200 result=0</font></div><div class=""><span style="font-family:monospace,monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Rx &lt;&lt; GET VARIABLE "confidence"</span><br class=""></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; 200 result=0</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Rx &lt;&lt; EXEC "Playback" "AvisoDesculpeNaoCompreendiEndereco"</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- AGI Script Executing Application: (Playback) Options: (AvisoDesculpeNaoCompreendiEndereco)</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; -- &lt;PJSIP/6001-00000000&gt; Playing 'AvisoDesculpeNaoCompreendiEndereco.gsm' (language 'en')</font></div><div class=""><font face="monospace, monospace" class="">&lt;PJSIP/6001-00000000&gt;AGI Tx &gt;&gt; 200 result=0</font></div><div class=""><br class=""></div></div></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 &amp; Controle - Serviços Logann - T&amp;T</div></td><td style="padding:0px" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">2018-02-01 14:47 GMT-02:00 Jose <span dir="ltr" class="">&lt;<a href="mailto:jasanchez113@gmail.com" target="_blank" class="">jasanchez113@gmail.com</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" 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><span class=""><div class=""><br class=""></div><div class=""># ----------------------------- #</div><div class=""># &nbsp; User defined parameters: &nbsp; &nbsp;#</div><div class=""># ----------------------------- #</div><div class=""># Speech API key &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</div></span><div class="">my $key = sua chave do google";</div><span class=""><div class=""><br class=""></div><div class=""># Default language &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</div><div class="">my $language = "pt-BR";</div><div class=""><br class=""></div><div class=""># Default max silence timeout &nbsp; #</div><div class="">my $timeout = 2;</div><div class=""><br class=""></div><div class=""># Absolute Recording timeout &nbsp; &nbsp;#</div><div class="">my $abs_timeout = -1;</div><div class=""><br class=""></div><div class=""># Default interrupt key &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $intkey = "#";</div><div class=""><br class=""></div><div class=""># Input audio sample rate &nbsp; &nbsp; &nbsp; #</div><div class=""># Leave blank to auto-detect &nbsp; &nbsp;#</div><div class="">my $samplerate = "";</div><div class=""><br class=""></div><div class=""># Profanity filter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</div></span><div class="">my $pro_filter = 0;</div><div class=""><br class=""></div><div class=""># Use speex &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $use_speex = 0;</div><div class=""><br class=""></div><div class=""># Use SSL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $use_ssl = 1;</div><span class=""><div class=""><br class=""></div><div class=""># Verbose debugging messages &nbsp; &nbsp;#</div><div class="">my $debug = 0;</div><div class=""><br class=""></div><div class=""># ----------------------------- #</div><div class=""><br class=""></div></span><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 &nbsp; &nbsp;= 1;</div><div class="">my $grammar &nbsp; &nbsp;= "builtin:dictation"; #"builtin:search";</div><span class=""><div class="">my $beep &nbsp; &nbsp; &nbsp; = "BEEP";</div><div class="">my $comp_level = -8;</div></span><div class="">my $ua_timeout = 10;</div><div class="">my $tmpdir &nbsp; &nbsp; = "/tmp";</div><div class="">my $host &nbsp; &nbsp; &nbsp; = "<a href="http://www.google.com/speech-api/v2/recognize" target="_blank" class="">www.google.com/speech-api/v2/<wbr class="">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 (&lt;STDIN&gt;) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>chomp;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>last if (!length);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>utterance &nbsp;=&gt; -1,</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>confidence =&gt; -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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "SET VARIABLE \"$_\" \"$response{$_}\"\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "VERBOSE \"API key is missing. Aborting.\" 3\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>checkresponse();</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>die "$name API key is missing. Aborting.\n";</div><div class="">}</div><div class="">if ($use_speex) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$speex = `/usr/bin/which speexenc`;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>die "$name speexenc is missing. Aborting.\n" if (!$speex);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>chomp($speex);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>warn "$name Found speexenc in: $speex\n" if ($debug);</div><div class="">} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$flac = `/usr/bin/which flac`;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>die "$name flac is missing. Aborting.\n" if (!$flac);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>chomp($flac);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$language = $AGI{arg_1} if ($AGI{arg_1} =~ /^[a-z]{2}(-[a-zA-Z]{2,6})?$/)<wbr class="">;</div><div class="">}</div><div class=""><br class=""></div><div class="">if (length($AGI{arg_2})) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>if ($AGI{arg_2} == -1) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$silence = "";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>} elsif ($AGI{arg_2} =~ /^\d+$/) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$silence = "s=$AGI{arg_2}";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$silence = "s=$timeout";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class="">} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$intkey = "0123456789#*" if ($AGI{arg_3} eq "any");</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>warn "$name Answering channel.\n" if ($debug);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "ANSWER\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>@result = checkresponse();</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>if ($result[0] != 0) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>die "$name Failed to answer channel.\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class="">}</div><div class=""><br class=""></div><div class=""># Setting recording file format according to sample rate. #</div><div class="">if &nbsp; &nbsp;(!$samplerate) &nbsp; &nbsp; &nbsp; &nbsp; { ($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 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { ($format, $samplerate) = &nbsp;("sln", 8000); }</div><div class=""><br class=""></div><div class=""># Initialise User angent #</div><div class="">if ($use_ssl) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$url = "https://" . $host;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$ua &nbsp;= LWP::UserAgent-&gt;new(ssl_opts =&gt; {verify_hostname =&gt; 1});</div><div class="">} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$url = "http://" . $host;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$ua &nbsp;= LWP::UserAgent-&gt;new;</div><div class="">}</div><div class="">$language = uri_escape($language);</div><div class="">$grammar &nbsp;= uri_escape($grammar);</div><div class="">$url .= "?key=$key&amp;lang=$language&amp;<wbr class="">pfilter=$pro_filter&amp;lm=$<wbr class="">grammar&amp;maxresults=$results";</div><div class="">$ua-&gt;agent("Asterisk AGI speeech recognition script");</div><div class="">$ua-&gt;env_proxy;</div><div class="">$ua-&gt;timeout($ua_timeout);</div><div class=""><br class=""></div><div class=""># Hnadle interrupts #</div><div class="">$SIG{'INT'} = \&amp;int_handler;</div><div class="">$SIG{'HUP'} = \&amp;int_handler;</div><div class=""><br class=""></div><div class=""># Record file #</div><div class="">($fh, $tmpname) = tempfile("stt_XXXXXX", DIR =&gt; $tmpdir, UNLINK =&gt; 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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>warn "$name Recording Format: $format, Rate: $samplerate Hz, ",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>"Encoding format: ", ($use_speex) ? "speex" : "flac", "\n",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>"$name Languge: $language, SSL: ", ($use_ssl) ? "yes, " : "no, ",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$filetype = "x-speex-with-header-byte";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$endian = (unpack("h*", pack("s", 1)) =~ /01/) ? "--be" : "--le";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span># Encode file to speex. #</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>system($speex, "--vbr", "--rate", $samplerate, "--headerbyte", "--quiet", $endian,</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>"$tmpname.$format", "$tmpname.spx") == 0 or die "$name $speex failed: $?\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>open($fh, "&lt;", "$tmpname.spx") or die "Can't read file: $!";</div><div class="">} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$filetype = "x-flac";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>$endian = (unpack("h*", pack("s", 1)) =~ /01/) ? "big" : "little";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span># Encode file to flac. #</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>system($flac, $comp_level, "--totally-silent", "--channels=1", "--endian=$endian",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>"--sign=signed", "--bps=16", "--force-raw-format", "--sample-rate=$samplerate",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>"$tmpname.$format") == 0 or die "$name $flac failed: $?\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>open($fh, "&lt;", "$tmpname.flac") or die "Can't read file: $!";</div><div class="">}</div><div class=""><br class=""></div><div class="">$audio = do { local $/; &lt;$fh&gt; };</div><div class="">close($fh);</div><div class=""><br class=""></div><div class=""># Send adio data for analysis #</div><div class="">$uaresponse = $ua-&gt;post(</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>"$url",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>Content_Type =&gt; "audio/$filetype; rate=$samplerate",</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>Content &nbsp; &nbsp; &nbsp;=&gt; "$audio",</div><div class="">);</div><div class="">if (!$uaresponse-&gt;is_success) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "VERBOSE \"Unable to get recognition data.\" 3\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>checkresponse();</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>die "$name Unable to get recognition data.\n";</div><div class="">}</div><div class=""><br class=""></div><div class="">foreach (split(/\n/,$uaresponse-&gt;<wbr class="">content)) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>my $jdata = decode_json($_);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>for ( $jdata-&gt;{result}[0]-&gt;{<wbr class="">alternative}[0] ) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$response{utterance} &nbsp;= encode('utf8', $_-&gt;{transcript});</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$response{confidence} = $_-&gt;{confidence};</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class="">}</div><div class="">warn "$name The response was:\n", $uaresponse-&gt;content if ($debug);</div><div class=""><br class=""></div><div class="">foreach (keys %response) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>warn "$name Setting variable: $_ = $response{$_}\n" if ($debug);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "SET VARIABLE \"$_\" \"$response{$_}\"\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>checkresponse();</div><div class="">}</div><div class="">exit;</div><div class=""><br class=""></div><div class="">sub checkresponse {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>my $input = &lt;STDIN&gt;;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>my @values;</div><div class=""><br class=""></div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>chomp $input;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>if ($input =~ /^200 result=(-?\d+)\s?(.*)$/) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>warn "$name Command returned: $input\n" if ($debug);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>@values = ("$1", "$2");</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>} else {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>$input .= &lt;STDIN&gt; if ($input =~ /^520-Invalid/);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>warn "$name Unexpected result: $input\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>@values = (-1, -1);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>my @format;</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>print "GET FULL VARIABLE \${CHANNEL(audionativeformat)}<wbr class="">\n";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>my @reply = checkresponse();</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>for ($reply[1]) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>if &nbsp; &nbsp;(/(silk|sln)12/) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ @format = ("sln12", 12000); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>elsif (/(speex|slin|silk)16|g722|<wbr class="">siren7/) { @format = ("sln16", 16000); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>elsif (/(speex|slin|celt)32|siren14/<wbr class="">) &nbsp; &nbsp; { @format = ("sln32", 32000); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>elsif (/(celt|slin)44/) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { @format = ("sln44", 44100); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>elsif (/(celt|slin)48/) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { @format = ("sln48", 48000); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ @format = ("sln", &nbsp; &nbsp;8000); }</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>return @format;</div><div class="">}</div><div class=""><br class=""></div><div class="">sub int_handler {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </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="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>if ($tmpname) {</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>warn "$name Cleaning temp files.\n" if ($debug);</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">                </span>unlink glob "$tmpname.*";</div><div class=""><span class="m_-955535683590563047Apple-tab-span" style="white-space:pre-wrap">        </span>}</div><div class="">}</div><div class=""><br class=""></div><div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-variant-ligatures: 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<u class=""></u><u class=""></u></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="">&nbsp;</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<u class=""></u><u class=""></u></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<u class=""></u><u class=""></u></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" target="_blank" class="">www.pbxerix.com.br</a><u class=""></u><u class=""></u></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" target="_blank" class="">www.virtualpbxip.com.br</a><u class=""></u><u class=""></u></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" target="_blank" class="">www.erimatoeste.com.br</a><u class=""></u><u class=""></u></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" target="_blank" class="">jasanchez@terra.com.br</a><u class=""></u><u class=""></u></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<u class=""></u><u class=""></u></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="">&nbsp;</span></div></div></div></div><span class=""><span id="cid:97CE70A1-F8F4-410A-B75A-94F9B572205D@ERIMAT-OESTE">&lt;logo.erix.teste.fw.png&gt;</span></span>
</div><div class=""><div class="h5">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">Em 1 de fev de 2018, à(s) 14:44, Nuno Cunha &lt;<a href="mailto:nuno.cunha@engdb.com.br" target="_blank" class="">nuno.cunha@engdb.com.br</a>&gt; escreveu:</div><br class="m_-955535683590563047Apple-interchange-newline"><div class=""><div dir="ltr" class="">Olas,<div class=""><br class=""></div><div class="">&nbsp; Também tentei:&nbsp;</div><div class=""><br class=""></div><div class=""><div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p_channel.exec("Agi", "speech-recog.agi,pt-BR,2");</div></div><div class=""><br class=""></div><div class="">&nbsp; com o mesmo resultado.</div><div class=""><br class=""></div></div><div id="m_-955535683590563047DAB4FAD8-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&amp;utm_source=link&amp;utm_campaign=sig-email&amp;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&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail" style="color:#4453ea" target="_blank" class="">www.avast.com</a>.                 </td>
        </tr>
</tbody></table>
<a width="1" height="1" class=""></a></div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="m_-955535683590563047gmail_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 &amp; Controle - Serviços Logann - T&amp;T</div></td><td style="padding:0px" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<wbr class="">&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="">&lt;<a href="mailto:renato473@gmail.com" target="_blank" class="">renato473@gmail.com</a>&gt;</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="m_-955535683590563047h5"><div class="">Em qui, 1 de fev de 2018 às 13:11, Nuno Cunha &lt;<a href="mailto:nuno.cunha@engdb.com.br" target="_blank" class="">nuno.cunha@engdb.com.br</a>&gt; 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="m_-955535683590563047h5"><div class="">Ola,<div class=""><br class=""></div><div class="">&nbsp; 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="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p_channel.exec("Playback", "Fale o endereço!");</font></div><div class=""><font face="monospace, monospace" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p_channel.exec("Agi", "speech-recog.agi", "pt-BR");</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">&nbsp; 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="">&nbsp; No script&nbsp;&nbsp;

<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="">#&nbsp; &nbsp;User defined parameters:&nbsp; &nbsp; #</div><div class=""># ----------------------------- #</div><div class=""># Speech API key&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $key = "minha chave...";</div><div class=""><br class=""></div><div class=""># Default language&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $language = "pt-BR";</div><div class=""><br class=""></div><div class=""># Default max silence timeout&nbsp; &nbsp;#</div><div class="">my $timeout = 2;</div><div class=""><br class=""></div><div class=""># Absolute Recording timeout&nbsp; &nbsp; #</div><div class="">my $abs_timeout = -1;</div><div class=""><br class=""></div><div class=""># Default interrupt key&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#</div><div class="">my $intkey = "#";</div><div class=""><br class=""></div><div class=""># Input audio sample rate&nbsp; &nbsp; &nbsp; &nbsp;#</div><div class=""># Leave blank to auto-detect&nbsp; &nbsp; #</div><div class="">my $samplerate = "";</div><div class=""><br class=""></div><div class=""># Profanity filter&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #</div><div class="">my $pro_filter = "false";</div><div class=""><br class=""></div><div class=""># Verbose debugging messages&nbsp; &nbsp; #</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="">&nbsp; 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="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p_channel.exec("Playback", "Fale o endereço!");</div>

<div class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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="">&nbsp; 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_-955535683590563047m_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 &amp; Controle - Serviços Logann - T&amp;T</div></td><td style="padding:0px" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<wbr class="">&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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_-955535683590563047m_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&amp;utm_source=link&amp;utm_campaign=sig-email&amp;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&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail" style="color:#4453ea" target="_blank" class="">www.avast.com</a>.                 </td>
        </tr>
</tbody></table>
<a 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@lis<wbr class="">tas.asteriskbrasil.org</a></blockquote></div></div><span class="m_-955535683590563047HOEnZb"><font color="#888888" class=""><div dir="ltr" class="">-- <br class=""></div><div class="m_-955535683590563047m_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" target="_blank" class="">asteriskbrasil-unsubscribe@lis<wbr class="">tas.asteriskbrasil.org</a><br class=""></blockquote></div><br class=""></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/" 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></div></blockquote></div><br class=""></div></div></div></div><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=""></body></html>