Hi everybody,
since last friday, OpenSER HEAD has a new module, called perl. As the name suggests, it incorporates a Perl interpreter within OpenSER.
What can you do with it? ======================== The perl module lets you request information from the SIP message currently active, lets you make decisions based on that information and finally modify the SIP message.
In other words, you can do almost everything you could have done in the OpenSER configuration file, plus much, much more.
How do I use it? ================ The perl module should be automatically compiled in current CVS checkouts of the HEAD branch, as long as you have a fairly recent Perl version (including possibly necessary development packages) installed on your system. Load it in your OpenSER configuration just like all the other modules.
Set the two module parameters "filename" and "modpath"; the first one points to your perl script (samples are included in the doc directory), the second points to the path where the Perl packages reside (they currently are not "installed" anywhere automatically. Feel free to do that yourself).
In the configuration file, you may then call the functions defined in your Perl script with the "perl_exec" and "perl_exec_simple" functions. The samples and the README file should tell you more about it.
What should the Perl script look like? ====================================== Please take a look at the doc/samples directory located in the perl module directory. They should give you an introduction of how such a script could look like.
The full API is described in the README file.
The module documentation on the OpenSER website is not 100% apt as of now, but should be updated during the next days.
Great! And now? =============== Please feel free to test the perl module. Although it currently runs fine for me, deployment in production environments is not recommended. Tell me about your experiences and any bugs you found. If you write a test script, I'd be thankfull if you send it to me for inclusion as a sample.
If you have any questions or remarks, please send a mail to the users or developer mailing lists (depending on the focus), or directly to me.
Thx for your attention, Regards, Bastian
Hello Bastian,
thanks for the contribution. The html documentation of the module is now available on OpenSER site as well:
http://www.openser.org/docs/modules/1.2.x/perl.html
If I am not wrong, this should be something similar to AGI interface in Asterisk -- one can access and update from Perl applications the internals (exported functions, structures ...) of OpenSER. Sonce here is a lot to explore, I will open a dokuwiki page dedicated to this extension, to let users share experiences.
Cheers, Daniel
On 12/11/06 12:41, Bastian Friedrich wrote:
Hi everybody,
since last friday, OpenSER HEAD has a new module, called perl. As the name suggests, it incorporates a Perl interpreter within OpenSER.
What can you do with it?
The perl module lets you request information from the SIP message currently active, lets you make decisions based on that information and finally modify the SIP message.
In other words, you can do almost everything you could have done in the OpenSER configuration file, plus much, much more.
How do I use it?
The perl module should be automatically compiled in current CVS checkouts of the HEAD branch, as long as you have a fairly recent Perl version (including possibly necessary development packages) installed on your system. Load it in your OpenSER configuration just like all the other modules.
Set the two module parameters "filename" and "modpath"; the first one points to your perl script (samples are included in the doc directory), the second points to the path where the Perl packages reside (they currently are not "installed" anywhere automatically. Feel free to do that yourself).
In the configuration file, you may then call the functions defined in your Perl script with the "perl_exec" and "perl_exec_simple" functions. The samples and the README file should tell you more about it.
What should the Perl script look like?
Please take a look at the doc/samples directory located in the perl module directory. They should give you an introduction of how such a script could look like.
The full API is described in the README file.
The module documentation on the OpenSER website is not 100% apt as of now, but should be updated during the next days.
Great! And now?
Please feel free to test the perl module. Although it currently runs fine for me, deployment in production environments is not recommended. Tell me about your experiences and any bugs you found. If you write a test script, I'd be thankfull if you send it to me for inclusion as a sample.
If you have any questions or remarks, please send a mail to the users or developer mailing lists (depending on the focus), or directly to me.
Thx for your attention, Regards, Bastian
Hi Bastian,
one small update - the perl module is not automatically compiled as it depends on an external library (which may or may not be installed).
regards, bogdan
Bastian Friedrich wrote:
Hi everybody,
since last friday, OpenSER HEAD has a new module, called perl. As the name suggests, it incorporates a Perl interpreter within OpenSER.
What can you do with it?
The perl module lets you request information from the SIP message currently active, lets you make decisions based on that information and finally modify the SIP message.
In other words, you can do almost everything you could have done in the OpenSER configuration file, plus much, much more.
How do I use it?
The perl module should be automatically compiled in current CVS checkouts of the HEAD branch, as long as you have a fairly recent Perl version (including possibly necessary development packages) installed on your system. Load it in your OpenSER configuration just like all the other modules.
Set the two module parameters "filename" and "modpath"; the first one points to your perl script (samples are included in the doc directory), the second points to the path where the Perl packages reside (they currently are not "installed" anywhere automatically. Feel free to do that yourself).
In the configuration file, you may then call the functions defined in your Perl script with the "perl_exec" and "perl_exec_simple" functions. The samples and the README file should tell you more about it.
What should the Perl script look like?
Please take a look at the doc/samples directory located in the perl module directory. They should give you an introduction of how such a script could look like.
The full API is described in the README file.
The module documentation on the OpenSER website is not 100% apt as of now, but should be updated during the next days.
Great! And now?
Please feel free to test the perl module. Although it currently runs fine for me, deployment in production environments is not recommended. Tell me about your experiences and any bugs you found. If you write a test script, I'd be thankfull if you send it to me for inclusion as a sample.
If you have any questions or remarks, please send a mail to the users or developer mailing lists (depending on the focus), or directly to me.
Thx for your attention, Regards, Bastian
Hi Bogdan,
Am Montag, 11. Dezember 2006 12:38 schrieb Bogdan-Andrei Iancu:
one small update - the perl module is not automatically compiled as it depends on an external library (which may or may not be installed).
thank you for that update. I missed the fact that you exclude the perl module in the Makefile now.
So: to build the perl module, use make include_modules="perl" all make include_modules="perl" install (or add the "include_modules" statement to whatever you "make" call looks like :)
Thx again, Bastian Friedrich
Hi Bastian,
I'm trying to compile the perl module on Debian, but from docs is not very clear what libs are required (is written just Perl). Is it about libperl or libperl-dev ??
thanks and regards, bogdan
Bastian Friedrich wrote:
Hi Bogdan,
Am Montag, 11. Dezember 2006 12:38 schrieb Bogdan-Andrei Iancu:
one small update - the perl module is not automatically compiled as it depends on an external library (which may or may not be installed).
thank you for that update. I missed the fact that you exclude the perl module in the Makefile now.
So: to build the perl module, use make include_modules="perl" all make include_modules="perl" install (or add the "include_modules" statement to whatever you "make" call looks like :)
Thx again, Bastian Friedrich
Hi Bogdan,
On Tuesday 12 December 2006 16:00, Bogdan-Andrei Iancu wrote:
I'm trying to compile the perl module on Debian, but from docs is not very clear what libs are required (is written just Perl).
A "full perl installation" would include all the files from perl, libperl, and libperl-dev. Right, nobody installs perl from the sources :)
Is it about libperl or libperl-dev ??
libperl-dev includes /usr/lib/libperl.so (just as a softlink to libperl5.8's /usr/lib/libperl.so.5.x). This is necessary for the module to work.
Thus: On debian, you should at least install perl, perl-base, perl-modules, libperl5.8 and libperl-dev.
There are a lot of additional perl modules that might make sense in the context of the module, so you might want to install some lib*-perl packages as well, but they are not necessary for the base functionality. My primary intent, accessing LDAP from within OpenSER, would depend on libnet-ldap-perl, for example (in fact, the LDAPUtils modules included in my sources use that debian package).
Sorry for not pointing this out any better. There are big differences between different distributions (I'm using SuSE here, their package naming scheme is different here and there). Is there a dedicated list of supported OS and/or Linux distributions of OpenSER anywhere?
Please tell me if you can successfully use the module when the debian packages mentioned above are installed.
Thx & Regards, Bastian
Bastian,
I totally agree with you that you may add a lot of perl libs, depending of what exactly are you doing in the perl scripts called from the module.
I was referring to the minimal lib dependency in order to get the module compile from C point of view. According to my tests, libperl-dev (and all its dependencies) is enough. I guess it is a pretty common lib on most of the UNIX systems.
my suggestion is to list in docs the "libperl-dev" library as module external dependency, instead of the generic "Perl".
thanks and regards, bogdan
Bastian Friedrich wrote:
Hi Bogdan,
On Tuesday 12 December 2006 16:00, Bogdan-Andrei Iancu wrote:
I'm trying to compile the perl module on Debian, but from docs is not very clear what libs are required (is written just Perl).
A "full perl installation" would include all the files from perl, libperl, and libperl-dev. Right, nobody installs perl from the sources :)
Is it about libperl or libperl-dev ??
libperl-dev includes /usr/lib/libperl.so (just as a softlink to libperl5.8's /usr/lib/libperl.so.5.x). This is necessary for the module to work.
Thus: On debian, you should at least install perl, perl-base, perl-modules, libperl5.8 and libperl-dev.
There are a lot of additional perl modules that might make sense in the context of the module, so you might want to install some lib*-perl packages as well, but they are not necessary for the base functionality. My primary intent, accessing LDAP from within OpenSER, would depend on libnet-ldap-perl, for example (in fact, the LDAPUtils modules included in my sources use that debian package).
Sorry for not pointing this out any better. There are big differences between different distributions (I'm using SuSE here, their package naming scheme is different here and there). Is there a dedicated list of supported OS and/or Linux distributions of OpenSER anywhere?
Please tell me if you can successfully use the module when the debian packages mentioned above are installed.
Thx & Regards, Bastian
Hi Bogdan,
On Tuesday 12 December 2006 16:51, Bogdan-Andrei Iancu wrote:
I was referring to the minimal lib dependency in order to get the module compile from C point of view. According to my tests, libperl-dev (and all its dependencies) is enough. I guess it is a pretty common lib on most of the UNIX systems.
my suggestion is to list in docs the "libperl-dev" library as module external dependency, instead of the generic "Perl".
If someone _would_ build Perl on himself, he'd get all necessary files installed. This is probably very, very uncommon in fact. Listing Debian dependencies as the only dependency list is probably not apt, either.
I just commited some updates that leave the depency "Perl" inside, but add sections for dependencies on Debian and SuSE systems.
I might try compiling on Ubuntu systems, too, in the next weeks... :)
Best, Bastian
Thanks Bastian!
regards, Bogdan
Bastian Friedrich wrote:
Hi Bogdan,
On Tuesday 12 December 2006 16:51, Bogdan-Andrei Iancu wrote:
I was referring to the minimal lib dependency in order to get the module compile from C point of view. According to my tests, libperl-dev (and all its dependencies) is enough. I guess it is a pretty common lib on most of the UNIX systems.
my suggestion is to list in docs the "libperl-dev" library as module external dependency, instead of the generic "Perl".
If someone _would_ build Perl on himself, he'd get all necessary files installed. This is probably very, very uncommon in fact. Listing Debian dependencies as the only dependency list is probably not apt, either.
I just commited some updates that leave the depency "Perl" inside, but add sections for dependencies on Debian and SuSE systems.
I might try compiling on Ubuntu systems, too, in the next weeks... :)
Best, Bastian