– Kamailio SIP Server –

Module Makefiles and Building

The Makefile in each module subdirectory is small and simple to use. If you do not have any extra libraries or make definitions required to build your module, you can take the template below and just drop it into the top level directory of your new module.

Module directory structure

All OpenSER modules are kept in the sip-server/modules directory of the source code. To add your module to the build, just add a subdirectory with the same name as the module to the sip-server/modules directory and run make modules. The top level makefile will find the new code and include it into the build process.

Template Makefile

The following template is the minimum requirements to build your module. There are a few additional things you can include into the Makefile to customize it.

include ../../Makefile.defs
auto_gen=
NAME=MyMod.so
LIBS= 

include ../../Makefile.modules

The one and only required item is the NAME variable in the Makefile. You must set it to the final target name of the modules shared object.

Additional Makefile variables

There are few other makefile variables that you can override or append to in the Makefile to pass additional information to your build.

  • LIBS - Add any linker options you require to build the module. This would include the -llibrary and the -Lpath_to_library options if your module requires external libraries.
  • DEFS - Append any additional definitions you want to pass to the compiler when building your module. You can do this with the “+=” makefile operator. DEFS+=-DMY_NEW_DEFINE -I../../../external/includes

Module documentation

TBD