User Tools

Site Tools


devel:kamailio-5.0-design

This is an old revision of the document!


Kamailio v5.0 Design

Overview

After 15 years of development, it is time for Kamailio v5.0.

This page collects suggestions and ideas for major refactoring of various components to make the leap to v5.0.

When adding a remark that needs to be tracked by author, use initials in front of the paragraph. The list of contributors to this document and initials:

  • Daniel-Constantin Mierla (dcm)

Initial Remarks

Initial content for this document is listing also ideas popped up during discussions at Fosdem 2016 and Kamailio Development Workshop - among participants: Camille Oudout, Daniel-Constantin Mierla, Federico Cabiddu, Giacomo Vacca, Henning Westerholt, Olle E. Johansson, Torrey Searle, Victor Seva.

Configuration File

Goals:

  • have at least one option of an optimized configuration file interpreter targeting high performance SIP routing deployments
  • have at least one option of a more flexible configuration language that allows:
    • extended language syntax
    • reloading routing rules at runtime

To achieve the above, following sub-sections collects the proposals for configuration file language.

Exporting Functions To Embedded Interpreters

  • define and implement an export interface from modules to embedded interpreters to automatically add new functions to embedded interpreters
  • it should be in a similar fashion as for adding functions to configuration file, but without fixup mechanism, so bare string/integer parameters can be provided by embedded interpreters

Interface fields:

  • submodule name in embedded interpreter
  • function name in embedded interpreter
  • parameter types
  • pointer to c function

Example:

// export t_reply(200, "OK")
 
sr_exapi_t mod_exapi[] = {
  { "sr.tm", "reply", {PARAM_INT, PARAM_STR, 0}, t_reply },
  { 0, 0, {0}, 0}
};

Routing Logic In Embedded Interpreters Scripting

  • writing the routing logic only in a scripting language supported via embedded interpreters
  • eventually setting core parameters, loading modules and setting modules' parameters are still done using the kamailio configuration file but all routing blocks should be possible to be written in an embedded language
  • routing logic in an embedded language should allow reloading at runtime without kamailio restart

Source Tree Structure

Goals:

  • group files per components to be easier to spot their role, especially the core, include files and utilities

Reorganizing Source Files Location

It was discussed in the past:

  • source code files should be relocated to have a better structure for include headers, core files, modules and internal libraries as well as utilities

Two models proposed:

  • a) only move core files in a new 'core' folder in the root directory
  • b) move all source code files for Kamailio in a new 'src' folder, with further re-organization with subfolders inside 'src'

Build System

Goals:

  • revising the build system based on Makefiles.

Reviewing Alternative Build Systems

Alternatives to analyze:

  • configure
  • cmake

Continuous Integration

Goals:

  • attempt to make a more consistent and “easy to contribute to” continuous integration eco-system

Unit Test Framework

Reviving the exiting unit testing or selecting another framework.

Minimal Unit Tests

Defining a minimum set of automatic tests that needs to be provided by each module:

  • a minimal config for loading the module, to be sure it doesn't have missing linking symbols
  • can be done with a config as simple as:
loadmodule "foo.so"

request_route {
  ;
}
  • or can require setting some module parameters or even loading other modules
devel/kamailio-5.0-design.1456820729.txt.gz · Last modified: 2016/03/01 09:25 by miconda