[asterisk-users] Asterisk 1.4.30 is slow sending STDIN to AGI script

Steve Edwards asterisk.org at sedwards.com
Thu Apr 29 13:19:28 CDT 2010


Un-top-posting...

>>> On Wed, 28 Apr 2010, Ryan Bullock wrote:
>>>
>>>> Looking at the Asterisk::AGI docs, maybe try calling ReadParse() 
>>>> early in the script to read in anything from stdin?
>>>>
>>>> (From the docs)
>>>> # pull AGI variables into %input
>>>> %input = $AGI->ReadParse();
>
>> On Wed, Apr 28, 2010 at 09:34:18AM -0700, Steve Edwards wrote:
>>>
>>> "early" == "before (any interaction with Asterisk || exit)"
>
> On Thu, 29 Apr 2010, Tzafrir Cohen wrote:
>
>> Any reason Asterisk::AGI shouldn't do that automatically?
>
> A good question for the author of Asterisk::AGIwrap.
>
> When I wrote my AGI library for C, I thought about it but ultimately 
> didn't. If I ever get around to "publishing" my code I would add it just 
> to raise the success rate for first time users.

On Thu, 29 Apr 2010, Danny Nicholas wrote:

> Speaking from a "Perl'er" perspective, there's no good reason that 
> Asterisk::AGI shouldn't do the ReadParse automatically except that it 
> requires the module author to do something that the user should be doing 
> as a "best practice" and could lead to unexpected errors in a reuse 
> environment.  IMO there could be more and better Perl modules out there 
> for use, but I think that most serious Asterisk users probably take 
> Steve's advice and leave Perl for C once they pass point X.  That or 
> they are masochistic PHP users :)

The OP's code was using Asterisk::AGIwrap. I'm not a Perl weenie, but I 
think this is an "in-house" package -- Google can't find anything 
relevant.

Adding a simple "have I been initialized?" check at the start of each 
function would help the first time user and would not lead to a reuse 
issue.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list