[sr-dev] Kamailio 5.0 - Routing blocks in Lua or Python

Daniel-Constantin Mierla miconda at gmail.com
Wed May 4 08:26:17 CEST 2016


Hello,

I want to announce that the framework (named kemi) which allows writing
the routing blocks in an embedded language is already in place. Lua or
Python can be use as alternative to the native scripting language to
write the routing blocks. More details can be found at:

  - https://www.kamailio.org/wiki/devel/config-engines

Example of scripts that offer more or less same features as
etc/kamailio-basic.cfg are available in source tree at examples/kemi.
For convenience of reading, here are the links to git repository:

 - the common file setting global and modules parameters as well as
specifying the config engine:

 
https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi.cfg

- the part of config with routing blocks in native language:

 
https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-native.cfg

- the part of config with routing blocks in Lua:

 
https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-lua.lua

- the part of config with routing blocks in Python:

 
https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-python.py

You can compare the last three above and see how different or similar
they look for providing same SIP routing features using different languages.

A lot of modules need to export now functions to embedded config
interface, which is quite straightforward:

 
https://www.kamailio.org/wiki/devel/config-engines#exporting_functions_to_kemi

The main missing part is dealing with event_route blocks -- I will send
a separate email to discuss that.

Interesting that some incipient performance tests to compare the
interpreters show good results for using especially Lua but also Python:

  -
https://www.kamailio.org/wiki/devel/config-engines#interpreters_performances

Anyone willing to help can start exporting functions from modules to
embedded interface or test some more complex configs in Lua or Python.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160504/8a05c883/attachment-0001.html>


More information about the sr-dev mailing list