[SR-Users] Perl Code Execution via kamailio.cfg fails

Watkins, Bradley Bradley.Watkins at compuware.com
Wed Jul 14 14:08:33 CEST 2010


 

> 
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

> From: sr-users-bounces at lists.sip-router.org 
> [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of 
> "Nicolas Rüger"
> Sent: Wednesday, July 14, 2010 6:18 AM
> To: sr-users at lists.sip-router.org
> Subject: [SR-Users] Perl Code Execution via kamailio.cfg fails
> 
> Hello,
> 
> I try to execute some PERL-code within kamailio v3 for some 
> research due to my thesis. I'm using debian lenny, 
> kamailio_3.0.0 and perl_5.10.0.
> 
> I added the follwoing lines to "kamailio.cfg":
> 
>   loadmodule "perl.so"
>   modparam("perl", "filename", "/opt/kamailio-3.0.0/PERL/myperl.pl")
>   modparam("perl", "modpath", "/opt/kamailio-3.0.0/lib/kamailio/perl")
> 
> I added a subroutine called "myprint" to the file "myperl.pl" 
> for testing.
> 
> I tried to exec the subroutine by adding the following line 
> to "kamailio.cfg" just before "Routing Logic" (...even tried 
> within "route{..}") as described in the perl_module description :
> 
>   perl_exec_simple("myperl");
> 

This is incorrect, unless you have a function named "myperl" inside of your script "myperl.pl".  The perl_exec() and perl_exec_simple() calls are looking for a named function inside of the file you declare in your modparam.

Regards,
- Brad




More information about the sr-users mailing list