Hello Steven...<div><br></div><div>Sorry for my poor explanation...what i&#39;m trying to do is to invoke a Macro from my AGI, like this:</div><div><br></div><div>$agi-&gt;exec(&quot;Macro&quot;,&quot;check-call-limit&quot;);</div>
<div><br></div><div>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 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:</div>
<div><br></div><div><div>[macro-check-call-limit]</div><div>exten =&gt; s,1,Set(group_name=out_calls_user_${SIPCHANINFO(peername)})</div><div>exten =&gt; s,n,Set(GROUP()=${group_name})</div><div>exten =&gt; s,n,GotoIf($[${GROUP_COUNT(${group_name})} &gt; ${MAX_OUT_CALLS_PER_USER}] forbidden,1)</div>
<div>; EXITO:</div><div>exten =&gt; s,n,MacroExit</div><div>; FRACASO:</div><div>exten =&gt; forbidden,1,NoOp(*** llamada saliente bloqueada: el usuario ${SIPCHANINFO(peername)} tiene actualmente ${MATH(${GROUP_COUNT(${group_name})})-1,int)} llamadas salientes)</div>
<div>exten =&gt; forbidden,n,Hangup(21)  ; ISUP 21 = SIP 403 (Forbidden)</div></div><div><br></div><div><br></div><div>What should i do to finish the macro if this macro reachs the Hangup?</div><div><br></div><div>Thanks for your help my friend!</div>
<div><br></div><div><br></div><div><div class="gmail_quote">2010/9/2 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>
&gt; I need to finish an AGI script when it invokes a macro from dialplan,<br>
&gt; how can i do that? it&#39;s quite confusing...the macro is making a hangup<br>
&gt; but the script continues....<br>
<br>
</div>I don&#39;t understand your question, but I&#39;m guessing it has something to do<br>
with:<br>
<br>
1) How to continue an AGI if a hangup occurs during execution -- trap HUP.<br>
<br>
2) How to execute an AGI after a hangup -- use deadagi() in the h<br>
extension<br>
<br>
3) The AGI is invoking a macro -- I have no clue with the level of detail<br>
provided.<br>
<font color="#888888"><br>
--<br>
Thanks in advance,<br>
-------------------------------------------------------------------------<br>
Steve Edwards       <a href="mailto:sedwards@sedwards.com">sedwards@sedwards.com</a>      Voice: +1-760-468-3867 PST<br>
Newline                                              Fax: +1-760-731-3000<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Salu2<br><span></span><br>
</div>