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

"Nicolas Rüger" NicolasRueger at gmx.de
Thu Jul 15 13:14:26 CEST 2010


Hello,

finally found kind of a solution for both of my problems:

1.) 
Printing ERRORs to stderr didn't work as I started Kamailio with "./kamctl start" instead of "./kamailio"...stupid mistake...

BUT 

still don't know why Kamailio isn't writing to "syslogs" when "log_stderror=no" is set in "kamailio.cfg" (using "debian lenny")

and

still don't know why just "xlog()" works, but "log()" doesn't seem to have an effect.

2.)
My Perlscript got executed finally. I used the following command in "kamailio.cfg" in the end.

   perl_exec_simple("myprint");

My script/subroutine "myprint" actually is writing a control string in another file...just for testing...

I finally used an absolute path instead of an relative path in the perlscript for the filehandle. That worked out then. 

BUT

still don't know where Kamailio is trying to open the filehandle when I use a relative path as it's not working then. 

Note: 
When I execute the subroutine from another perlscript it works out perfectly using a relative path for the filehandle.


However....thank you for your help and hints so far!!


Regards,
Nicolas


-------- Original-Nachricht --------
> Datum: Wed, 14 Jul 2010 19:31:45 +0200
> Von: Henning Westerholt <henning.westerholt at 1und1.de>
> An: "Nicolas Rüger" <NicolasRueger at gmx.de>
> CC: "sr-users at lists.sip-router.org" <sr-users at lists.sip-router.org>
> Betreff: Re: [SR-Users] Perl Code Execution via kamailio.cfg fails

> On Wednesday 14 July 2010, Nicolas Rüger wrote:
> > I actually start "Wireshark" just while testing the connection as I
> didn't
> >  know any other way. It's been a whole test environment for my thesis
> >  anyway.
> > 
> > I'm sure the call is routed via the Kamailio as Wireshark shows me that
> the
> >  INVITE is sent from client_1 to Kamailio and from Kamailio to client_2
> >  afterwards.
> > The Perl function is still not excecuted. :(
> 
> Hello Nicolas,
> 
> ok, i understand. Then its even more strange.
>  
> 
> > 
> > Coming back to the logs: No logs from Kamailio are found in in
> >  "/var/log/syslog".
> > 
> > I tried to change the logging target using this tutorial but didn't
> work:
> > 
> >
> http://www.kamailio.org/dokuwiki/doku.php/utils:basic-syslog-configuration
> > 
> > What can I do?
> > 
> > How to set up proper logging?
> 
> Just to progress with the first problem you could just enable log to
> stderr 
> (http://sip-router.org/wiki/cookbooks/core-cookbook/devel#log_stderror):
> 
> $ ./ser -f foo.cfg
> Listening on
>              udp: 127.0.0.1:5060
>              tcp: 127.0.0.1:5060
> Aliases:
>              tcp: localhost:5060
>              udp: localhost:5060
> 
>  0(22861) INFO: <core> [tcp_main.c:4144]: init_tcp: using epoll_lt as the
> io 
> watch method (auto detected)
>  0(22863) INFO: <core> [udp_server.c:173]: INFO: udp_init: SO_RCVBUF is 
> initially 114688
>  0(22863) INFO: <core> [udp_server.c:224]: INFO: udp_init: SO_RCVBUF is 
> finally 262142
>  0(22863) INFO: <core> [udp_server.c:173]: INFO: udp_init: SO_RCVBUF is 
> initially 114688
>  0(22863) INFO: <core> [udp_server.c:224]: INFO: udp_init: SO_RCVBUF is 
> finally 262142
> $ cat foo.cfg
> debug=2
> log_stderror=yes
> 
> route{;}
> $
> 
> Maybe you need somehow change your system logging cfg, this should be
> easier 
> if you use a local log facility.
> 
> Regards,
> 
> Henning
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the sr-users mailing list