&gt;<meta http-equiv="content-type" content="text/html; charset=utf-8">Any particular reason you don&#39;t want to put the logic of the macro in your AGI?<br><br><div>Yes...i&#39;ve no idea how to do it...it&#39;s a PERL script, i&#39;m already checking how to do this...but it will be a little complicated :( <br>
<div><br></div><div><br><div class="gmail_quote">2010/9/3 Steve Edwards <span dir="ltr">&lt;<a href="http://asterisk.org">asterisk.org</a>@<a href="http://sedwards.com">sedwards.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Thu, 2 Sep 2010, Danny Dias wrote:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sorry for my poor explanation...what i&#39;m trying to do is to invoke a Macro from my AGI, like this:<br>
<br>
$agi-&gt;exec(&quot;Macro&quot;,&quot;check-call-limit&quot;);<br>
<br>
If the Macro checks that the group_name is bigger than a number specified for every peer with setvar it should Hangup the call (frobidden,1 in the Gotoif...) but this<br>
is not happening, the AGI always continue with is process and it doesn´t play attention to the Hangup in the macro, the macro is here:<br>
<br>
[macro-check-call-limit]<br>
exten =&gt; s,1,Set(group_name=out_calls_user_${SIPCHANINFO(peername)})<br>
exten =&gt; s,n,Set(GROUP()=${group_name})<br>
exten =&gt; s,n,GotoIf($[${GROUP_COUNT(${group_name})} &gt; ${MAX_OUT_CALLS_PER_USER}] forbidden,1)<br>
; EXITO:<br>
exten =&gt; s,n,MacroExit<br>
; FRACASO:<br>
exten =&gt; forbidden,1,NoOp(*** llamada saliente bloqueada: el usuario ${SIPCHANINFO(peername)} tiene actualmente ${MATH(${GROUP_COUNT(${group_name})})-1,int)} llamadas<br>
salientes)<br>
exten =&gt; forbidden,n,Hangup(21)  ; ISUP 21 = SIP 403 (Forbidden)<br>
</blockquote>
<br></div>
The concept of calling a macro from within an AGI seem convoluted, but may work. I&#39;ve never tried it.<br>
<br>
Any particular reason you don&#39;t want to put the logic of the macro in your AGI?<br><font color="#888888">
<br>
-- <br></font><div><div></div><div class="h5">
Thanks in advance,<br>
-------------------------------------------------------------------------<br>
Steve Edwards       <a href="mailto:sedwards@sedwards.com" target="_blank">sedwards@sedwards.com</a>      Voice: +1-760-468-3867 PST<br>
Newline                                              Fax: +1-760-731-3000</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"><br>-- <br>Salu2<br><span></span><br>

</div></div>