Hi, We are using asterisk 1.4 and we use a Perl script to record some specific calls. As far, everything is working well. I was thinking about create a module in order to improve script's performance. I checked the Russell's blog: http://www.russellbryant.net/blog/2008/06/19/how-to-write-an-asterisk-module-part-1/ This is a old post and I would like to know if there are something new. Is it a good idea to move to module? Thanks in advance, Adrian Abramovich -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110708/f88c264d/attachment.htm>
On Fri, Jul 8, 2011 at 10:39 AM, Adrian Abramovich < adrianabramovich at gmail.com> wrote:> Hi, > > We are using asterisk 1.4 and we use a Perl script to record some specific > calls. As far, everything is working well. > I was thinking about create a module in order to improve script's > performance. > I checked the Russell's blog: > > http://www.russellbryant.net/blog/2008/06/19/how-to-write-an-asterisk-module-part-1/ > This is a old post and I would like to know if there are something new. >What I do, is look at the other apps/funcs for guidance. Pick the smallest first, and you can copy their style and layout. The module spec has evolved from 1.4 to 1.6 to 1.8, but it's the same basics (to a degree).> Is it a good idea to move to module? >If it increases performance, and you need that, then heck yes! The only drawback is that it *is* in the source; you'll have to tweak it as you move up the versions. You have to compile and install it. Perl would remain static (I would imagine) even when you update asterisk.> Thanks in advance, > > Adrian Abramovich > > > > > -- > _____________________________________________________________________ > -- 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 >-- Steve Murphy ParseTree Corporation 57 Lane 17 Cody, WY 82414 ? murf at parsetree.com ? 307-899-5535 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110708/2baaff61/attachment.htm>
On Fri, 8 Jul 2011, Adrian Abramovich wrote:> We are using asterisk 1.4 and we use a Perl script to record some > specific calls. As far, everything is working well. I was thinking about > create a module in order to improve script's performance.(I'm assuming you're executing your Perl script as an AGI.) I'd vote for re-writing your Perl script in C. Once you get past the small* hit for process creation and AGI environment setup, the execution time should be very similar between C code executing as a module and C code executing as an AGI. The advantages of an AGI over a module are: ) You already know the AGI environment. ) Writing an AGI is probably an order of magnitude easier than writing a module. The 'environment' is much simpler, stable between Asterisk versions and better defined. ) Debugging an AGI is probably a couple of orders of magnitude easier than debugging a module because it is usually a single threaded process and you can (within obvious limitations) 'desk test' your code completely external to Asterisk. ) You'll get more support on the mailing lists. A lot more people know how to write and debug an AGI than know how to write and debug a module. ) When (not if) you hit a bug, it only takes out your AGI, not the entire Asterisk process. The damage is limited to a single call, not all calls in flight. *) You can execute hundreds of AGIs written in C in the time it takes to load the Perl interpreter and parse your script. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
El 08/07/11 12:50, Steve Edwards escribi?:> *) You can execute hundreds of AGIs written in C in the time it takes > to load the Perl interpreter and parse your script.Just curious... have you timed this to demonstrate? ----------------------------------------------------------------------------------- Este mensaje y sus anexos son para uso exclusivo de sus destinatarios y puede contener informacion confidencial y/o privada protegida legalmente. Si usted no es el destinatario, se le notifica que cualquier distribucion o reproduccion de este mensaje, o de cualquiera de sus anexos, esta estrictamente prohibida. Si usted ha recibido este mensaje por error, por favor notifiquenos inmediatamente y elimine su texto original, incluidos los anexos y destruya cualquier reproduccion del mismo. Las opiniones expresadas en este mensaje son responsabilidad exclusiva de quien las emite y no necesariamente reflejan la posicion de Millenium Phone Center S.A, ni comprometen la responsabilidad institucional por el uso que el destinatario haga de las mismas. -----------------------------------------------------------------------------------