<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Olá Yves,<br>
    <br>
    Pode explicar melhor o cenário?<br>
    <br>
    Dependo do tipo de tecnologia que vc esta usando a sugestão do
    Mauricio é a melhor.<br>
    <br>
    Não entendi bem esta sua AGI o direcionamento que você quer fazer é
    para ligações de entrada ou saida?<br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 19/06/2015 01:06, Mauricio Magalhães
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAPBcmYz57brEQetUkJBDC1BqidZCJu9uD-XEB2i+jcfgzpMEug@mail.gmail.com"
      type="cite">
      <div dir="ltr">Olá não seria mais fácil colocar os troncos em
        grupo e utilizar o r"x" onde x é o numero do grupo?<br>
        <br>
        Ex. dahdi/r0 
        <div><br>
        </div>
        <div>Isso faz com que as ligações saiam randomicamente. portanto
          balanceadas.</div>
        <div><br>
        </div>
        <div>Abraços.<br>
          <div><br>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div class="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div dir="ltr">
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <p
                                            style="font-size:12.8000001907349px;margin:0px
                                            0px 8px"><b
                                              style="font-size:12.8000001907349px"><br>
                                              <br>
                                            </b><b
                                              style="color:rgb(0,0,0);font-size:small">=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</b><br>
                                          </p>
                                          <p
                                            style="font-size:12.8000001907349px;margin:0px
                                            0px 8px"><strong><font
                                                face="verdana, geneva"><span
style="font-size:13.3px">Maurício  Magalhães.</span><span
                                                  style="font-size:13.3000001907349px"><br>
                                                </span></font></strong><span
style="font-size:small;color:rgb(136,136,136)">T3 tecnologia - </span><span
style="font-size:small;color:rgb(136,136,136)">Analista de Rede/Telfonia
                                              IP. <br>
                                            </span><span
                                              style="color:rgb(136,136,136);font-size:small">Especialização
                                              em Segurança da
                                              Informação.<br>
                                            </span><span
                                              style="color:rgb(136,136,136);font-size:small">ITIL®
                                              V3 Certification.<br>
                                            </span><span
                                              style="color:rgb(136,136,136);font-size:small">Salvador
                                              - BA<br>
                                            </span><img
                                              moz-do-not-send="true"
src="https://docs.google.com/a/magalhaes.eti.br/uc?id=0B94fU9COETVnNzhlb2JJalU5RE0&amp;export=download"
style="color:rgb(136,136,136);font-size:small"><span
                                              style="color:rgb(136,136,136);font-size:small"> <a
                                                moz-do-not-send="true"
                                                href="mailto:mauricio@t3tecnologia.com.br"
                                                target="_blank">mauricio@t3tecnologia.com.br</a><br>
                                            </span><span
                                              style="color:rgb(136,136,136);font-size:small"><img
                                                moz-do-not-send="true"
src="https://docs.google.com/uc?export=download&amp;id=0B94fU9COETVnbFZmZl9iYTJBYjQ&amp;revid=0B94fU9COETVneHVkVkVEdndhdHpadnR3Ykp6ZEJFSnR1VGpFPQ"> </span><span
                                              style="font-size:small"><font
                                                color="#888888">Cel.
                                                Com. (71) </font></span><span
                                              style="font-size:small"><font
                                                color="#888888">97156766
                                                - (VIVO) <br>
                                              </font></span><img
                                              moz-do-not-send="true"
src="https://docs.google.com/uc?export=download&amp;id=0B94fU9COETVnbFZmZl9iYTJBYjQ&amp;revid=0B94fU9COETVneHVkVkVEdndhdHpadnR3Ykp6ZEJFSnR1VGpFPQ"
style="color:rgb(136,136,136);font-size:small"><span
                                              style="color:rgb(136,136,136);font-size:small"> </span><span
style="color:rgb(136,136,136);font-size:small">Cel. Com. (71) </span><font
                                              color="#888888" size="2">87149189
                                              - (OI)<br>
                                              <br>
                                            </font><b
                                              style="color:rgb(0,0,0);font-size:small">=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</b></p>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <div class="gmail_quote">Em 18 de junho de 2015 21:19, Yves
          Fernandes <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:yvesfernandes@gmail.com" target="_blank">yvesfernandes@gmail.com</a>&gt;</span>
          escreveu:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>Prezados, boa noite.<br>
                          <br>
                        </div>
                        Estou tentando criar um balanceamento entre duas
                        linhas que um cliente possui.<br>
                        <br>
                      </div>
                      Fiz um programa em php que consulta o banco cdr e
                      verifica qual numero fez mais ligaçoes no dia e
                      envia a ligaçao pro outro numero.<br>
                      <br>
                    </div>
                    O que gostaria de saber de vocês é o seguinte. Como
                    eu transfiro essa ligação para outro contexto
                    utilizando agi?<br>
                    <br>
                  </div>
                  <br>
                  ===============================<br>
                  #!/usr/bin/php -q<br>
                  <br>
                  &lt;?<br>
                  <br>
                  <br>
                              $conn =
                  mysql_connect("localhost","XXXXXXXX","XXXXXXXXXXX") or
                  die("PROBLEMA COM SERVER");<br>
                              mysql_select_db("asterisk",$conn) or
                  die("PROBLEMA COM BANCO");<br>
                              $sql = "SELECT
                  calldate,dstchannel,lastapp,disposition FROM cdr where
                  lastapp = 'Dial' AND disposition = 'ANSWERED'";<br>
                              $recordset = mysql_query($sql,$conn) OR
                  DIE ("erro: ".$sql." ".mysql_error());<br>
                  <br>
                              $datalocal = date('Y-m-d');<br>
                              $tel1 = 0;<br>
                              $tel2 = 0;<br>
                  <br>
                               while($row =
                  mysql_fetch_assoc($recordset))<br>
                               {<br>
                                   $dstchannel = $row['dstchannel'];<br>
                                   $lastapp = $row['lastapp'];<br>
                                   $disposition = $row['disposition'];<br>
                                   $databanco = $row['calldate'];<br>
                  <br>
                                   $datatemp = substr($databanco,0,10);<br>
                  <br>
                                   if((strpos($dstchannel,"7535") ==
                  TRUE) &amp;&amp; (strcmp($datatemp,$datalocal) == 0))<br>
                                      $tel1 = $tel1 + 1;<br>
                                   else if((strpos($dstchannel,"7505")
                  == TRUE) &amp;&amp; (strcmp($datatemp,$datalocal) ==
                  0))<br>
                                           $tel2 = $tel2 + 1;<br>
                  <br>
                                }<br>
                  <br>
                  <br>
                               if($tel1 &lt;= $tel2)<br>
                                 
                  $agi-&gt;exec("Queue","suporte,t,,,3600","1");<br>
                               else<br>
                                 
                  $agi-&gt;exec("Queue","suporte,t,,,3600","1");<br>
                  <br>
                  <br>
                   ?&gt;<br>
                  <br>
                </div>
                Sei que esta parte que chamo o $agi-&gt;exec está
                errada. Justamente ela que gostaria da sugestao de vocês
                como corrigir.<br>
                <br>
              </div>
              Obrigado desde já<span class="HOEnZb"><font
                  color="#888888"><br clear="all">
                  <div>
                    <div>
                      <div>
                        <div>
                          <div>
                            <div>
                              <div>
                                <div>
                                  <div><br>
                                    -- <br>
                                    <div>=====================<br>
                                      Yves Fernandes<br>
                                      Cellphone <a
                                        moz-do-not-send="true"
                                        href="tel:%2B55%20%2821%29%209357-7073"
                                        value="+552193577073"
                                        target="_blank">+55 (21)
                                        9357-7073</a><br>
                                      <br>
                                      "É fácil cobrar; Difícil é
                                      elogiar."<br>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </font></span></div>
            <br>
            _______________________________________________<br>
            WORKOFFEE KHOMP: em Junho serão 2 edições do workshop<br>
            gratuito da Khomp:  dia 11 em Brasília, e dia 18 em Curitiba<br>
            Aproveite e conheça os lançamentos: EBS Server PRO e UMG 100<br>
            Garanta sua vaga e saiba mais em: <a moz-do-not-send="true"
              href="http://www.workoffee.com.br" rel="noreferrer"
              target="_blank">www.workoffee.com.br</a><br>
            _______________________________________________<br>
            DIGIVOICE: Fabricante pioneiro em Banco de Canais e Placas
            E1, GSM, FXO e FXS para Asterisk e Elastix. Temos Cursos de
            Telefonia IP e Asterisk.<br>
            Construa soluções de PABX IP com produtos DigiVoice -
            visite  <a moz-do-not-send="true"
              href="http://www.digivoice.com.br" rel="noreferrer"
              target="_blank">www.digivoice.com.br</a><br>
            _______________________________________________<br>
            Para remover seu email desta lista, basta enviar um email em
            branco para <a moz-do-not-send="true"
              href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
WORKOFFEE KHOMP: em Junho serão 2 edições do workshop
gratuito da Khomp:  dia 11 em Brasília, e dia 18 em Curitiba
Aproveite e conheça os lançamentos: EBS Server PRO e UMG 100
Garanta sua vaga e saiba mais em: <a class="moz-txt-link-abbreviated" href="http://www.workoffee.com.br">www.workoffee.com.br</a>
_______________________________________________
DIGIVOICE: Fabricante pioneiro em Banco de Canais e Placas E1, GSM, FXO e FXS para Asterisk e Elastix. Temos Cursos de Telefonia IP e Asterisk.
Construa soluções de PABX IP com produtos DigiVoice - visite  <a class="moz-txt-link-abbreviated" href="http://www.digivoice.com.br">www.digivoice.com.br</a>
_______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para <a class="moz-txt-link-abbreviated" href="mailto:asteriskbrasil-unsubscribe@listas.asteriskbrasil.org">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a></pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <img src="cid:part10.06060209.06000600@sincronismotelecom.com"
        border="0"></div>
  </body>
</html>