[Asterisk-Users] New Module app_perl
James Golovich
james at wwnet.net
Mon Jun 23 10:34:44 MST 2003
No point in reinventing the wheel here. PersistentPerl (aka SpeedyCGI)
can eliminate the startup cost for using perl with AGIs.
It works great, and even allows the processes to reuse database
connections
James
On Mon, 23 Jun 2003, Anthony Minessale wrote:
> That is probably possible and not too difficult.
>
> I learned what AGI was about 30 minutes after I was finished
> with the last revision of app_perl where I added support to
> launch a perl function in a thread
>
> (BTW I am suspicious that you
> may ironically need perl with no threads compiled for it to work right
> in asterisk despite the fact that you gain thread functionality via asterisk)
>
> I have not really carefully looked at AGI yet but from what I remember
> It communicates with the ext process via STDIN and looks at the ENV
> for information. so what I think you would need would be a fake ENV and a special variable to contain the same info that would have been sent to STDIN created uniquely for each execution. This of course would be limiting the AGI to perl code so another method would be to make
> a function via the app_perl or a dedicated C module to run all the agi app
> at startup and leave them open speaking back and forth over IO stream.
>
> I do notice I started stepping on the toes of AGI because I never heard of
> it while I was coding my module so I think some of the things that AGI does can also be accomplished on app_perl
>
>
> The 3 things I was dreaming of when I was working on it were:
>
> 1) If the module has the power to create extensions then you can use
> it to fetch that data from a database on startup or in mid run.
>
>
> 2) If the module can run threads It could implement
> an external listener of some sort and communicate with
> a partner thread over shared memory and with the world
> over sockets, tcpip etc (web server) I had a demo working
> where you could go to the asterisk on a web browser an see
> a readout like "number is 0" then if you dial into a certain ext
> with a phone the number increments and when you reload the
> web page it said "number is 1" and so on.
>
>
More information about the asterisk-users
mailing list