[asterisk-users] How to finish an AGI

Edwin Quijada listas_quijada at hotmail.com
Sat Sep 4 12:16:59 CDT 2010


IMHO, is more easy in Perl that in dialplan but if for you work ......

*-------------------------------------------------------* 
*-Edwin Quijada 
*-Developer DataBase 
*-JQ Microsistemas 

*-Soporte PostgreSQL

*-www.jqmicrosistemas.com
*-809-849-8087
*-------------------------------------------------------*





Date: Fri, 3 Sep 2010 10:29:02 +0200
From: ing.diasdanny at gmail.com
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] How to finish an AGI

>Any particular reason you don't want to put the logic of the macro in your AGI?

Yes...i've no idea how to do it...it's a PERL script, i'm already checking how to do this...but it will be a little complicated :( 



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

On Thu, 2 Sep 2010, Danny Dias wrote:




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)




The concept of calling a macro from within an AGI seem convoluted, but may work. I've never tried it.



Any particular reason you don't want to put the logic of the macro in your AGI?



-- 

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





-- 
_____________________________________________________________________
-- 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/20100904/79d51dd7/attachment.htm 


More information about the asterisk-users mailing list