<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Amigos, n&atilde;o vamos crucificar o colega q
      teve uma id&eacute;ia, pra ele o mais certo a se fazer &eacute; editar o EXTEN,
      sendo assim q o fa&ccedil;a!<br>
      <br>
      O Ast* d&aacute; essa possibilidade, ent&atilde;o toma a&iacute; o AGI em Shell p isso:<br>
      <br>
      ================================================<br>
      #!/bin/bash<br>
      <br>
      declare -a array<br>
      while read -e ARG &amp;&amp; [ "$ARG" ] ; do<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; array=(` echo $ARG | sed -e 's/://'`)<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; export ${array[0]}=${array[1]}<br>
      done<br>
      <br>
      # Recebendo Variaveis do Asterisk no lan?amento<br>
      echo $agi_request &gt;&amp;2<br>
      echo $agi_channel &gt;&amp;2<br>
      echo $agi_language &gt;&amp;2<br>
      echo $agi_type &gt;&amp;2<br>
      echo $agi_uniqueid &gt;&amp;2<br>
      echo $agi_callerid &gt;&amp;2<br>
      echo $agi_dnid &gt;&amp;2<br>
      echo $agi_rdnis &gt;&amp;2<br>
      echo $agi_context &gt;&amp;2<br>
      echo $agi_extension &gt;&amp;2<br>
      echo $agi_priority &gt;&amp;2<br>
      echo $agi_enhanced &gt;&amp;2<br>
      <br>
      checkresults() {<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while read line<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case ${line:0:4} in<br>
      &nbsp;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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;;<br>
      &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; ) echo $line &gt;&amp;2;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      #Continua lendo at? um possivel erro<br>
      &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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Tipo um
      "520 End ..."<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; esac<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done<br>
      }<br>
      echo "" &gt;&amp;2<br>
      echo SET EXTENSION "$1$agi_extension"<br>
      checkresults<br>
      =================================================<br>
      <br>
      Lembre-se q as proximas prioridades precisam aceitar o novo exten!<br>
      <br>
      Falows<br>
      <br>
      On 26-08-2013 22:49, Marcio - Google wrote:<br>
    </div>
    <blockquote
cite="mid:CABZMeU1=CG8zOHdRkJ5Mmcu1=izuvmLxLceb7BmwF9EiU7TV=A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">&Eacute;, como diz um
          ex-colega: "A gente more e n&atilde;o v&ecirc; tudo!"</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">As coisas n&atilde;o
          funcionam bem assim: "Eu quero porque eu quero!"</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">
          <br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">N&atilde;o existe
          qualquer raz&atilde;o para alterar essa vari&aacute;vel, n&atilde;o importa o
          ambiente. E olha que j&aacute; mexi com sistemas extremamente
          complexos.</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Os colegas j&aacute;
          deram algumas receitas, que inclusive seguem boas pr&aacute;ticas.</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif">Aproveita e d&aacute;
          uma lidinha em&nbsp;<a moz-do-not-send="true"
            href="http://www.voip-info.org/wiki/view/Asterisk+variables"
            style="font-family:arial">http://www.voip-info.org/wiki/view/Asterisk+variables</a>&nbsp;...
          vai "abrir" a sua mente!</div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
        <div class="gmail_default"
          style="font-family:arial,helvetica,sans-serif"><br>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div dir="ltr">
            <br>
            [...]'s<br>
            <br>
            Marcio
            <div><br>
            </div>
            <div>
              <div style="font-family:arial;font-size:small">========================================</div>
              <div style="font-family:arial;font-size:small">###########
                Campanha Ajude o Marcio! ###########</div>
              <div style="font-family:arial;font-size:small"><a
                  moz-do-not-send="true"
                  href="http://sosmarcio.blogspot.com.br/"
                  style="color:rgb(17,85,204)" target="_blank">http://sosmarcio.blogspot.com.br/</a></div>
              <div style="font-family:arial;font-size:small">
                <a moz-do-not-send="true"
                  href="http://www.vakinha.com.br/VaquinhaP.aspx?e=195793"
                  style="color:rgb(17,85,204)" target="_blank">http://www.vakinha.com.br/VaquinhaP.aspx?e=195793</a><br>
              </div>
              <div style="font-family:arial;font-size:small">========================================</div>
            </div>
          </div>
        </div>
        <br>
        <br>
        <div class="gmail_quote">Em 26 de agosto de 2013 18:56, Hudson
          Cardoso <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:hudsoncardoso@hotmail.com" target="_blank">hudsoncardoso@hotmail.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>
              <div dir="ltr"><font style="font-size:12pt" face="Arial"
                  size="3">Simples, ela n&atilde;o &eacute; uma variavel dentro do seu
                  contexto, ela so se torna variavel quando vai pra
                  outro contexto.</font>
                <div><font face="Arial">Por esse motivo oce nao consegue
                    altera-la, envie-a para outro contexto e fica facil.</font></div>
                <div><br>
                  <br>
                  <pre style="line-height:17px;color:rgb(42,42,42);white-space:normal">Hudson&nbsp;
<a moz-do-not-send="true" href="tel:%28048%29%208413-7000" value="+554884137000" target="_blank">(048) 8413-7000</a>
Para quem nao cre, nenhuma prova converte,Para aquele que cre, nenhuma prova precisa.&nbsp;</pre>
                  <br>
                  <br>
                  <div>
                    <hr>Date: Mon, 26 Aug 2013 18:35:31 -0300<br>
                    From: <a moz-do-not-send="true"
                      href="mailto:thiagoo.anselmoo@gmail.com"
                      target="_blank">thiagoo.anselmoo@gmail.com</a><br>
                    To: <a moz-do-not-send="true"
                      href="mailto:asteriskbrasil@listas.asteriskbrasil.org"
                      target="_blank">asteriskbrasil@listas.asteriskbrasil.org</a><br>
                    Subject: [AsteriskBrasil] Alterar ${EXTEN}
                    <div>
                      <div class="h5"><br>
                        <br>
                        <div dir="ltr">
                          <div>Pessoal algu&eacute;m j&aacute; alterou a variavel
                            ${EXTEN}</div>
                          <div>&nbsp;</div>
                          <div>J&aacute; tentei alterar de varias formas com
                            Set(${EXTEN}=1234);</div>
                          <div>&nbsp;</div>
                          <div>e outras formas e sem sucesso!<br
                              clear="all">
                            <br>
                            -- <br>
                            Thiago Anselmo
                          </div>
                        </div>
                        <br>
                      </div>
                    </div>
                    _______________________________________________
                    KHOMP: completa linha de placas externas FXO, FXS,
                    GSM e E1;
                    Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e
                    SS7;
                    Intercomunicadores para acesso remoto via rede IP.
                    Conhe&#65533;a em <a moz-do-not-send="true"
                      href="http://www.Khomp.com" target="_blank">www.Khomp.com</a>.
                    _______________________________________________
                    ALIGERA &#65533; Fabricante nacional de Gateways SIP-E1
                    para R2, ISDN e SS7.
                    Placas de 1E1, 2E1, 4E1 e 8E1 para PCI ou PCI
                    Express.
                    Channel Bank &#65533; Appliance Asterisk - Acesse <a
                      moz-do-not-send="true"
                      href="http://www.aligera.com.br" target="_blank">www.aligera.com.br</a>.
                    _______________________________________________
                    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"
                      target="_blank">asteriskbrasil-unsubscribe@listas.asteriskbrasil.org</a></div>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            KHOMP: completa linha de placas externas FXO, FXS, GSM e E1;<br>
            Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7;<br>
            Intercomunicadores para acesso remoto via rede IP. Conhe&ccedil;a
            em <a moz-do-not-send="true" href="http://www.Khomp.com"
              target="_blank">www.Khomp.com</a>.<br>
            _______________________________________________<br>
            ALIGERA &#8211; Fabricante nacional de Gateways SIP-E1 para R2,
            ISDN e SS7.<br>
            Placas de 1E1, 2E1, 4E1 e 8E1 para PCI ou PCI Express.<br>
            Channel Bank &#8211; Appliance Asterisk - Acesse <a
              moz-do-not-send="true" href="http://www.aligera.com.br"
              target="_blank">www.aligera.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="">_______________________________________________
KHOMP: completa linha de placas externas FXO, FXS, GSM e E1;
Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7;
Intercomunicadores para acesso remoto via rede IP. Conhe&ccedil;a em <a class="moz-txt-link-abbreviated" href="http://www.Khomp.com">www.Khomp.com</a>.
_______________________________________________
ALIGERA &#8211; Fabricante nacional de Gateways SIP-E1 para R2, ISDN e SS7.
Placas de 1E1, 2E1, 4E1 e 8E1 para PCI ou PCI Express.
Channel Bank &#8211; Appliance Asterisk - Acesse <a class="moz-txt-link-abbreviated" href="http://www.aligera.com.br">www.aligera.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>
  </body>
</html>