[asterisk-users] Problem with Atxfer for the calling party [SOLVED]

Antonio Modesto modesto at isimples.com.br
Tue Dec 20 05:02:55 CST 2011


As explained in the posts before, this tread was solved.


Thanks.

On Tue, 2011-12-13 at 17:07 -0200, Antonio Modesto wrote:

> On Tue, 2011-12-13 at 16:35 -0200, Roberto Linck wrote:
> 
> > Hi Antonio,
> > 
> > 
> > I'd never had used extensions.ael but in extensions.conf, using
> > Macro I always set '__TRANSFER_CONTEXT' to the same context of exten
> > and it works well.
> 
> 
> Thanks, it worked, the MACRO_CONTEXT variable was empty, I've set the
> value to my extensions context and it worked fine.
> 
> 
> Thanks.
> 
> > 
> > 2011/12/13 Antonio Modesto <modesto at isimples.com.br>
> > 
> >         Hello everybody,
> >         
> >             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. 
> >         
> >         
> >         
> >         On Mon, 2011-12-12 at 08:57 -0200, Antonio Modesto wrote:
> >         
> >         > Nothing?
> >         > 
> >         > 
> >         > On Mon, 2011-11-21 at 16:21 -0200, Antonio Modesto wrote:
> >         > 
> >         > > 
> >         > > 
> >         > > 
> >         > > 
> >         > > 
> >         > > Hi There,
> >         > > 
> >         > >     I'm still having this problem, Does somebody  know
> >         > > what can be happening?
> >         > > 
> >         > > 
> >         > > Regards.
> >         > > 
> >         > > On Fri, 2011-11-11 at 09:40 -0200, Antonio Modesto
> >         > > wrote:
> >         > > 
> >         > > > Hello,
> >         > > > 
> >         > > >     The exten is the parameter passed to the macro,
> >         > > > which contains the sip device name. I'll change the
> >         > > > name to another less confusing.
> >         > > > 
> >         > > > * 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.
> >         > > > 
> >         > > > On Fri, 2011-11-11 at 08:45 -0200, Alexandre Keller
> >         > > > wrote:
> >         > > > 
> >         > > > > You're using ${exten} inside your macro, you should
> >         > > > > use ${EXTEN}.
> >         > > > > -- 
> >         > > > > Atenciosamente,
> >         > > > > 
> >         > > > > ALEXANDRE KELLER
> >         > > > > 
> >         > > > > 
> >         > > > > http://twitter.com/alexandrekeller
> >         > > > > http://www.facebook.com/alexandre.keller.BR
> >         > > > > 
> >         > > > > "Dinheiro é a consequência de um trabalho bem
> >         > > > > feito e não o motivo para se fazer um bom trabalho."
> >         > > > > 
> >         > > > > 
> >         > > > > P Antes de imprimir pense em seu compromisso com
> >         > > > > o Meio Ambiente.
> >         > > > > 
> >         > > > > On 11/11/2011, at 08:38, Antonio Modesto wrote:
> >         > > > > 
> >         > > > > 
> >         > > > > > On Mon, 2011-11-07 at 09:12 -0600, Danny Nicholas
> >         > > > > > wrote:
> >         > > > > > 
> >         > > > > > > 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.
> >         > > > > > 
> >         > > > > > 
> >         > > > > > I noticed that my problem occurs when i use a
> >         > > > > > macro to dial sip devices, my dialplan is like
> >         > > > > > this:
> >         > > > > > 
> >         > > > > > - Each sip device has its own context
> >         > > > > > - This context includes the outgoing call contexts
> >         > > > > > that this extension can use for making calls and
> >         > > > > > includes a context called "ramais", which has the
> >         > > > > > dial plan to call another extensions, it uses a
> >         > > > > > macro to do this.
> >         > > > > > 
> >         > > > > > Here is the configuration for my extension
> >         > > > > > "modesto" :
> >         > > > > > 
> >         > > > > > # sip.conf
> >         > > > > > [modesto](default_extension)
> >         > > > > > username=modesto
> >         > > > > > context=modesto
> >         > > > > > callerid="modesto" <106>
> >         > > > > > callgroup=4
> >         > > > > > pickupgroup=4
> >         > > > > > 
> >         > > > > > # Default extension template
> >         > > > > > type=friend
> >         > > > > > dtmfmode=auto
> >         > > > > > host=dynamic
> >         > > > > > disallow=all
> >         > > > > > allow=ulaw
> >         > > > > > allow=alaw
> >         > > > > > deny=0.0.0.0/0.0.0.0
> >         > > > > > permit=192.168.1.0/255.255.255.0
> >         > > > > > canreinvite=yes
> >         > > > > > qualify=no
> >         > > > > > callcounter=yes
> >         > > > > > 
> >         > > > > > 
> >         > > > > > # context for SIP/modesto
> >         > > > > > context modesto {
> >         > > > > >         includes {
> >         > > > > >                 vivo;
> >         > > > > >                 tim;
> >         > > > > >                 oi;
> >         > > > > >                 claro;
> >         > > > > >                 vivoddd;
> >         > > > > >                 timddd;
> >         > > > > >                 oiddd;
> >         > > > > >                 claroddd;
> >         > > > > >                 embratel;
> >         > > > > >                 embratel2;
> >         > > > > >                 };
> >         > > > > >         includes {
> >         > > > > >                 ramais;
> >         > > > > >                 };
> >         > > > > >         };
> >         > > > > > 
> >         > > > > > # Although the problem is occurring also for
> >         > > > > > others contexts included, i'll show only the
> >         > > > > > "ramais" context, which is used to call local
> >         > > > > > extensions:
> >         > > > > > 
> >         > > > > > context ramais {
> >         > > > > >         101 => &dial_sip(suporte1);
> >         > > > > >         102 => &dial_sip(suporte2);
> >         > > > > >         103 => &dial_sip(suporte3);
> >         > > > > >         105 => &dial_sip(suporte05);
> >         > > > > >         106 => &dial_sip(modesto);
> >         > > > > >         107 => &dial_sip(gustavo);
> >         > > > > >         108 => &dial_sip(pauloh);
> >         > > > > >         109 => &dial_sip(fernanda);
> >         > > > > >         111 => &dial_sip(marcos);
> >         > > > > >         112 => &dial_sip(thiago);
> >         > > > > >         115 => &dial_sip(helder);
> >         > > > > >         116 => &dial_sip(atendimento01);
> >         > > > > >         117 => &dial_sip(atendimento03);
> >         > > > > >         118 => &dial_sip(atendimento02);
> >         > > > > >         119 => &dial_sip(marlon);
> >         > > > > >         120 => &dial_sip(suporteemp);
> >         > > > > >         122 => &dial_sip(telemais);
> >         > > > > >         123 => &dial_sip(casagustavo);
> >         > > > > >         127 => &dial_sip(manutencao);
> >         > > > > >         128 => &dial_sip(guilherme);
> >         > > > > >         129 => &dial_sip(marcelo);
> >         > > > > >         130 => &dial_sip(rafael);
> >         > > > > >         132 => &dial_sip(netita2);
> >         > > > > >         133 => &dial_sip(unotel);
> >         > > > > > 
> >         > > > > > };
> >         > > > > > 
> >         > > > > > 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 <macro-name>
> >         > > > > > context and of course, there is no dialplan to
> >         > > > > > call the extensions there.
> >         > > > > > 
> >         > > > > > 
> >         > > > > > Here is the dial_sip macro:
> >         > > > > > 
> >         > > > > > macro dial_sip(exten) {
> >         > > > > >         Verbose(2,"==> Chamando a MACRO dial_sip -
> >         > > > > > ponto 1 macros.ael <==");
> >         > > > > >         Verbose(4,"====> Macro dial_sip
> >         > > > > > iniciada.");
> >         > > > > >         ChanIsAvail(SIP/${exten});
> >         > > > > >         Verbose(2,"==> ${AVAILORIGCHAN}");
> >         > > > > > 
> >         > > > > >         if ("${AVAILORIGCHAN}" != "")
> >         > > > > >         {
> >         > > > > >                 Verbose(4,"====> SIP/${exten}
> >         > > > > > parece estar disponivel, vou disca-lo agora.");
> >         > > > > >                 Set(FromExt=${CALLERID(num)});
> >         > > > > > 
> >         > > > > > System(/bin/sh /var/spool/asterisk/calllog/log.sh
> >         > > > > > SIP/${FromExt} SIP/${exten} SIP-TO-SIP);
> >         > > > > >                 Verbose(4,"====> System status:
> >         > > > > > ${SYSTEMSTATUS}");
> >         > > > > >                 Dial(SIP/${exten},
> >         > > > > > ${SIP_DIAL_TIMEOUT},Ttr);
> >         > > > > >                 Hangup();
> >         > > > > >         }
> >         > > > > >         else
> >         > > > > >         {
> >         > > > > >                 Verbose(2,"====> SIP/${exten} nao
> >         > > > > > esta disponivel.");
> >         > > > > >                 Hangup();
> >         > > > > >         };
> >         > > > > > 
> >         > > > > >         NoOp("From ${MACRO_EXTEN} to ${exten});
> >         > > > > >         System(${CALLLOGDIR}/log.sh ${exten});
> >         > > > > > 
> >         > > > > >         return;
> >         > > > > > };
> >         > > > > > 
> >         > > > > > Thanks in advance.
> >         > > > > > 
> >         > > > > > 
> >         > > > > > 
> >         > > > > > --
> >         > > > > > _____________________________________________________________________
> >         > > > > > -- Bandwidth and Colocation Provided by
> >         > > > > > http://www.api-digital.com --
> >         > > > > > New to Asterisk? Join us for a live introductory
> >         > > > > > webinar every Thurs:
> >         > > > > >               http://www.asterisk.org/hello
> >         > > > > > 
> >         > > > > > asterisk-users mailing list
> >         > > > > > To UNSUBSCRIBE or update options visit:
> >         > > > > >   http://lists.digium.com/mailman/listinfo/asterisk-users 
> >         > > > > 
> >         > > > > 
> >         > > > > 
> >         > > > > --
> >         > > > > _____________________________________________________________________
> >         > > > > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >         > > > > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >         > > > >                http://www.asterisk.org/hello
> >         > > > > 
> >         > > > > asterisk-users mailing list
> >         > > > > To UNSUBSCRIBE or update options visit:
> >         > > > >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >         > > > 
> >         > > > 
> >         > > > 
> >         > > > --
> >         > > > _____________________________________________________________________
> >         > > > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >         > > > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >         > > >                http://www.asterisk.org/hello
> >         > > > 
> >         > > > asterisk-users mailing list
> >         > > > To UNSUBSCRIBE or update options visit:
> >         > > >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >         > > 
> >         > > 
> >         > > 
> >         > > --
> >         > > _____________________________________________________________________
> >         > > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >         > > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >         > >                http://www.asterisk.org/hello
> >         > > 
> >         > > asterisk-users mailing list
> >         > > To UNSUBSCRIBE or update options visit:
> >         > >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >         > 
> >         > 
> >         > 
> >         > --
> >         > _____________________________________________________________________
> >         > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> >         > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >         >                http://www.asterisk.org/hello
> >         > 
> >         > asterisk-users mailing list
> >         > To UNSUBSCRIBE or update options visit:
> >         >    http://lists.digium.com/mailman/listinfo/asterisk-users
> >         
> >         
> >         
> >         
> >         --
> >         _____________________________________________________________________
> >         -- Bandwidth and Colocation Provided by
> >         http://www.api-digital.com --
> >         New to Asterisk? Join us for a live introductory webinar
> >         every Thurs:
> >                       http://www.asterisk.org/hello
> >         
> >         asterisk-users mailing list
> >         To UNSUBSCRIBE or update options visit:
> >           http://lists.digium.com/mailman/listinfo/asterisk-users 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > Atenciosamente
> > 
> > ____________________
> > Roberto Linck
> > robertolinck at gmail.com
> > (51) 8140-1372
> > 
> > 
> > --
> > _____________________________________________________________________
> > -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> > New to Asterisk? Join us for a live introductory webinar every Thurs:
> >                http://www.asterisk.org/hello
> > 
> > asterisk-users mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> 
> 
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20111220/b63d13fa/attachment.htm>


More information about the asterisk-users mailing list