[sr-dev] Custom kamailio modules

Henning Westerholt hw at skalatan.de
Mon Apr 27 16:51:42 CEST 2020


Hello Tyler,

Henning is fine. 😉 Please keep the list in cc, that other people can also participate.

I think there are some people that use llvm/clang for kamailio on the list that might be able to help. I personally work mostly with gcc on Kamailio. About cmake – well this is not the system that is used right now in Kamailio.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com<https://gilawa.com/>

From: Tyler Moore <tmoore at goflyball.com>
Sent: Monday, April 27, 2020 4:17 PM
To: Henning Westerholt <hw at skalatan.de>
Subject: Re: [sr-dev] Custom kamailio modules

Thanks for the quick reply Mr. Westerholt.

I was able to get it working using the makefile workflow that was present which brings me back to my original revised question.
How could I integrate a different toolchain for my workflow, for completeness lets say llvm/clang and cmake.
The Makefile's seem to setup a lot of compiler flags and i'm assuming that would be a good place to start but your opinion would be much appreciated as well.

Regards,

Tyler Moore<https://devopsec.net/>
Full Stack Software Engineer<http://www.google.com/search?q=full+stack+software+engineer+job+description>
Flyball Labs<http://goflyball.com/>
Office: 888-907-2085, ext: 34<tel:8889072085;ext=34>
Cell: 248-909-2769<tel:2489092769>
Email: tmoore at goflyball.com<mailto:tmoore at goflyball.com>


On Mon, Apr 27, 2020 at 6:24 AM Henning Westerholt <hw at skalatan.de<mailto:hw at skalatan.de>> wrote:
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<https://gilawa.com/>

From: sr-dev <sr-dev-bounces at lists.kamailio.org<mailto:sr-dev-bounces at lists.kamailio.org>> On Behalf Of Tyler Moore
Sent: Friday, April 24, 2020 10:14 PM
To: sr-dev at lists.kamailio.org<mailto:sr-dev at 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 ?

Regards,

Tyler Moore<https://devopsec.net/>
Full Stack Software Engineer<http://www.google.com/search?q=full+stack+software+engineer+job+description>
Flyball Labs<http://goflyball.com/>
Office: 888-907-2085, ext: 34<tel:8889072085;ext=34>
Cell: 248-909-2769<tel:2489092769>
Email: tmoore at goflyball.com<mailto:tmoore at goflyball.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200427/d64947ef/attachment-0001.html>


More information about the sr-dev mailing list