Index of /ASTERISK/PERL/650dialup

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory  -
[TXT]AstMan.pm.txt11-Dec-2008 14:49 3.4K
[   ]app_perl.tgz11-Dec-2008 14:49 8.1K
[TXT]email.txt11-Dec-2008 14:49 3.3K

Asterisk -- A telephony toolkit for Linux. app_perl -- A Module To Incoperate Perl Into Asterisk. Copyright (C) 2003, Anthony Minessale Anthony Minessale app_perl 1.1 This is app_perl the "mod_perl" of sorts for asterisk. It is an actual live Perl Interpreter embeded in a module so when it starts up the perl stays resident in memory the whole life of the Asterisk process. FEATURES: It can call perl functions from extensions.conf in a special package called Asterisk::Embed that is loaded on startup from /etc/asterisk/asterisk_init.pm exten => 1,1,Perl,myfunc:arg_1:arg_2:arg_n...... It then does it's business and returns one or more special directives that are asterisk related operations processed by the module. they are returned as a list (array) of scalar each containing a specially formated command to feed back into asterisk via the C module. These are counterparts to the real directives found in extensions.conf only probably there is less error checking and more direct control a.k.a. likelyhood to crash. Valid regular return commands so far....... setvar:: goto:| add_ext::::::: runapp:: include:: ignorepat:: switch::: There are also some special return commands: (1 for now) thread: This will spin off a thread with the perl sub you specify running inside it. the sub will get 1 scalar arg being the number of times it was run (starting with 1) you can return an array full of more return commands listed above with 1 exception: if you put the keyword "loop" in the list, it will call the function again and increment the counter arg. You can use this for instance to run 1 thread to listen on a tcp port and populate a GLOBAL VARIABLE and use another to run in a loop and pass the contents of the GLOBAL back to asterisk and relaunch every 1 min or so. And of corse all this stuff can be used to horribly crash the program. I had a test where a perl coded web server answered port 80 and printed the value of a GLOBAL That could be incremented by dialing 7 on asterisk phones The function can return as many return commands as it wants but of course several goto or other such nonsense may not be too smart. The functions startup() and shutdown() are called respectively on load and unload of the module allowing you to create on the fly contexts and configuration by looking up data from a database,more files etc. you can even make the dialing of a certian extension cause a perl func to create more extensions or to rewrite the existing one on the fly. Of course, you can't do any channel related commands (runapp etc) from the startup function because there is no call in progress so they get ignored. BUGS: If you stare at the source code from about 2 feet back for approx 30 seconds you will start to see that the entire thing is in itself 1 large bug. I am not so much a C programmer as I am a Perl programmer so that was my motivation for this idea but it probably is sucky to some arrogant linux zelot somewhere out there. If that is you , ha ha I made you download it..... WARNING: I, of course, am not responsible for the damage you or my intelectual property (stupid program) do to your or anybody's PC (People don't kill PC's...................Micro$oft kills PC's) [hmm a shot at linux zelots and Micro$oft in the same file. Who ..DO.. i like....?]