<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EstiloDeEmail17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:888105965;
        mso-list-type:hybrid;
        mso-list-template-ids:140641902 773904010 68550681 68550683 68550671 68550681 68550683 68550671 68550681 68550683;}
@list l0:level1
        {mso-level-text:%1-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:20.25pt;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Luiz existe sim uma aplicação de callback, foi criado por Ricardo para versão asterisk 1.2 e 1.4<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Outra forma de fazer isso seria no extensions.conf utilizando um arquivo .call<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Segue exemplo passo a passo:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Para teste você pode tirar toda essa parte de banco e identificação.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>1-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Recebimento da chamada, (no meu caso eu so permito callback dos números cadastrados e descarto o resto.)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><span style='font-size:9.0pt;font-family:"Courier New"'>[khomp-01-03]<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>;;;Atende Celular Vivo 9153XXXX<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,1,Set(ip_banco=127.0.0.1)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,Set(usuario=asteriskuser)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,Set(senha=senha) <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,Set(banco=asteriskcdrdb)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,NoOp(${CALLERID(name)})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,Set(consulta= select\ callback\, x.telefone\  from\ agenda a\, agendaux x\ where\ a.codigo =\ x.codage\ and\ a.callback=\ 1\ and\ x.telefone like \'%\${CALLERID(num):2}\'\)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n(consulta),MYSQL(Connect connid ${ip_banco} ${usuario} ${senha} ${banco})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,MYSQL(Query resultid ${connid} ${consulta})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,MYSQL(Fetch fetchid ${resultid} callback\ nrtelefone)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,NoOp(Status da busca ${callback})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,GotoIf($[&quot;${callback}&quot; = &quot;1&quot;]?40:51)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,40,NoOp(Realizando callback para ${CALLERID(num)})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,41,system(cp /etc/callback/callback.call /etc/callback/callback.tmp.call)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,42,agi(identifica.php|${nrtelefone})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,43,system(echo 'Channel: khomp/G${retorno}/${nrtelefone:2}' &gt;&gt; /etc/callback/callback.tmp.call) ******  aqui você coloco o tronco de saída)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,44,system(echo 'CallerID: ${nrtelefone:2} &quot;&lt;&quot;${nrtelefone}&quot;&gt;&quot;' &gt;&gt; /etc/callback/callback.tmp.call) ****** idetificacao  do telefone destino<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,45,system(echo 'Extension: ${nrtelefone}' &gt;&gt; /etc/callback/callback.tmp.call)  ***** telefone destino<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,46,system(mv /etc/callback/callback.tmp.call /etc/asterisk/${nrtelefone}.call)    ***** move o arquivo para pasta callback<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,47,System(bash /etc/asterisk/callback.sh ${nrtelefone})  ***** muda data de criação e move para pasta outgoing do asterisk<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,48,MYSQL(Clear ${resultid})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,49,MYSQL(Disconnect ${connid})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,50,Hangup()<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,51,NoOp(Desligando chamada)   ***** senão esta cadastrado rejeita.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,52,MYSQL(Clear ${resultid})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,53,MYSQL(Disconnect ${connid})<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     ;exten =&gt; s,n,Dial(IAX2/SAP2-TRUNK/8000,90,Tt)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>     exten =&gt; s,n,Hangup()<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>2-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Context Callback<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>[callback]<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; s,1,Answer<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; s,n,BackGround(OpCallBack)    ***** URA<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; s,n,hangup()<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 1,1,Dial(destino 1)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 2,1,Dial(destino 2)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 3,1,Dial(destino 3)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 4,1,Dial(destino 4)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 5,1,Dial(destino 5)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; 6,1,Dial(destino 6)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>  exten =&gt; *,1,DISA(no-password|diretoria)    * para efetuar ligações utilizando callback<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>3 &#8211; Arquivo .call utilizado no extensions.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>Context: callback<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>MaxRetries: 2<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>RetryTime:15<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>WaitTime:20<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>Priority: 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>Account: Callback<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>4 &#8211; Arquivo callback.sh (serve para atrasar em alguns segundos a chamada do callback, senão o asterisk retorna antes da pessoa desligar.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>#!/bin/sh<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>DESTINO=$1<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'># Altera a Data do arquivo para faze a ligação depois de 10s.<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>NOW=`date +%s`<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>let &quot;NOW=$NOW+10&quot;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>TOUCH_TMSP=`date -d &quot;1970-01-01 $NOW sec GMT&quot; +%Y%m%d%H%M.%S`<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>touch -t $TOUCH_TMSP /etc/asterisk/&quot;$DESTINO&quot;.call<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>mv /etc/asterisk/&quot;$DESTINO&quot;.call /var/spool/asterisk/outgoing/<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'>chmod 777 /var/spool/asterisk/outgoing/&quot;$DESTINO&quot;.call<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Courier New"'>#Fim do Script<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Eu uso callback desta forma, não foi eu que criei só peguei aqui na lista.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Neulo Alves<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asteriskbrasil-bounces@listas.asteriskbrasil.org [mailto:asteriskbrasil-bounces@listas.asteriskbrasil.org] <b>Em nome de </b>Luiz Le-Fort (luiz@trofel.com)<br><b>Enviada em:</b> quinta-feira, 28 de abril de 2011 14:55<br><b>Para:</b> asteriskbrasil@listas.asteriskbrasil.org<br><b>Assunto:</b> [AsteriskBrasil] Callback<o:p></o:p></span></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Ainda estou somente na era de perguntas, mas logo chego no nivel de ajudar a todos tmb.<br><br>Não sei se o nome correto é Callback, tipo, quero ligar para um número celular corporativo, e o asterisk me retornar a ligação, e logo ser atendido por uma ura por exemplo.<br><br>Procurei sobre &quot;callback&quot; e não encontrei nada nativo do asterisk em relação, somente algo de baixar e compilar, e como sou novato nisso ainda não queria arriscar.<br><br>Alguma sugestão?<o:p></o:p></p></div></body></html>