<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="IncrediMail 1.0" name=GENERATOR>
<STYLE>v\:* {
        BEHAVIOR: url (#default#vml)
}
</STYLE>
<style>v\:* {
        BEHAVIOR: url (#default#vml)
}
</style>
<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>B433CDFE-B71C-42C2-A5C1-D34C076A9851</X-FID>
<X-FVER></X-FVER>
<X-FIT></X-FIT>
<X-FILE></X-FILE>
<X-FCOL></X-FCOL>
<X-FCAT></X-FCAT>
<X-FDIS></X-FDIS>
<X-Extensions></X-Extensions>
<X-BG>cid:556BE069-4E46-4E56-94D4-2374939F495B</X-BG>
<X-BGT>no-repeat</X-BGT>
<X-BGC>#ffffff</X-BGC>
<X-BGPX>right</X-BGPX>
<X-BGPY>bottom</X-BGPY>
<X-ASN>7A42E450-357F-11D4-BA31-0050DAC68030</X-ASN>
<X-ASNF>0</X-ASNF>
<X-ASH>BCEB29C0-42D3-11D4-BA3E-0050DAC68030</X-ASH>
<X-ASHF>1</X-ASHF>
<X-AN>EE860250-5330-11D4-BA52-0050DAC68030</X-AN>
<X-ANF>0</X-ANF>
<X-AP>EE860250-5330-11D4-BA52-0050DAC68030</X-AP>
<X-APF>1</X-APF>
<X-AD>601231A0-325F-11D4-BA2D-0050DAC68030</X-AD>
<X-ADF>0</X-ADF>
<X-AUTO>X-ASN,X-ASH,X-AN,X-AP,X-AD</X-AUTO>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY style="BACKGROUND-POSITION: right bottom; FONT-SIZE: 12pt; MARGIN: 0px 150px 10px 10px; COLOR: #1c3966; BACKGROUND-REPEAT: no-repeat; FONT-FAMILY: Verdana" text=#1c3966 bgProperties=fixed bgColor=#ffffff background=cid:556BE069-4E46-4E56-94D4-2374939F495B scroll=yes INCREDIFIXEDFORIMOL="true" SIGCOLOR="11031552">
<TABLE id=INCREDIMAINTABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD id=INCREDITEXTREGION dir=ltr style="FONT-SIZE: 12pt; DIRECTION: ltr" vAlign=top width="100%">
<DIV>Seria interessante pega o hábito de pesquisar na lista né? ;)&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Mas tudo bem, aí vai um exemplo de callback que eu mesmo postei na semana passada.... rsrs</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>==========================================================</DIV>
<DIV>==========================================================</DIV>
<DIV><FONT face=Courier>&lt;html&gt;<BR>&lt;head&gt;<BR>&lt;title&gt;Clique para Falar - NGN Soluções WebCall&lt;/title&gt;<BR>&lt;/head&gt;<BR>&lt;body&gt;<BR>&lt;?<BR>#Click-To-Call script NGN-Billing (<A href="http://www.ngnsolucoes.com.br">www.ngnsolucoes.com.br</A>)</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><BR><FONT face=Courier>#------------------------------------------------------------------------------------------<BR>#edite as variáveis para refletir com o seu sistema<BR>#------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#informe o endereço ip do seu asterisk<BR><BR>$strHost = "127.0.0.1";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#especifique o usuario que ira conectar ao&nbsp;CLI&nbsp;(deve estar definido em&nbsp;/etc/asterisk/manager.conf)<BR>$strUser = "admin";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#senha para o usuario acima<BR>$strSecret = "adminpass";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#especifique o canal&nbsp;(extension) que vc deseja receber estas ligações<BR>#exemplo: SIP/XXX, IAX2/XXXX, ZAP/XXXX, <BR>$strChannel = "SIP/".$_POST['txtOrigem'];</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#informe o contexto que irá processar a ligação&nbsp;para PSTN<BR>$strContext = "web-to-pstn";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#especifique a prioridade do contexto acima</FONT></DIV>
<DIV><FONT face=Courier>$strPriority = "1";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#especifique a quantidade de tentativas</FONT></DIV>
<DIV><FONT face=Courier>$strMaxRetry = "2";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#--------------------------------------------------------------------------------------------<BR>#Não precisa editar mais nada a partir daqui para fazer esse script funfar<BR>#--------------------------------------------------------------------------------------------<BR>#obtem o número a ser discado<BR>$strExten = $_POST['txtDestino'];</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>#especifica um callerid para a ligação<BR>$strCallerId = "WebCall de &lt;".$_POST['txtOrigem']."&gt;";</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>$length = len($strExten);</FONT></DIV>
<DIV><FONT face=Courier>&nbsp;</FONT></DIV>
<DIV><FONT face=Courier>if ($length == 11 &amp;&amp;&nbsp; id_number($_POST['txtDestino'])){</FONT></DIV>
<DIV><FONT face=Courier>$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Erro na conexão com o Servidor!");<BR>fputs($oSocket, "Action: login\r\n");<BR>fputs($oSocket, "Events: off\r\n");<BR>fputs($oSocket, "Username: $strUser\r\n");<BR>fputs($oSocket, "Secret: $strSecret\r\n\r\n");<BR>fputs($oSocket, "Action: originate\r\n");<BR>fputs($oSocket, "Channel: $strChannel\r\n");<BR>fputs($oSocket, "CallerId: $strCallerId\r\n");<BR>fputs($oSocket, "Exten: $strExten\r\n");<BR>fputs($oSocket, "Context: $strContext\r\n");<BR>fputs($oSocket, "Priority: $strPriority\r\n\r\n");<BR>fputs($oSocket, "Action: Logoff\r\n\r\n");<BR>$wrtes = fgets($oSocket, 2048);<BR>echo $wrtes."&lt;br /&gt;";<BR>fclose($oSocket);<BR>&nbsp;&nbsp;&nbsp; ?&gt;<BR>&lt;p&gt;<BR>&lt;table width="300" border="1" bordercolor="#630000" cellpadding="3" cellspacing="0"&gt;<BR>&nbsp;&lt;tr&gt;&lt;td&gt;<BR>&nbsp;&lt;font size="2" face="verdana,georgia" color="#630000"&gt;Estamos tentando fazer a ligação.&lt;br&gt;Aguarde alguns instantes...&lt;br&gt;&lt;a href="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;"&gt;Ligar novamente&lt;/a&gt;&lt;/font&gt;<BR>&nbsp;&lt;/td&gt;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;/p&gt;<BR>&lt;?<BR>}<BR>else<BR>{<BR>?&gt;<BR>&lt;p&gt;<BR>&lt;table width="300" border="1" bordercolor="#630000" cellpadding="3" cellspacing="0"&gt;<BR>&nbsp;&lt;tr&gt;&lt;td&gt;<BR>&nbsp;&lt;font size="2" face="verdana,arial,georgia" color="#630000"&gt;Número de telefone a ser discado (0(XX)XXXX-XXXX)!&lt;/font&gt;<BR>&nbsp;&lt;form action="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;" method="post"&gt;<BR>&nbsp;&nbsp;Ramal&lt;input type="text" size="20" name="txtOrigem"&gt;&lt;br&gt;<BR>&nbsp;&nbsp;Destino&lt;input type="text" size="20" name="txtDestino"&gt;&lt;br&gt;<BR>&nbsp;&nbsp;&lt;input type="submit" value="Iniciar ligação"&gt;<BR>&nbsp;&lt;/form&gt;<BR>&nbsp;&lt;/td&gt;&lt;/tr&gt;<BR>&lt;/table&gt;<BR>&lt;/p&gt;<BR>&lt;?<BR>}<BR>?&gt;<BR>&lt;/body&gt;<BR>&lt;/html&gt;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>=======================================================================</DIV>
<DIV>&nbsp;</DIV>
<DIV>Att,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Fernando da Silva Santos</DIV>
<DIV>NGN Soluções - <A title=http://www.ngnsolucoes.com.br/ href="http://www.ngnsolucoes.com.br/">www.ngnsolucoes.com.br</A></DIV>
<DIV>MSN/E-Mail: <A title=mailto:noc@ngnsolucoes.com.br href="mailto:noc@ngnsolucoes.com.br">noc@ngnsolucoes.com.br</A><BR></DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV id=IncrediOriginalMessage dir=ltr><I>-------Mensagem original-------</I></DIV>
<DIV>&nbsp;</DIV>
<DIV id=receivestrings>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>De:</B></I> <A href="mailto:rodrigo.lang@atto.com.br">ATTO - Rodrigo</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Data:</B></I> 06/01/09 13:47:51</DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Para:</B></I> <A href="mailto:asteriskbrasil@listas.asteriskbrasil.org">Asterisk Brasil</A></DIV>
<DIV dir=ltr style="FONT-SIZE: 11pt"><I><B>Assunto:</B></I> [AsteriskBrasil] Callback com o Asterisk</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>Boa tarde lista,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Gostaria de saber se o Asterisk consegue fazer a facilidade de callback.</DIV>
<DIV>Imagino que sim... Alguém já se deparou com essa situação?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Agradeço desde já,</DIV>
<DIV>Rodrigo Lang.</DIV>
<DIV>&nbsp;</DIV>
<DIV>--</DIV>
<DIV>Rodrigo Lang</DIV>
<DIV>Dpto Técnico</DIV>
<DIV>ATTO TELEINFORMÁTICA</DIV>
<DIV>End.: Rua Castro Alves, 624</DIV>
<DIV>80.240-270 - Curitiba - PR</DIV>
<DIV>Fones: (41) 33128000</DIV>
<DIV>Fax: (41) 33128001</DIV>
<DIV>Email: <A href="mailto:rodrigo.lang@atto.com.br">rodrigo.lang@atto.com.br</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>_______________________________________________</DIV>
<DIV>Openmoko Freerunner, primeiro telefone open source, disponível no Brasil rodando o Android da Google.</DIV>
<DIV><A href="http://www.neodroid.com">http://www.neodroid.com</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>Compre uma camiseta da AsteriskBrasil.org!</DIV>
<DIV><A href="http://www.voipmania.com.br">http://www.voipmania.com.br</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>Acesse o canal IRC de discussão sobre Asterisk em Português Brasileiro na rede Freenode.net: #asterisk-br</DIV>
<DIV>_______________________________________________</DIV>
<DIV>Lista de discussões AsteriskBrasil.org</DIV>
<DIV><A href="mailto:AsteriskBrasil@listas.asteriskbrasil.org">AsteriskBrasil@listas.asteriskbrasil.org</A></DIV>
<DIV><A href="http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil">http://listas.asteriskbrasil.org/mailman/listinfo/asteriskbrasil</A></DIV></TD></TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="100%"></TD>
<TD id=INCREDISOUND vAlign=bottom align=middle></TD>
<TD id=INCREDIANIM vAlign=bottom align=middle></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>