I found the problem. It was with the shared library path. After setting the system
environmental variable LD_LIBRARY_PATH appropriately it worked fine.
$ export LD_LIBRARY_PATH=<my custom lib path>:$LD_LIBRARY_PATH
$ ./sbin/kamailio -E -d -f /home/ajay/projects/video_conf/etc/kamailio/kamailio.cfg
From: sr-users-bounces(a)lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org]
On Behalf Of Ajay Sabat
Sent: Wednesday, January 16, 2013 12:57 PM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: [SR-Users] Error while loading modules, if given a custom library path
Hi
I have trouble loading modules from a custom lib directory. It works fine if the libraries
are located under PREFIX/lib/Kamailio/ (PREFIX is the path that I gave while building
Kamailio). But on the target I will have to keep the libraries in a custom directory.
I tried by changing the mpath in kamailio.cfg. Also I tried by giving the path in -L
option while invoking kamailio. It is not working. It fails with the following errors,
even if the libraries are present at the location where it compains.
I searched but couldn't find any answer why it is failing, though it is supposed to
work. Please help me.
$ ./sbin/kamailio -E -d -f /home/ajay/projects/video_conf/etc/kamailio/kamailio.cfg -c
loading modules under
/home/ajay/projects/video_conf/lib/kamailio/:/home/ajay/projects/video_conf/lib/kamailio/modules/:/home/ajay/projects/video_conf/lib/kamailio/modules_k/
0(27896) ERROR: <core> [sr_module.c:572]: ERROR: load_module: could not open module
</home/ajay/projects/video_conf/lib/kamailio/modules_k/mi_fifo.so>: libkmi.so.1:
cannot open shared object file: No such file or directory
0(27896) : <core> [cfg.y:3591]: parse error in config file
/home/ajay/projects/video_conf/etc/kamailio/kamailio.cfg, line 222, column 12-23: failed
to load module
0(27896) ERROR: <core> [sr_module.c:572]: ERROR: load_module: could not open module
</home/ajay/projects/video_conf/lib/kamailio/modules_k/kex.so>: libkmi.so.1: cannot
open shared object file: No such file or directory
0(27896) : <core> [cfg.y:3591]: parse error in config file
/home/ajay/projects/video_conf/etc/kamailio/kamailio.cfg, line 223, column 12-19: failed
to load module
0(27896) ERROR: <core> [sr_module.c:572]: ERROR: load_module: could not open module
</home/ajay/projects/video_conf/lib/kamailio/modules_k/tmx.so>: libkmi.so.1: cannot
open shared object file: No such file or directory
0(27896) : <core> [cfg.y:3591]: parse error in config file
/home/ajay/projects/video_conf/etc/kamailio/kamailio.cfg, line 225, column 12-19: failed
to load module
0(27896) ERROR: <core> [sr_module.c:572]: ERROR: load_module: could not open module
</home/ajay/projects/video_conf/lib/kamailio/modules/sl.so>: libkcore.so.1: cannot
open shared object file: No such file or directory
$ ls -l /home/ajay/projects/video_conf/lib/kamailio/modules_k/mi_fifo.so
-rwxr-xr-x 1 ajay ajay 155651 Jan 16 09:58
/home/ajay/projects/video_conf/lib/kamailio/modules_k/mi_fifo.so
$ ls -l /home/ajay/projects/video_conf/lib/kamailio/libkmi.so*
lrwxrwxrwx 1 ajay ajay 13 Jan 16 09:56
/home/ajay/projects/video_conf/lib/kamailio/libkmi.so -> libkmi.so.1.0
lrwxrwxrwx 1 ajay ajay 13 Jan 16 09:56
/home/ajay/projects/video_conf/lib/kamailio/libkmi.so.1 -> libkmi.so.1.0
-rwxr-xr-x 1 ajay ajay 78111 Jan 16 09:56
/home/ajay/projects/video_conf/lib/kamailio/libkmi.so.1.0
Regards,
Ajay