This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
devel:config-engines [2016/05/03 13:47] miconda [To-Do] |
devel:config-engines [2016/05/03 18:34] miconda |
||
---|---|---|---|
Line 382: | Line 382: | ||
</ | </ | ||
- | ===== Examples | + | ===== Basic IP Telephony Config Example |
Some examples of configuration files using the native, Lua or Python interpreter are available in Kamailio source tree inside the **examples/ | Some examples of configuration files using the native, Lua or Python interpreter are available in Kamailio source tree inside the **examples/ | ||
Line 390: | Line 390: | ||
The configuration file to start with is **kamailio-basic-kemi.cfg**: | The configuration file to start with is **kamailio-basic-kemi.cfg**: | ||
- | {{url>https:// | + | * https:// |
You can either rename it to kamailio.cfg or use **-f** command line option to point to it. | You can either rename it to kamailio.cfg or use **-f** command line option to point to it. | ||
Line 396: | Line 396: | ||
If started without any change and no define in command line, then Kamailio will continue to load the routing blocks in the native language, stored in the file **kamailio-basic-kemi-native.cfg**: | If started without any change and no define in command line, then Kamailio will continue to load the routing blocks in the native language, stored in the file **kamailio-basic-kemi-native.cfg**: | ||
- | {{url>https:// | + | * https:// |
If you define WITH_CFGLUA inside **kamailio-basic-kemi.cfg** or provide the command line parameter **-A WITH_CFGLUA**, | If you define WITH_CFGLUA inside **kamailio-basic-kemi.cfg** or provide the command line parameter **-A WITH_CFGLUA**, | ||
- | {{url>https:// | + | * https:// |
If you define WITH_CFGPYTHON inside **kamailio-basic-kemi.cfg** or provide the command line parameter **-A WITH_CFGPYTHON**, | If you define WITH_CFGPYTHON inside **kamailio-basic-kemi.cfg** or provide the command line parameter **-A WITH_CFGPYTHON**, | ||
- | {{url>https:// | + | * https:// |
Combining **kamailio-basic-kemi.cfg** with **kamailio-basic-kemi-native.cfg** results more or less in the **kamailio-basic.cfg** from the **etc/** folder in Kamailio source tree. The Lua and Python scripts are offering the same features, but written in another language. | Combining **kamailio-basic-kemi.cfg** with **kamailio-basic-kemi-native.cfg** results more or less in the **kamailio-basic.cfg** from the **etc/** folder in Kamailio source tree. The Lua and Python scripts are offering the same features, but written in another language. | ||
Line 457: | Line 457: | ||
Testing was done for registrations with user authentication, | Testing was done for registrations with user authentication, | ||
- | The values are in micro-seconds (1 / 1 000 000 of a second) and represents the average execution time, the minimum execution time and the maximum execution time. | + | The values are in micro-seconds (1 / 1 000 000 of a second) and represents the average execution time, the minimum execution time and the maximum execution time for request_route{...} block (or the equivalent of). |
The results were: | The results were: | ||
Line 474: | Line 474: | ||
Remarks: | Remarks: | ||
- | * the avverage | + | * the average |
* the test was run many times, the Native and Lua execution were close to each other, many times Lua being faster, but again, at small difference | * the test was run many times, the Native and Lua execution were close to each other, many times Lua being faster, but again, at small difference | ||
* no big surprise as Lua is calling directly the C bindings and its interpreter is written also in C. With the config used in the tests, the Lua script doesn' | * no big surprise as Lua is calling directly the C bindings and its interpreter is written also in C. With the config used in the tests, the Lua script doesn' | ||
- | * Python is slower comparing to Native and Lua, but not that much as one may expect. | + | * Python is slower comparing to Native and Lua, but not that much as one may expect. |
* in some tests, the maximum execution time was between 5000 and 10000 micro-second, | * in some tests, the maximum execution time was between 5000 and 10000 micro-second, | ||