Hi Antonio,<div><br></div><div>I&#39;d never had used extensions.ael but in extensions.conf, using Macro I always set &#39;__TRANSFER_CONTEXT&#39; to the same context of exten and it works well.<br><br><div class="gmail_quote">
2011/12/13 Antonio Modesto <span dir="ltr">&lt;<a href="mailto:modesto@isimples.com.br">modesto@isimples.com.br</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>


  
  

<div>
Hello everybody,<br>
<br>
    I found that if i write my macro in the extensions.conf (not in ael), the atxfer works well, the problem is that ael uses gosub instead of the Macro() application, which doesn&#39;t change the current context. Does anybody know if i can do anything to solve this? I know if i rewrite all my macros in the common way, it will work, but that&#39;s a lot of coding for me.<div>
<div class="h5"><br>
<br>
<br>
On Mon, 2011-12-12 at 08:57 -0200, Antonio Modesto wrote:<br>
<blockquote type="CITE">
    Nothing?<br>
    <br>
    <br>
    On Mon, 2011-11-21 at 16:21 -0200, Antonio Modesto wrote:<br>
    <blockquote type="CITE">
        <table cellspacing="0" cellpadding="3">
<tbody><tr>
<td>
<br>
<br>
<br>
</td>
</tr>
</tbody></table>
        Hi There,<br>
        <br>
            I&#39;m still having this problem, Does somebody  know what can be happening?<br>
        <br>
        <br>
        Regards.<br>
        <br>
        On Fri, 2011-11-11 at 09:40 -0200, Antonio Modesto wrote:<br>
        <blockquote type="CITE">
            Hello,<br>
            <br>
                The exten is the parameter passed to the macro, which contains the sip device name. I&#39;ll change the name to another less confusing.<br>
            <br>
            * Alexandre, também sou brasileiro hehe, notei que você já escreveu um livro sobre asterisk, será que você poderia me ajudar com esse problema? Já tem alguns dias que estou na luta aqui hehe.<br>
            <br>
            On Fri, 2011-11-11 at 08:45 -0200, Alexandre Keller wrote:<br>
            <blockquote type="CITE">
                You&#39;re using ${exten} inside your macro, you should use ${EXTEN}.<br>
                -- <br>
                Atenciosamente,<br>
                <br>
                ALEXANDRE KELLER<br>
                <br>
                <br>
                <a href="http://twitter.com/alexandrekeller" target="_blank">http://twitter.com/alexandrekeller</a><br>
                <a href="http://www.facebook.com/alexandre.keller.BR" target="_blank">http://www.facebook.com/alexandre.keller.BR</a><br>
                <br>
                &quot;Dinheiro é a consequência de um trabalho bem feito e não o motivo para se fazer um bom trabalho.&quot;<br>
                <br>
                <br>
                <b><font color="#000000">P Antes de imprimir pense em seu compromisso com o Meio Ambiente.</font></b><br>
                <br>
                On 11/11/2011, at 08:38, Antonio Modesto wrote:<br>
                <br>
                <blockquote type="CITE">
                    On Mon, 2011-11-07 at 09:12 -0600, Danny Nicholas wrote:<br>
                    <blockquote type="CITE">
                        It can have to do with either the telephones dial plan or the context in the Asterisk dial plan combined with your features.conf settings.<br>
                    </blockquote>
                    <br>
                    I noticed that my problem occurs when i use a macro to dial sip devices, my dialplan is like this:<br>
                    <br>
                    - Each sip device has its own context<br>
                    - This context includes the outgoing call contexts that this extension can use for making calls and includes a context called &quot;ramais&quot;, which has the dial plan to call another extensions, it uses a macro to do this.<br>

                    <br>
                    Here is the configuration for my extension &quot;modesto&quot; :<br>
                    <br>
                    # sip.conf<br>
                    [modesto](default_extension)<br>
                    username=modesto<br>
                    context=modesto<br>
                    callerid=&quot;modesto&quot; &lt;106&gt;<br>
                    callgroup=4<br>
                    pickupgroup=4<br>
                    <br>
                    # Default extension template<br>
                    type=friend<br>
                    dtmfmode=auto<br>
                    host=dynamic<br>
                    disallow=all<br>
                    allow=ulaw<br>
                    allow=alaw<br>
                    deny=<a href="http://0.0.0.0/0.0.0.0" target="_blank">0.0.0.0/0.0.0.0</a><br>
                    permit=<a href="http://192.168.1.0/255.255.255.0" target="_blank">192.168.1.0/255.255.255.0</a><br>
                    canreinvite=yes<br>
                    qualify=no<br>
                    callcounter=yes<br>
                    <br>
                    <br>
                    # context for SIP/modesto<br>
                    context modesto {<br>
                            includes {<br>
                                    vivo;<br>
                                    tim;<br>
                                    oi;<br>
                                    claro;<br>
                                    vivoddd;<br>
                                    timddd;<br>
                                    oiddd;<br>
                                    claroddd;<br>
                                    embratel;<br>
                                    embratel2;<br>
                                    };<br>
                            includes {<br>
                                    ramais;<br>
                                    };<br>
                            };<br>
                    <br>
                    # Although the problem is occurring also for others contexts included, i&#39;ll show only the &quot;ramais&quot; context, which is used to call local extensions:<br>
                    <br>
                    context ramais {<br>
                            101 =&gt; &amp;dial_sip(suporte1);<br>
                            102 =&gt; &amp;dial_sip(suporte2);<br>
                            103 =&gt; &amp;dial_sip(suporte3);<br>
                            105 =&gt; &amp;dial_sip(suporte05);<br>
                            106 =&gt; &amp;dial_sip(modesto);<br>
                            107 =&gt; &amp;dial_sip(gustavo);<br>
                            108 =&gt; &amp;dial_sip(pauloh);<br>
                            109 =&gt; &amp;dial_sip(fernanda);<br>
                            111 =&gt; &amp;dial_sip(marcos);<br>
                            112 =&gt; &amp;dial_sip(thiago);<br>
                            115 =&gt; &amp;dial_sip(helder);<br>
                            116 =&gt; &amp;dial_sip(atendimento01);<br>
                            117 =&gt; &amp;dial_sip(atendimento03);<br>
                            118 =&gt; &amp;dial_sip(atendimento02);<br>
                            119 =&gt; &amp;dial_sip(marlon);<br>
                            120 =&gt; &amp;dial_sip(suporteemp);<br>
                            122 =&gt; &amp;dial_sip(telemais);<br>
                            123 =&gt; &amp;dial_sip(casagustavo);<br>
                            127 =&gt; &amp;dial_sip(manutencao);<br>
                            128 =&gt; &amp;dial_sip(guilherme);<br>
                            129 =&gt; &amp;dial_sip(marcelo);<br>
                            130 =&gt; &amp;dial_sip(rafael);<br>
                            132 =&gt; &amp;dial_sip(netita2);<br>
                            133 =&gt; &amp;dial_sip(unotel);<br>
                    <br>
                    };<br>
                    <br>
                    If I use the Dial() application instead of this macro, it works well. I noticed that when I use the macro and try to transfer a call (The problem occurs only for the calling party, the called party can do transfers with no problems), asterisk tries to find the extension in the &lt;macro-name&gt; context and of course, there is no dialplan to call the extensions there.<br>

                    <br>
                    <br>
                    Here is the dial_sip macro:<br>
                    <br>
                    macro dial_sip(exten) {<br>
                            Verbose(2,&quot;==&gt; Chamando a MACRO dial_sip - ponto 1 macros.ael &lt;==&quot;);<br>
                            Verbose(4,&quot;====&gt; Macro dial_sip iniciada.&quot;);<br>
                            ChanIsAvail(SIP/${exten});<br>
                            Verbose(2,&quot;==&gt; ${AVAILORIGCHAN}&quot;);<br>
                    <br>
                            if (&quot;${AVAILORIGCHAN}&quot; != &quot;&quot;)<br>
                            {<br>
                                    Verbose(4,&quot;====&gt; SIP/${exten} parece estar disponivel, vou disca-lo agora.&quot;);<br>
                                    Set(FromExt=${CALLERID(num)});<br>
                                    System(/bin/sh /var/spool/asterisk/calllog/log.sh SIP/${FromExt} SIP/${exten} SIP-TO-SIP);<br>
                                    Verbose(4,&quot;====&gt; System status: ${SYSTEMSTATUS}&quot;);<br>
                                    Dial(SIP/${exten},${SIP_DIAL_TIMEOUT},Ttr);<br>
                                    Hangup();<br>
                            }<br>
                            else<br>
                            {<br>
                                    Verbose(2,&quot;====&gt; SIP/${exten} nao esta disponivel.&quot;);<br>
                                    Hangup();<br>
                            };<br>
                    <br>
                            NoOp(&quot;From ${MACRO_EXTEN} to ${exten});<br>
                            System(${CALLLOGDIR}/log.sh ${exten});<br>
                    <br>
                            return;<br>
                    };<br>
                    <br>
                    Thanks in advance.<br>
                    <br>
                    <br>
                    <br>
                    --<br>
                    _____________________________________________________________________<br>
                    -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
                    New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
                                  <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
                    <br>
                    asterisk-users mailing list<br>
                    To UNSUBSCRIBE or update options visit:<br>
                      <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a> <br>
                </blockquote>
                <br>
<pre>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</pre>
            </blockquote>
            <br>
<pre>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</pre>
        </blockquote>
        <br>
<pre>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</pre>
    </blockquote>
    <br>
<pre>--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a>

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a>
</pre>
</blockquote>
<br>
</div></div></div>

<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Atenciosamente<br>
<br>____________________<br>Roberto Linck<br><a href="mailto:robertolinck@gmail.com" target="_blank">robertolinck@gmail.com</a><br>(51) 8140-1372<br>
</div>