<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext">Tenta assim..</span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext"><br></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext"><br></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext">#!/usr/bin/php<u></u><u></u></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext"><?php<u></u><u></u></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext"><br></span></p>
<p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span lang="EN-US" style="font-size:11pt;font-family:Arial,sans-serif"><font color="#ff0000">require_once("phpagi.php");</font><font color="rgba(0, 0, 0, 0)"><u></u><u></u></font></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt">$AGI = new AGI();</span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt">$Arg1 = $AGI->get_variable("UNIQUEID")</span><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt">;</span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Arial,sans-serif;font-size:11pt"><font color="#ff0000">$abre_log = fopen("/dados/teste_log",'a');</font></span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Arial,sans-serif;font-size:11pt"><font color="#ff0000">$log = $Arg1['data'] ."teste";</font></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt">fwrite($abre_log, $log);</span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt"><br></span></p><p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:windowtext;font-family:Arial,sans-serif;font-size:11pt">fclose($abre_log);</span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-size:11pt;font-family:Arial,sans-serif;color:windowtext">?></span></p><br>
<div class="gmail_quote">Em 4 de julho de 2012 11:32, Danilo Almeida <span dir="ltr"><<a href="mailto:danilo.almeida@g1telecom.com.br" target="_blank">danilo.almeida@g1telecom.com.br</a>></span> escreveu:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="white" background="cid:image001.gif@01CD59D8.0CFB82B0" lang="PT-BR" link="#3366FF" vlink="#9900FF">
<img src="cid:image001.gif@01CD59D8.0CFB82B0" width="0" height="0" style="width:0;min-height:0">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">Olá galera, estava com uma dúvidas a alguns dias sobre AGI,
estou retomando meu projeto e conseqüentemente minhas dúvidas<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">Quando finalizo uma ligação, mando ela para macro hangupcall,
segue abaixo<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">[macro-hangupcall]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => s,1,Agi(/usr/local/g1telecom/calc_lig.php)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => s,2,Wait(2)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => s,3,NoCDR()<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => s,4,Hangup()<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => h,1,Agi(/usr/local/g1telecom/calc_lig.php)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => h,2,Wait(2)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => h,3,Hangup()<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => t,1,Agi(/usr/local/g1telecom/calc_lig.php)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">exten => t,2,Hangup()<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">nessa macro, ao finalizar a chamada pretendo trabalhá-la
posteriormente para fazer o calculo da ligação com AGI. Como podem ver mando
ela para um arquivo.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">No LOG da AGI no CLI aparece o seguinte...<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">-- Launched AGI Script /usr/local/g1telecom/calc_lig.php<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_request: /usr/local/g1telecom/calc_lig.php<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_channel: Local/1003@contexto-transferencia-7e61;2<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_language: en<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_type: Local<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_uniqueid: 1341411309.2240<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_version: 1.6.2.20<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_callerid: <a href="tel:4340529025" value="+554340529025" target="_blank">4340529025</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_calleridname: tronco2<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_callingpres: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_callingani2: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_callington: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_callingtns: 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_dnid: unknown<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_rdnis: unknown<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_context: macro-hangupcall<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_extension: s<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_priority: 2<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_enhanced: 0.0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_accountcode: TRANSFER<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>> agi_threadid: 45775760<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><Local/1003@contexto-transferencia-7e61;2>AGI Tx
>><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"> -- <Local/1003@contexto-transferencia-7e61;2>AGI
Script /usr/local/g1telecom/calc_lig.php completed, returning 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"> -- Executing [s@macro-hangupcall:3]
NoCDR("Local/1003@contexto-transferencia-7e61;2", "") in
new stack<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"> -- Executing [s@macro-hangupcall:4]
Hangup("Local/1003@contexto-transferencia-7e61;2", "") in
new stack<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">Ou seja, esta passando as variáveis para o arquivo em
questão. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">Abaixo segue meu arquivo.php<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">#!/usr/bin/php<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><?php<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">require_once(phpagi.php);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">//quire_once(/dados/g1box/teste.php);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">$AGI = new AGI();<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">$Arg1 = $AGI->get_variable("UNIQUEID");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">//$Arg2 = $AGI->get_variable("CALLERID(num)");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">//$Arg3 = $AGI->get_variable("EXTEN");<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">$abre_log = fopen("/dados/teste_log");<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">$log = $Arg1."teste";<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">@fwrite($abre_log, $log);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">@fclose($abre_log);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">?><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">A questão é, estou errando onde que não consigo gravar o log
no arquivo teste_log?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext">Agradeço desde já a todos<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:windowtext"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Tahoma","sans-serif";color:#000066">att<u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Tahoma","sans-serif";color:#000066"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Tahoma","sans-serif";color:#000066">Danilo Ricardo de Almeida</span></b><b><span style="font-family:"Tahoma","sans-serif";color:#000066"><u></u><u></u></span></b></p>
</div>
</div>
<br>_______________________________________________<br>
KHOMP Inovação: External Board Series<br>
Módulos de 1/2 rack e 1U para todas as interfaces e soluções Asterisk e FreeSWITCH.<br>
Tenha a External Series Experience na sua aplicação. Visite <a href="http://www.khomp.com" target="_blank">www.khomp.com</a><br>
_______________________________________________<br>
DIGIVOICE Fabricante de Placas de Voz e Channel Bank<br>
20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM<br>
Centro Treinamento - Curso de PABX IP - Asterisk - Site <a href="http://www.digivoice.com.br" target="_blank">www.digivoice.com.br</a><br>
________<br>
YEALINK: Telefones IP e VídeoPhones IP com o melhor custo/benefício do mercado.<br>
email: <a href="mailto:yealink@commlogik.com.br">yealink@commlogik.com.br</a> | <a href="http://www.commlogik.com.br" target="_blank">www.commlogik.com.br</a> | <a href="tel:%2811%29%205503-1011" value="+551155031011">(11) 5503-1011</a><br>
______________________________________________<br>
Para remover seu email desta lista, basta enviar um email em branco para <a href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a><br></blockquote></div>
<br><br clear="all"><div><br></div>-- <br>--<br>Roger Pitigliani<br>
<a href="mailto:rogerwinter@gmail.com" target="_blank">rogerwinter@gmail.com</a><br>
Skype: roger.pitigliani<br>
<br>