[asterisk-users] How to finish an AGI

Danny Dias ing.diasdanny at gmail.com
Thu Sep 2 16:15:33 CDT 2010


Hello Steven...

Sorry for my poor explanation...what i'm trying to do is to invoke a Macro
from my AGI, like this:

$agi->exec("Macro","check-call-limit");

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:

[macro-check-call-limit]
exten => s,1,Set(group_name=out_calls_user_${SIPCHANINFO(peername)})
exten => s,n,Set(GROUP()=${group_name})
exten => s,n,GotoIf($[${GROUP_COUNT(${group_name})} >
${MAX_OUT_CALLS_PER_USER}] forbidden,1)
; EXITO:
exten => s,n,MacroExit
; FRACASO:
exten => forbidden,1,NoOp(*** llamada saliente bloqueada: el usuario
${SIPCHANINFO(peername)} tiene actualmente
${MATH(${GROUP_COUNT(${group_name})})-1,int)} llamadas salientes)
exten => forbidden,n,Hangup(21)  ; ISUP 21 = SIP 403 (Forbidden)


What should i do to finish the macro if this macro reachs the Hangup?

Thanks for your help my friend!


2010/9/2 Steve Edwards <asterisk.org at sedwards.com>

> On Thu, 2 Sep 2010, Danny Dias wrote:
>
> > I need to finish an AGI script when it invokes a macro from dialplan,
> > how can i do that? it's quite confusing...the macro is making a hangup
> > but the script continues....
>
> I don't understand your question, but I'm guessing it has something to do
> with:
>
> 1) How to continue an AGI if a hangup occurs during execution -- trap HUP.
>
> 2) How to execute an AGI after a hangup -- use deadagi() in the h
> extension
>
> 3) The AGI is invoking a macro -- I have no clue with the level of detail
> provided.
>
> --
> Thanks in advance,
> -------------------------------------------------------------------------
> Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
> Newline                                              Fax: +1-760-731-3000
>
> --
> _____________________________________________________________________
> -- 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
>



-- 
Salu2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100902/dc59b2e7/attachment.htm 


More information about the asterisk-users mailing list