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 | ||
cookbooks:devel:core [2018/12/27 08:52] miconda [Global Parameters Section] |
cookbooks:devel:core [2019/03/01 15:31] miconda [reply_to_via] |
||
---|---|---|---|
Line 53: | Line 53: | ||
</ | </ | ||
+ | If you want to use a reserved config keyword as part of a parameter, you need to enclose it in quotes. See the example below for the keyword " | ||
+ | |||
+ | <code c> | ||
+ | listen=tcp: | ||
+ | </ | ||
==== Modules Settings Section ==== | ==== Modules Settings Section ==== | ||
Line 938: | Line 943: | ||
<code c> | <code c> | ||
kemi.onsend_route_callback=" | kemi.onsend_route_callback=" | ||
+ | </ | ||
+ | |||
+ | ==== kemi.received_route_callback ==== | ||
+ | |||
+ | Set the name of callback function in the KEMI script to be executed as the equivalent of `event_route[core: | ||
+ | |||
+ | Default value: none | ||
+ | |||
+ | Set it to empty string or " | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | kemi.received_route_callback=" | ||
</ | </ | ||
Line 1392: | Line 1411: | ||
==== pv_buffer_size ==== | ==== pv_buffer_size ==== | ||
- | The size in bytes of internal buffer to print dynamic strings with pseudo-variables inside. The default value is 8192 (8kB). | + | The size in bytes of internal buffer to print dynamic strings with pseudo-variables inside. The default value is 8192 (8kB). Please keep in mind that for xlog messages, there is a dedicated module parameter to set the internal buffer size. |
Example of usage: | Example of usage: | ||
Line 1422: | Line 1441: | ||
< | < | ||
rundir="/ | rundir="/ | ||
+ | </ | ||
+ | |||
+ | ==== received_route_mode ==== | ||
+ | |||
+ | Enable or disable the execution of event_route[core: | ||
+ | |||
+ | Default value: 0 (disabled) | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | <code c> | ||
+ | received_route_mode=1 | ||
</ | </ | ||
Line 1431: | Line 1462: | ||
reply_to_via=0 | reply_to_via=0 | ||
+ | | ||
+ | |||
+ | ==== route_locks_size ==== | ||
+ | |||
+ | Set the number of mutex locks to be used for synchronizing the execution of messages sharing the same Call-Id. In other words, enables Kamailio to execute sequentially the requests and replies received within the same dialog -- a new message received within the same dialog waits until the previous one is routed out. | ||
+ | |||
+ | For smaller impact on parallel processing, its value it should be at least twice the number of kamailio processes (children | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | route_locks_size = 256 | ||
+ | </ | ||
==== server_id ==== | ==== server_id ==== | ||
Line 2868: | Line 2912: | ||
</ | </ | ||
+ | |||
+ | The value can be a quoted string or integer number. | ||
Example: | Example: | ||
Line 3065: | Line 3111: | ||
- | SIP reply routing block executed by **tm** module. It contains a set of actions to be taken for SIP replies in the contect of an active transaction.. | + | SIP reply routing block executed by **tm** module. It contains a set of actions to be taken for SIP replies in the contect of an active transaction. |
The ' | The ' | ||
- | Main 'onreply_route' block is executed before a possible tm ' | + | Core 'reply_route' block is executed before a possible |
<code c> | <code c> | ||
Line 3123: | Line 3169: | ||
* groupid - should be the name of the module that triggers the event | * groupid - should be the name of the module that triggers the event | ||
* eventid - some meaningful short text describing the event | * eventid - some meaningful short text describing the event | ||
+ | |||
+ | === Core Event Routes === | ||
Implementations: | Implementations: | ||
Line 3134: | Line 3182: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | * **event_route[core: | ||
+ | * it has to be enabled with received_route_mode global parameter. For usage via Kemi, set kemi.received_route_callback global parameter. | ||
+ | * if drop is executed, the received message is no longer processed | ||
+ | |||
+ | <code c> | ||
+ | event_route[core: | ||
+ | xlog(" | ||
+ | if($rcv(srcip) == " | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | === Module Event Routes === | ||
+ | |||
+ | Here are only a few examples, to see if a module exports event_route blocks and when they are executed, check the readme of the module. | ||
+ | |||
* **event_route[htable: | * **event_route[htable: | ||
Line 3174: | Line 3239: | ||
* **event_route [tm: | * **event_route [tm: | ||
<code c> | <code c> | ||
- | event_route [tm:failure-branch] { # Handle failure response | + | request_route { |
+ | ... | ||
+ | t_on_branch_failure(" | ||
+ | t_relay(); | ||
+ | } | ||
+ | |||
+ | event_route[tm: | ||
xlog(" | xlog(" | ||
if (t_check_status(" | if (t_check_status(" | ||
Line 3183: | Line 3254: | ||
} | } | ||
} | } | ||
+ | |||
</ | </ | ||