<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
Hello everybody,<BR>
<BR>
&nbsp;&nbsp;&nbsp; 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'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's a lot of coding for me.<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">
<TR>
<TD>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
        Hi There,<BR>
        <BR>
        &nbsp;&nbsp;&nbsp; I'm still having this problem, Does somebody&nbsp; 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>
            &nbsp;&nbsp;&nbsp; The exten is the parameter passed to the macro, which contains the sip device name. I'll change the name to another less confusing.<BR>
            <BR>
            * Alexandre, tamb&#233;m sou brasileiro hehe, notei que voc&#234; j&#225; escreveu um livro sobre asterisk, ser&#225; que voc&#234; poderia me ajudar com esse problema? J&#225; 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're using ${exten} inside your macro, you should use ${EXTEN}.<BR>
                --&nbsp;<BR>
                Atenciosamente,<BR>
                <BR>
                ALEXANDRE KELLER<BR>
                <BR>
                <BR>
                <A HREF="http://twitter.com/alexandrekeller">http://twitter.com/alexandrekeller</A><BR>
                <A HREF="http://www.facebook.com/alexandre.keller.BR">http://www.facebook.com/alexandre.keller.BR</A><BR>
                <BR>
                &quot;Dinheiro &#233; a consequ&#234;ncia de um trabalho bem feito&nbsp;e n&#227;o o motivo para se fazer um bom trabalho.&quot;<BR>
                <BR>
                <BR>
                <B><FONT COLOR="#000000">P&nbsp;Antes de imprimir pense em&nbsp;seu compromisso com o&nbsp;Meio&nbsp;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=0.0.0.0/0.0.0.0<BR>
                    permit=192.168.1.0/255.255.255.0<BR>
                    canreinvite=yes<BR>
                    qualify=no<BR>
                    callcounter=yes<BR>
                    <BR>
                    <BR>
                    # context for SIP/modesto<BR>
                    context modesto {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; includes {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vivo;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tim;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oi;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; claro;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vivoddd;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timddd;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oiddd;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; claroddd;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; embratel;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; embratel2;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; includes {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ramais;<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>
                    <BR>
                    # Although the problem is occurring also for others contexts included, i'll show only the &quot;ramais&quot; context, which is used to call local extensions:<BR>
                    <BR>
                    context ramais {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101 =&gt; &amp;dial_sip(suporte1);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 102 =&gt; &amp;dial_sip(suporte2);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 103 =&gt; &amp;dial_sip(suporte3);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 105 =&gt; &amp;dial_sip(suporte05);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 106 =&gt; &amp;dial_sip(modesto);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 107 =&gt; &amp;dial_sip(gustavo);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 108 =&gt; &amp;dial_sip(pauloh);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 109 =&gt; &amp;dial_sip(fernanda);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 111 =&gt; &amp;dial_sip(marcos);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 112 =&gt; &amp;dial_sip(thiago);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 115 =&gt; &amp;dial_sip(helder);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 116 =&gt; &amp;dial_sip(atendimento01);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117 =&gt; &amp;dial_sip(atendimento03);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 118 =&gt; &amp;dial_sip(atendimento02);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 119 =&gt; &amp;dial_sip(marlon);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 120 =&gt; &amp;dial_sip(suporteemp);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 122 =&gt; &amp;dial_sip(telemais);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 123 =&gt; &amp;dial_sip(casagustavo);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 127 =&gt; &amp;dial_sip(manutencao);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128 =&gt; &amp;dial_sip(guilherme);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 129 =&gt; &amp;dial_sip(marcelo);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 130 =&gt; &amp;dial_sip(rafael);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 132 =&gt; &amp;dial_sip(netita2);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(2,&quot;==&gt; Chamando a MACRO dial_sip - ponto 1 macros.ael &lt;==&quot;);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(4,&quot;====&gt; Macro dial_sip iniciada.&quot;);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ChanIsAvail(SIP/${exten});<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(2,&quot;==&gt; ${AVAILORIGCHAN}&quot;);<BR>
                    <BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (&quot;${AVAILORIGCHAN}&quot; != &quot;&quot;)<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(4,&quot;====&gt; SIP/${exten} parece estar disponivel, vou disca-lo agora.&quot;);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set(FromExt=${CALLERID(num)});<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System(/bin/sh /var/spool/asterisk/calllog/log.sh SIP/${FromExt} SIP/${exten} SIP-TO-SIP);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(4,&quot;====&gt; System status: ${SYSTEMSTATUS}&quot;);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dial(SIP/${exten},${SIP_DIAL_TIMEOUT},Ttr);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hangup();<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Verbose(2,&quot;====&gt; SIP/${exten} nao esta disponivel.&quot;);<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Hangup();<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<BR>
                    <BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NoOp(&quot;From ${MACRO_EXTEN} to ${exten});<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System(${CALLLOGDIR}/log.sh ${exten});<BR>
                    <BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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">http://www.api-digital.com</A> --<BR>
                    New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="http://www.asterisk.org/hello">http://www.asterisk.org/hello</A><BR>
                    <BR>
                    asterisk-users mailing list<BR>
                    To UNSUBSCRIBE or update options visit:<BR>
                    &nbsp;&nbsp;<A HREF="http://lists.digium.com/mailman/listinfo/asterisk-users">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">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">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">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">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">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">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">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">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">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">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">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">http://lists.digium.com/mailman/listinfo/asterisk-users</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>