Hello,

 

just creating a shared library only with the MODULE_VERSION export will not work. Kamailio expects more function in the module to be present and also other exports.

 

One way to start is probably to take a small module (like cfgutils) and use this as foundation for extension. The print module might be also ok, but as it comes from the SER side, it is missing e.g. the KEMI support.

 

Cheers,

 

Henning

 

--

Henning Westerholt – https://skalatan.de/blog/

Kamailio services – https://gilawa.com

 

From: sr-dev <sr-dev-bounces@lists.kamailio.org> On Behalf Of Tyler Moore
Sent: Friday, April 24, 2020 10:14 PM
To: sr-dev@lists.kamailio.org
Subject: [sr-dev] Custom kamailio modules

 

Hey devs got a question about loading custom modules.

 

This is my first kamailio module so if I am missing some gotchas please refer me to the proper documentation.

I created a shared lib and included the module version info like so:

 

#define NAME "kamailio"
#define VERSION "5.3"
#define ARCH "x86_64"
#define OS_QUOTED "GNU/Linux"

...


MODULE_VERSION

 

I tried loading the module in a vanilla kamailio 5.3 install on debian 9 (stretch) and it seems sr_module.c can't find the module version info:

 

ERROR: <core> [core/sr_module.c:325]: version_control(): no version info in module </usr/lib/x86_64-linux-gnu/kamailio/modules/dsiprouter.so>: /usr/lib/x86_64-linux-gnu/kamailio/modules/dsiprouter.so: undefined symbol: module_version

 

But MODULE_VERSION should be defining this variable..

Running string on the shared lib shows it is being defined:

 

> strings lib/dsiprouter.so | grep module_version
module_version
MODULE_VERSION char *module_version=SER_FULL_VERSION; char *module_flags=SER_COMPILE_FLAGS; unsigned int module_interface_ver=MODULE_INTERFACE_VER;
module_version

 

 

Is this a linking issue? Why does is seem that module_versino is referenced before being defined when i'm following the example from https://github.com/kamailio/kamailio/blob/5.1/src/modules/print/print.c ?