<!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,<BR>
<BR>
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é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're using ${exten} inside your macro, you should use ${EXTEN}.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
-- <BR>
Atenciosamente,<BR>
<BR>
ALEXANDRE KELLER
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<A HREF="http://twitter.com/alexandrekeller">http://twitter.com/alexandrekeller</A>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<A HREF="http://www.facebook.com/alexandre.keller.BR">http://www.facebook.com/alexandre.keller.BR</A>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
"Dinheiro é a consequência de um trabalho bem feito e não o motivo para se fazer um bom trabalho."
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<B><FONT COLOR="#000000">P Antes de imprimir pense em seu compromisso com o Meio Ambiente.</FONT></B>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
On 11/11/2011, at 08:38, Antonio Modesto wrote:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<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 "ramais", 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 "modesto" :<BR>
<BR>
# sip.conf<BR>
[modesto](default_extension)<BR>
username=modesto<BR>
context=modesto<BR>
callerid="modesto" <106><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>
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'll show only the "ramais" context, which is used to call local extensions:<BR>
<BR>
context ramais {<BR>
101 => &dial_sip(suporte1);<BR>
102 => &dial_sip(suporte2);<BR>
103 => &dial_sip(suporte3);<BR>
105 => &dial_sip(suporte05);<BR>
106 => &dial_sip(modesto);<BR>
107 => &dial_sip(gustavo);<BR>
108 => &dial_sip(pauloh);<BR>
109 => &dial_sip(fernanda);<BR>
111 => &dial_sip(marcos);<BR>
112 => &dial_sip(thiago);<BR>
115 => &dial_sip(helder);<BR>
116 => &dial_sip(atendimento01);<BR>
117 => &dial_sip(atendimento03);<BR>
118 => &dial_sip(atendimento02);<BR>
119 => &dial_sip(marlon);<BR>
120 => &dial_sip(suporteemp);<BR>
122 => &dial_sip(telemais);<BR>
123 => &dial_sip(casagustavo);<BR>
127 => &dial_sip(manutencao);<BR>
128 => &dial_sip(guilherme);<BR>
129 => &dial_sip(marcelo);<BR>
130 => &dial_sip(rafael);<BR>
132 => &dial_sip(netita2);<BR>
133 => &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 <macro-name> 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,"==> Chamando a MACRO dial_sip - ponto 1 macros.ael <==");<BR>
Verbose(4,"====> Macro dial_sip iniciada.");<BR>
ChanIsAvail(SIP/${exten});<BR>
Verbose(2,"==> ${AVAILORIGCHAN}");<BR>
<BR>
if ("${AVAILORIGCHAN}" != "")<BR>
{<BR>
Verbose(4,"====> SIP/${exten} parece estar disponivel, vou disca-lo agora.");<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,"====> System status: ${SYSTEMSTATUS}");<BR>
Dial(SIP/${exten},${SIP_DIAL_TIMEOUT},Ttr);<BR>
Hangup();<BR>
}<BR>
else<BR>
{<BR>
Verbose(2,"====> SIP/${exten} nao esta disponivel.");<BR>
Hangup();<BR>
};<BR>
<BR>
NoOp("From ${MACRO_EXTEN} to ${exten});<BR>
System(${CALLLOGDIR}/log.sh ${exten});<BR>
<BR>
return;<BR>
};<BR>
<BR>
Thanks in advance.<BR>
<BR>
<BR>
<BR>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<BLOCKQUOTE TYPE=CITE>
--<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>
<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>
<A HREF="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</A>
</BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<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>