Steve,<div><br><div>Yes, I'm executing the Perl script as an AGI.</div><div>Very useful points!.... I really appreciate them!.</div><div><br></div><div>Thanks,</div><div><br></div><div><br></div><div>Adrian Abramovich<br>
<br><div class="gmail_quote">On Fri, Jul 8, 2011 at 12:50 PM, Steve Edwards <span dir="ltr"><<a href="http://asterisk.org">asterisk.org</a>@<a href="http://sedwards.com">sedwards.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 8 Jul 2011, Adrian Abramovich wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
</blockquote>
<br></div>
(I'm assuming you're executing your Perl script as an AGI.)<br>
<br>
I'd vote for re-writing your Perl script in C.<br>
<br>
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.<br>
<br>
The advantages of an AGI over a module are:<br>
<br>
) You already know the AGI environment.<br>
<br>
) 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.<br>
<br>
) 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.<br>
<br>
) 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.<br>
<br>
) 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.<br>
<br>
*) You can execute hundreds of AGIs written in C in the time it takes to load the Perl interpreter and parse your script.<br><font color="#888888">
<br>
-- <br>
Thanks in advance,<br>
------------------------------<u></u>------------------------------<u></u>-------------<br>
Steve Edwards <a href="mailto:sedwards@sedwards.com" target="_blank">sedwards@sedwards.com</a> Voice: <a href="tel:%2B1-760-468-3867" value="+17604683867" target="_blank">+1-760-468-3867</a> PST<br>
Newline Fax: <a href="tel:%2B1-760-731-3000" value="+17607313000" target="_blank">+1-760-731-3000</a></font><div><div></div><div class="h5"><br>
<br>
--<br>
______________________________<u></u>______________________________<u></u>_________<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/<u></u>mailman/listinfo/asterisk-<u></u>users</a><br>
</div></div></blockquote></div><br></div></div>