<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>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:</p>
    <p>  - <a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/devel/config-engines">https://www.kamailio.org/wiki/devel/config-engines</a></p>
    <p>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:</p>
    <p> - the common file setting global and modules parameters as well
      as specifying the config engine:</p>
    <p> 
<a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi.cfg">https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi.cfg</a></p>
    <p>- the part of config with routing blocks in native language:</p>
    <p> 
<a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-native.cfg">https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-native.cfg</a></p>
    <p>- the part of config with routing blocks in Lua:</p>
    <p> 
<a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-lua.lua">https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-lua.lua</a></p>
    <p>- the part of config with routing blocks in Python:</p>
    <p> 
<a class="moz-txt-link-freetext" href="https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-python.py">https://github.com/kamailio/kamailio/blob/master/examples/kemi/kamailio-basic-kemi-python.py</a></p>
    <p>You can compare the last three above and see how different or
      similar they look for providing same SIP routing features using
      different languages.</p>
    <p>A lot of modules need to export now functions to embedded config
      interface, which is quite straightforward:</p>
    <p> 
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/devel/config-engines#exporting_functions_to_kemi">https://www.kamailio.org/wiki/devel/config-engines#exporting_functions_to_kemi</a></p>
    <p>The main missing part is dealing with event_route blocks -- I
      will send a separate email to discuss that.</p>
    <p>Interesting that some incipient performance tests to compare the
      interpreters show good results for using especially Lua but also
      Python:</p>
    <p>  -
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/devel/config-engines#interpreters_performances">https://www.kamailio.org/wiki/devel/config-engines#interpreters_performances</a></p>
    <p>Anyone willing to help can start exporting functions from modules
      to embedded interface or test some more complex configs in Lua or
      Python.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>