cookbooks:devel:core
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cookbooks:devel:core [2019/10/11 12:18] – [udp_mtu_try_proto] miconda | cookbooks:devel:core [2022/04/11 15:10] (current) – [substdefs] bkaufman | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Kamailio SIP Server v5.4.x (devel): Core Cookbook ====== | + | ====== |
+ | |||
+ | Version: | ||
===== Overview ===== | ===== Overview ===== | ||
Line 9: | Line 11: | ||
===== Structure ===== | ===== Structure ===== | ||
- | The structure of the kamailio.cfg can be seen as thee parts: | + | The structure of the kamailio.cfg can be seen as three parts: |
* global parameters | * global parameters | ||
Line 253: | Line 255: | ||
* **# | * **# | ||
* **# | * **# | ||
+ | |||
+ | Predefined keywords: | ||
+ | * **KAMAILIO_X[_Y[_Z]]** - Kamailio versions | ||
+ | * **MOD_X** - when module X has been loaded | ||
+ | See ' | ||
Among benefits: | Among benefits: | ||
Line 353: | Line 360: | ||
* text on the same line as the directive will cause problems. Keep the directive lines clean and only comment on a line before or after. | * text on the same line as the directive will cause problems. Keep the directive lines clean and only comment on a line before or after. | ||
+ | ==== defenv ==== | ||
+ | |||
+ | Preprocessor directive to define an ID to the value of an environment variable with the name ENVVAR. | ||
+ | |||
+ | <code c> | ||
+ | #!defenv ID=ENVVAR | ||
+ | </ | ||
+ | |||
+ | It can also be just **$!defenv ENVVAR** and the defined ID is the ENVVAR name. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | #!defenv SHELL | ||
+ | </ | ||
+ | |||
+ | If environment variable $SHELL is '/ | ||
+ | |||
+ | <code c> | ||
+ | #!define SHELL /bin/bash | ||
+ | </ | ||
+ | |||
+ | Full expression variant: | ||
+ | |||
+ | <code c> | ||
+ | #!defenv ENVSHELL=SHELL | ||
+ | </ | ||
+ | |||
+ | Then it is like: | ||
+ | |||
+ | <code c> | ||
+ | #!define ENVSHELL /bin/bash | ||
+ | </ | ||
+ | |||
+ | It is a simplified alternative of using **# | ||
+ | |||
+ | ==== defenvs ==== | ||
+ | |||
+ | Similar to **# | ||
+ | |||
+ | <code c> | ||
+ | #!defenvs ENVVAR | ||
+ | #!defenvs ID=ENVVAR | ||
+ | </ | ||
==== subst ==== | ==== subst ==== | ||
Line 388: | Line 439: | ||
Similar to **subst**, but in addition it adds a **#!define ID " | Similar to **subst**, but in addition it adds a **#!define ID " | ||
+ | |||
+ | ==== trydefenv ==== | ||
+ | |||
+ | <code c> | ||
+ | #!trydefenv ID=ENVVAR | ||
+ | </ | ||
+ | |||
+ | Similar to **defenv**, but will not error if the environmental variable is not set. This allows for boolean defines via system ENVVARs. | ||
+ | |||
+ | <code c> | ||
+ | #!trydefenv WITH_MYSQL | ||
+ | |||
+ | #!ifdef WITH_MYSQL | ||
+ | loadmodule " | ||
+ | #!ifdef | ||
+ | </ | ||
+ | |||
+ | ==== trydefenvns ==== | ||
+ | |||
+ | Similar to **# | ||
+ | |||
+ | <code c> | ||
+ | # | ||
+ | # | ||
+ | </ | ||
+ | |||
===== Core Keywords ===== | ===== Core Keywords ===== | ||
Line 722: | Line 799: | ||
==== async_workers ==== | ==== async_workers ==== | ||
- | Specify how many child processes to create for asynchronous execution. These are processes that can receive tasks from various components and execute them locally, which is different process than the task sender. | + | Specify how many child processes |
Default: 0 (asynchronous framework is disabled). | Default: 0 (asynchronous framework is disabled). | ||
Line 731: | Line 808: | ||
async_workers=4 | async_workers=4 | ||
</ | </ | ||
+ | |||
+ | ==== async_nonblock ==== | ||
+ | |||
+ | Set the non-block mode for the internal sockets used by default group of async workers. | ||
+ | |||
+ | Default: 0 | ||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | async_nonblock=1 | ||
+ | </ | ||
+ | |||
+ | ==== async_usleep ==== | ||
+ | |||
+ | Set the number of microseconds to sleep before trying to receive next task (can be useful when async_nonblock=1). | ||
+ | |||
+ | Default: 0 | ||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | async_usleep=100 | ||
+ | </ | ||
+ | |||
+ | ==== async_workers_group ==== | ||
+ | |||
+ | Define groups of asynchronous worker processes. | ||
+ | |||
+ | Prototype: | ||
+ | |||
+ | < | ||
+ | async_workers_group=" | ||
+ | </ | ||
+ | |||
+ | The attributes are: | ||
+ | |||
+ | * **name** - the group name (used by functions such as **sworker_task(name)**) | ||
+ | * **workers** - the number of processes to create for this group | ||
+ | * **nonblock** - set or not set the non-block flag for internal communication socket | ||
+ | * **usleep** - the number of microseconds to sleep before trying to receive next task (can be useful if nonblock=1) | ||
+ | |||
+ | Default: "" | ||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | async_workers_group=" | ||
+ | </ | ||
+ | |||
+ | If the **name** is default, then it overwrites the value set by **async_workers**. | ||
+ | |||
+ | See also **event_route[core: | ||
==== auto_aliases ==== | ==== auto_aliases ==== | ||
Line 965: | Line 1095: | ||
</ | </ | ||
+ | |||
+ | ==== ipv6_hex_style ==== | ||
+ | |||
+ | Can be set to " | ||
+ | |||
+ | Default is " | ||
+ | |||
+ | " | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | <code c> | ||
+ | ipv6_hex_style = " | ||
+ | </ | ||
==== kemi.onsend_route_callback ==== | ==== kemi.onsend_route_callback ==== | ||
Line 1006: | Line 1150: | ||
kemi.onsend_route_callback=" | kemi.onsend_route_callback=" | ||
</ | </ | ||
+ | |||
+ | ==== kemi.pre_routing_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.pre_routing_callback=" | ||
+ | </ | ||
+ | |||
==== latency_cfg_log ==== | ==== latency_cfg_log ==== | ||
Line 1020: | Line 1179: | ||
==== latency_limit_action ==== | ==== latency_limit_action ==== | ||
- | Limit of latency in ms for config actions. If a config action executed by cfg interpreter takes longer than its value, a message is printed in the logs, showing config path, line and action name when it is a module function, as well as internal action id. | + | Limit of latency in us (micro-seconds) |
Default value is 0 (disabled). | Default value is 0 (disabled). | ||
Line 1053: | Line 1212: | ||
==== listen ==== | ==== listen ==== | ||
- | Set the network addresses the SIP server should listen to. It can be an IP address, hostname or network | + | Set the network addresses the SIP server should listen to. It can be an IP address, hostname or network |
Example of usage: | Example of usage: | ||
Line 1068: | Line 1227: | ||
<code c> | <code c> | ||
- | listen=udp: | + | listen=udp: |
</ | </ | ||
Line 1074: | Line 1233: | ||
<code c> | <code c> | ||
- | listen=udp: | + | listen=udp: |
</ | </ | ||
Line 1080: | Line 1239: | ||
A typical use case for advertise address is when running SIP server behind a NAT/ | A typical use case for advertise address is when running SIP server behind a NAT/ | ||
+ | |||
+ | A unique name can be set for sockets to simplify the selection of the socket for sending out. For example, the rr and path modules can use the socket name to advertise it in header URI parameter and use it as a shortcut to select the corresponding socket for routing subsequent requests. | ||
+ | |||
+ | The name has to be provided as a string enclosed in between quotes after the **name** identifier. | ||
+ | |||
+ | <code c> | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | ... | ||
+ | $fsn = " | ||
+ | t_relay(); | ||
+ | </ | ||
+ | |||
+ | Note that there is no internal check for uniqueness of the socket names, the admin has to ensure it in order to be sure the desired socket is selected, otherwise the first socket with a matching name is used. | ||
+ | |||
+ | As of 5.6, there is now a **virtual** identifier which can be added to the end of each listen directive. This can be used in combination with any other identifier, but must be added at the end of the line. | ||
+ | |||
+ | <code c> | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | listen=udp: | ||
+ | </ | ||
+ | |||
+ | The **virtual** identifier is meant for use in situations where you have a floating/ | ||
+ | |||
+ | This identifier will change the behaviour of how " | ||
+ | |||
+ | This means that if Kamailio is listening on an IP that is not currently local, it will recognise that, and can relay the traffic to another Kamailio node as needed, instead of thinking it always needs to handle the traffic. | ||
+ | |||
==== loadmodule ==== | ==== loadmodule ==== | ||
Line 1097: | Line 1288: | ||
loadmodule " | loadmodule " | ||
</ | </ | ||
+ | |||
+ | ==== loadmodulex ==== | ||
+ | |||
+ | Similar to **loadmodule** with the ability to evaluate variables in its parameter. | ||
==== loadpath ==== | ==== loadpath ==== | ||
Line 1120: | Line 1315: | ||
The proxy tries to find the modules in a smart way, e.g: loadmodule " | The proxy tries to find the modules in a smart way, e.g: loadmodule " | ||
+ | ==== local_rport ==== | ||
+ | |||
+ | Similar to **add_local_rport()** function, but done in a global scope, so the function does not have to be executed for each request. | ||
+ | |||
+ | Default: off | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | local_rport = on | ||
+ | </ | ||
==== log_engine_data ==== | ==== log_engine_data ==== | ||
Line 1222: | Line 1428: | ||
==== maxbuffer ==== | ==== maxbuffer ==== | ||
- | The size in bytes not to be exceeded during the auto-probing procedure of descovering | + | The size in bytes not to be exceeded during the auto-probing procedure of discovering and increasing |
Example of usage: | Example of usage: | ||
Line 1228: | Line 1434: | ||
maxbuffer=65536 | maxbuffer=65536 | ||
+ | Note: it is not the size of the internal SIP message receive buffer. | ||
==== max_branches ==== | ==== max_branches ==== | ||
Line 1328: | Line 1535: | ||
It can be set via config reload framework. | It can be set via config reload framework. | ||
- | Default is 0 (disabled). | + | Default is 1 (enabled). |
<code c> | <code c> | ||
Line 1370: | Line 1577: | ||
* 4 - summary of pkg used blocks | * 4 - summary of pkg used blocks | ||
* 8 - summary of shm used blocks | * 8 - summary of shm used blocks | ||
+ | * 16 - short status | ||
If set to 0, nothing is printed. | If set to 0, nothing is printed. | ||
- | Default value: | + | Default value: |
Example: | Example: | ||
Line 1405: | Line 1613: | ||
==== modparam ==== | ==== modparam ==== | ||
+ | |||
The modparam command will be used to set the options of the modules. | The modparam command will be used to set the options of the modules. | ||
Line 1414: | Line 1623: | ||
See the documenation of the respective module to find out the available options. | See the documenation of the respective module to find out the available options. | ||
+ | ==== modparamx ==== | ||
+ | |||
+ | Similar to **modparam**, | ||
==== onsend_route_reply ==== | ==== onsend_route_reply ==== | ||
Line 1522: | Line 1734: | ||
==== route_locks_size ==== | ==== 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. | + | Set the number of mutex locks to be used for synchronizing the execution of config script for messages sharing the same Call-Id. In other words, enables Kamailio to execute |
- | For smaller impact on parallel processing, its value it should be at least twice the number of kamailio | + | For smaller impact on parallel processing, its value it should be at least twice the number of Kamailio |
Example: | Example: | ||
Line 1531: | Line 1743: | ||
route_locks_size = 256 | route_locks_size = 256 | ||
</ | </ | ||
+ | |||
+ | Note that ordering of the SIP messages can still be changed by network transmission (quite likely for UDP, especially on long distance paths) or CPU allocation for processes when executing pre-config and post-config tasks (very low chance, but not to be ruled out completely). | ||
==== server_id ==== | ==== server_id ==== | ||
Line 1571: | Line 1785: | ||
shm_mem_size = 64 (default 64) | shm_mem_size = 64 (default 64) | ||
+ | |||
+ | ==== sip_parser_log ==== | ||
+ | |||
+ | Log level for printing debug messages for some of the SIP parsing errors. | ||
+ | |||
+ | Default: 0 (L_WARN) | ||
+ | |||
+ | <code c> | ||
+ | sip_parser_log = 1 | ||
+ | </ | ||
+ | |||
+ | ==== sip_parser_mode ==== | ||
+ | |||
+ | Control sip parser behaviour. | ||
+ | |||
+ | If set to 1, the parser is more strict in accepting messages that have invalid headers (e.g., duplicate To or From). It can make the system safer, but loses the flexibility to be able to fix invalid messages with config operations. | ||
+ | |||
+ | If set to 0, the parser is less strict on checking validity of headers. | ||
+ | |||
+ | Default: 1 | ||
+ | |||
+ | <code c> | ||
+ | sip_parser_mode = 0 | ||
+ | </ | ||
==== sip_warning (noisy feedback) ==== | ==== sip_warning (noisy feedback) ==== | ||
- | Can be 0 or 1. If set to 1 (default value) a ' | + | Can be 0 or 1. If set to 1 (default value is 0) a ' |
The header contains several details that help troubleshooting using the network traffic dumps, but might reveal details of your network infrastructure and internal SIP routing. | The header contains several details that help troubleshooting using the network traffic dumps, but might reveal details of your network infrastructure and internal SIP routing. | ||
Line 1657: | Line 1895: | ||
+ | ==== stats_name_separator ==== | ||
+ | Specify the character used as a separator for the internal statistics' | ||
+ | Default value is " | ||
+ | Example of usage: | ||
+ | |||
+ | stats_name_separator = " | ||
==== tos ==== | ==== tos ==== | ||
Line 1738: | Line 1982: | ||
| | ||
</ | </ | ||
+ | |||
+ | ==== wait_worker1_mode ==== | ||
+ | |||
+ | Enable waiting for child SIP worker one to complete initialization, | ||
+ | |||
+ | Default: 0 (do not wait for child worker one to complete initialization). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | wait_worker1_mode = 1 | ||
+ | </ | ||
+ | |||
+ | ==== wait_worker1_time ==== | ||
+ | |||
+ | How long to wait for child worker one to complete the initialization. In micro-seconds. | ||
+ | |||
+ | Default: 4000000 (micro-seconds = 4 seconds). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | wait_worker1_time = 1000000 | ||
+ | </ | ||
+ | |||
+ | ==== wait_worker1_usleep ==== | ||
+ | |||
+ | How long to wait for child worker one to complete the initialization. In micro-seconds. | ||
+ | |||
+ | Default: 100000 (micro-seconds = 0.1 seconds). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | wait_worker1_usleep = 50000 | ||
+ | </ | ||
+ | |||
==== workdir ==== | ==== workdir ==== | ||
Line 1785: | Line 2066: | ||
===== DNS Parameters ===== | ===== DNS Parameters ===== | ||
- | Note: See also file doc/dns.txt for details about Kamailio' | + | Note: See also file doc/tutorials/dns.txt for details about Kamailio' |
Kamailio has an internal DNS resolver with caching capabilities. If this caching resolver is activated (default setting) then the system' | Kamailio has an internal DNS resolver with caching capabilities. If this caching resolver is activated (default setting) then the system' | ||
Line 1928: | Line 2209: | ||
**Alias name: dns_srv_loadbalancing** | **Alias name: dns_srv_loadbalancing** | ||
- | Enable dns srv weight based load balancing (see doc/ | + | Enable dns srv weight based load balancing (see doc/tutorials/dns.txt) |
dns_srv_lb = yes | no (default no) | dns_srv_lb = yes | no (default no) | ||
Line 1944: | Line 2225: | ||
==== dns_try_naptr ==== | ==== dns_try_naptr ==== | ||
- | Enable NAPTR support according to RFC 3263 (see doc/dns.txt for more info) | + | Enable NAPTR support according to RFC 3263 (see doc/tutorials/dns.txt for more info) |
| | ||
dns_try_naptr = yes | no (default no) | dns_try_naptr = yes | no (default no) | ||
Line 1955: | Line 2236: | ||
dns_tls_pref=10 and dns_sctp_pref=20. To use the remote site preferences set all dns_*_pref to the same positive value (e.g. dns_udp_pref=1, | dns_tls_pref=10 and dns_sctp_pref=20. To use the remote site preferences set all dns_*_pref to the same positive value (e.g. dns_udp_pref=1, | ||
dns_tcp_pref=1, | dns_tcp_pref=1, | ||
- | preference to -1 (or any other negative number). (see doc/dns.txt for more info) | + | preference to -1 (or any other negative number). (see doc/tutorials/dns.txt for more info) |
dns_{udp, | dns_{udp, | ||
Line 2194: | Line 2475: | ||
tcp_rd_buf_size=65536 | tcp_rd_buf_size=65536 | ||
</ | </ | ||
+ | |||
+ | ==== tcp_reuse_port ==== | ||
+ | |||
+ | Allows reuse of TCP ports. This means,for example, that the same TCP ports on which Kamailio is listening on, can be used as source ports of new TCP connections when acting as an UAC. Kamailio must have been compiled in a system implementing SO_REUSEPORT (Linux > 3.9.0, FreeBSD, OpenBSD, NetBSD, MacOSX). This parameter takes effect only if also the system on which Kamailio is running on supports SO_REUSEPORT. | ||
+ | |||
+ | tcp_reuse_port = yes (default no) | ||
+ | |||
+ | ==== tcp_script_mode ==== | ||
+ | |||
+ | Specify if connection should be closed (set to CONN_ERROR) if processing the received message results in error (that can also be due to negative return code from a configuration script main route block). If set to 1, the processing continues with the connection open. | ||
+ | |||
+ | Default 0 (close connection) | ||
+ | |||
+ | < | ||
+ | tcp_script_mode = 1 | ||
+ | </ | ||
+ | |||
==== tcp_send_timeout ==== | ==== tcp_send_timeout ==== | ||
Line 2210: | Line 2508: | ||
==== tcp_syncnt ==== | ==== tcp_syncnt ==== | ||
+ | |||
Number of SYN retransmissions before aborting a connect attempt (see linux tcp(7) TCP_SYNCNT). Linux only. | Number of SYN retransmissions before aborting a connect attempt (see linux tcp(7) TCP_SYNCNT). Linux only. | ||
tcp_syncnt = number of syn retr. (default not set) | tcp_syncnt = number of syn retr. (default not set) | ||
+ | |||
+ | |||
+ | ==== tcp_wait_data ==== | ||
+ | |||
+ | Specify how long to wait (in milliseconds) to wait for data on tcp connections in certain cases. Now applies when reading on tcp connection for haproxy protocol. | ||
+ | |||
+ | Default: 5000ms (5secs) | ||
+ | |||
+ | <code c> | ||
+ | tcp_wait_data = 10000 | ||
+ | </ | ||
==== tcp_wq_blk_size ==== | ==== tcp_wq_blk_size ==== | ||
Line 2225: | Line 2535: | ||
tcp_wq_max = bytes (default 10 Mb) | tcp_wq_max = bytes (default 10 Mb) | ||
| | ||
- | ==== tcp_reuse_port ==== | ||
- | |||
- | Allows reuse of TCP ports. This means,for example, that the same TCP ports on which Kamailio is listening on, can be used as source ports of new TCP connections when acting as an UAC. Kamailio must have been compiled in a system implementing SO_REUSEPORT (Linux > 3.9.0, FreeBSD, OpenBSD, NetBSD, MacOSX). This parameter takes effect only if also the system on which Kamailio is running on supports SO_REUSEPORT. | ||
- | |||
- | tcp_reuse_port = yes (default no) | ||
===== TLS Parameters ===== | ===== TLS Parameters ===== | ||
Line 2455: | Line 2760: | ||
- | ===== Blacklist | + | ===== Blocklist |
- | ==== dst_blacklist_expire | + | ==== dst_blocklist_expire |
- | **Alias name: dst_blacklist_ttl** | + | **Alias name: dst_blocklist_ttl** |
- | How much time a blacklisted | + | How much time a blocklisted |
- | | + | |
- | ==== dst_blacklist_gc_interval | + | ==== dst_blocklist_gc_interval |
How often the garbage collection will run (eliminating old, expired entries). | How often the garbage collection will run (eliminating old, expired entries). | ||
- | | + | |
- | ==== dst_blacklist_init | + | ==== dst_blocklist_init |
- | If off, the blacklist | + | If off, the blocklist |
- | | + | |
- | ==== dst_blacklist_mem | + | ==== dst_blocklist_mem |
- | Maximum shared memory amount used for keeping the blacklisted | + | Maximum shared memory amount used for keeping the blocklisted |
- | | + | |
- | ==== use_dst_blacklist | + | ==== use_dst_blocklist |
- | Enable the destination | + | Enable the destination |
- | Note: using the blacklist | + | Note: using the blocklist |
- | See also doc/dst_blacklist.txt. | + | See also doc/dst_blocklist.txt. |
- | | + | |
===== Real-Time Parameters ===== | ===== Real-Time Parameters ===== | ||
Line 2631: | Line 2936: | ||
Force to send the message from the specified socket (it _must_ be one of the sockets specified with the " | Force to send the message from the specified socket (it _must_ be one of the sockets specified with the " | ||
+ | |||
+ | This function does not support pseudo-variables, | ||
Example of usage: | Example of usage: | ||
Line 2764: | Line 3071: | ||
</ | </ | ||
+ | See also the FAQ for how the function return code is evaluated: | ||
+ | |||
+ | * https:// | ||
==== revert_uri ==== | ==== revert_uri ==== | ||
Line 2851: | Line 3161: | ||
+ | ==== selval ==== | ||
+ | Select a value based on conditional expression. | ||
+ | |||
+ | Prototype: | ||
+ | |||
+ | <code c> | ||
+ | selval(evalexpr, | ||
+ | </ | ||
+ | |||
+ | This is a core statement that return the 2nd parameter if the 1st parameter is evaluated to true, or 3rd parameter if the 1st parameter is evaluated to false. It can be considered a core function that is equivalent of ternary condition/ | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | $var(x) = selval($Ts mod 2, " | ||
+ | </ | ||
+ | |||
+ | The first parameter is a conditional expression, like those used for IF, the 2nd and 3rd parameters can be expressions like those used in the right side of assignments. | ||
==== set_advertised_address ==== | ==== set_advertised_address ==== | ||
Line 2987: | Line 3315: | ||
Add " | Add " | ||
+ | |||
===== Custom Global Parameters ===== | ===== Custom Global Parameters ===== | ||
- | These are parameters that can be defined by the writer of kamailio.cfg in order to be used inside routing blocks. | + | These are parameters that can be defined by the writer of kamailio.cfg in order to be used inside routing blocks. |
+ | |||
+ | The definition of a custom global parameter must follow the pattern: | ||
+ | |||
+ | < | ||
+ | group.variable = value desc " | ||
+ | |||
+ | </ | ||
+ | |||
+ | The value can be a quoted string or integer number. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | pstn.gw_ip = " | ||
+ | </ | ||
+ | |||
+ | The custom global parameter can be accessed inside a routing block via: | ||
+ | |||
+ | < | ||
+ | $sel(cfg_get.group.variable) | ||
+ | </ | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | $ru = " | ||
+ | </ | ||
+ | |||
+ | **Note:** Some words cannot be used as (part of) names for custom variables or groups, and if they are used a syntax error is logged | ||
+ | |||
+ | ===== Routing Blocks ===== | ||
+ | |||
+ | The routing blocks are the parts of the configuration file executed by kamailio at runtime. They can be seen as blocks of actions similar to functions (or procedures) from common programming languages. | ||
+ | |||
+ | A routing block is identified by a specific token, followed by a name in between square brackets and actions in between curly braces. | ||
+ | |||
+ | <code c> | ||
+ | route_block_id[NAME] { | ||
+ | ACTIONS | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The name can be any alphanumeric string, with specific routing blocks enforcing a particular format. | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | Route blocks can be executed on network events (e.g., receiving a SIP message), timer events (e.g., retransmission timeout) or particular events specific to modules. | ||
+ | |||
+ | There can be so called sub-route blocks, which can be invoked from another route blocks, like a function. Invocation is done with ' | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | request_route{ | ||
+ | ... | ||
+ | route(" | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | route[" | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== request_route ==== | ||
+ | |||
+ | Request routing block - is executed for each SIP request. | ||
+ | |||
+ | It contains a set of actions to be executed for SIP requests received from the network. It is the equivalent of *main()* function for handling the SIP requests. | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | The implicit action after execution of the main route block is to drop the SIP request. To send a reply or forward the request, explicit actions (e.g., sl_send_reply(), | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | <code c> | ||
+ | request_route { | ||
+ | | ||
+ | # send reply for each options request | ||
+ | sl_send_reply(" | ||
+ | exit(); | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | route[FWD] { | ||
+ | # forward according to uri | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== route ==== | ||
+ | |||
+ | This block is used to define ' | ||
+ | |||
+ | The definition of the sub-route block follows the general rules, with a name in between square brackets and actions between curly braces. A sub-route can return an integer value back to the routing block that executed it. The return code can be retrieved via $rc variables. | ||
+ | |||
+ | Evaluation of the return of a subroute is done with following rules: | ||
+ | * negative value is evaluated as false | ||
+ | * 0 - is interpreted as **exit** | ||
+ | * positive value is evaluated as true | ||
+ | |||
+ | |||
+ | <code c> | ||
+ | request_route { | ||
+ | if(route(POSITIVE)) { | ||
+ | xlog(" | ||
+ | } | ||
+ | if( ! route(NEGATIVE)) { | ||
+ | xlog(" | ||
+ | } | ||
+ | if( route(ZERO)) { | ||
+ | xlog(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | route[POSITIVE] { | ||
+ | return 10; | ||
+ | } | ||
+ | |||
+ | route[NEGATIVE] { | ||
+ | return -8; | ||
+ | } | ||
+ | |||
+ | route[ZERO] { | ||
+ | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | A sub-route can execute another sub-route. There is a limit to the number of recursive levels, avoiding ending up in infinite loops -- see **max_recursive_level** global parameter. | ||
+ | |||
+ | The sub-route blocks allow to make the configuration file modular, simplifying the logic and helping to avoid duplication of actions. | ||
+ | ==== branch_route ==== | ||
+ | |||
+ | Request' | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | <code c> | ||
+ | request_route { | ||
+ | lookup(" | ||
+ | t_on_branch(" | ||
+ | if(!t_relay()) { | ||
+ | sl_send_reply(" | ||
+ | } | ||
+ | } | ||
+ | branch_route[OUT] { | ||
+ | if(uri=~" | ||
+ | # discard branches that go to 10.10.10.10 | ||
+ | drop(); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== failure_route ==== | ||
+ | |||
+ | Failed transaction routing block. It contains a set of actions to be taken each transaction that received only negative replies (>=300) for all branches. The ' | ||
+ | |||
+ | Note that in ' | ||
+ | |||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | <code c> | ||
+ | request_route { | ||
+ | lookup(" | ||
+ | t_on_failure(" | ||
+ | if(!t_relay()) { | ||
+ | sl_send_reply(" | ||
+ | } | ||
+ | } | ||
+ | failure_route[TOVOICEMAIL] { | ||
+ | if(is_method(" | ||
+ | # call failed - relay to voice mail | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== reply_route ==== | ||
+ | |||
+ | Main SIP response (reply) handling block - it contains a set of actions to be executed for SIP replies. It is executed for all replies received from the network. | ||
+ | |||
+ | It does not have a name and it is executed by the core, before any other module handling the SIP reply. It is triggered only by SIP replies received on the network. | ||
+ | |||
+ | There is no network route that can be enforced for a SIP reply - it is sent based on Via header, according to SIP RFC3261 - therefore no dedicated actions for forwarding the reply must be used in this block. | ||
+ | |||
+ | This routing block is optional, if missing, the SIP reply is sent to the address in 2nd Via header. | ||
+ | |||
+ | One can decide to drop a SIP reply by using **drop** action. | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | reply_route { | ||
+ | if(status==" | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <fc # | ||
+ | |||
+ | ==== onreply_route ==== | ||
+ | |||
+ | |||
+ | 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 ' | ||
+ | |||
+ | Core ' | ||
+ | |||
+ | <code c> | ||
+ | request_route { | ||
+ | lookup(" | ||
+ | t_on_reply(" | ||
+ | if(!t_relay()) { | ||
+ | sl_send_reply(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | reply_route { | ||
+ | if(!t_check_trans()) { | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | onreply_route[LOGRPL] { | ||
+ | if(status=~" | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | ==== onsend_route ==== | ||
+ | |||
+ | The route is executed in when a SIP request is sent out. Only a limited number of commands are allowed (drop, if + all the checks, msg flag manipulations, | ||
+ | |||
+ | In this route the final destination of the message is available and can be checked (with snd_ip, snd_port, to_ip, to_port, snd_proto, snd_af). | ||
+ | |||
+ | This route is executed only when forwarding requests - it is not executed for replies, retransmissions, | ||
+ | |||
+ | Example: | ||
+ | |||
+ | <code c> | ||
+ | onsend_route { | ||
+ | if(to_ip==1.2.3.4 && !isflagset(12)){ | ||
+ | log(1, " | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * snd_ip, snd_port - behave like src_ip/ | ||
+ | * to_ip, to_port - like above, but contain the ip/port the message will be sent to (not to be confused with dst_ip/ | ||
+ | * snd_proto, snd_af - behave like proto/af but contain the protocol/ | ||
+ | * msg:len - when used in an onsend_route, | ||
+ | |||
+ | ==== event_route ==== | ||
+ | |||
+ | Generic type of route executed when specific events happen. | ||
+ | |||
+ | Prototype: event_route[groupid: | ||
+ | * groupid - should be the name of the module that triggers the event | ||
+ | * eventid - some meaningful short text describing the event | ||
+ | |||
+ | === Core Event Routes === | ||
+ | |||
+ | Implementations: | ||
+ | |||
+ | * **event_route[core: | ||
+ | * note that due to forking, other sip workers can get faster to listening for sip traffic | ||
+ | |||
+ | <code c> | ||
+ | event_route[core: | ||
+ | xlog(" | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * **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; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * **event_route[core: | ||
+ | * if drop is used, then the message is not processed further with request_route or reply_route in the same process. This can be useful together with sworker module which can delegate the processing to another worker. | ||
+ | |||
+ | <code c> | ||
+ | async_workers_group=" | ||
+ | ... | ||
+ | event_route[core: | ||
+ | xinfo(" | ||
+ | if(is_method(" | ||
+ | # delegate processing of REGISTERs to a special group of workers | ||
+ | if(sworker_task(" | ||
+ | drop; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * ** event_route[core: | ||
+ | * note that the SIP message is broken in this case, but it gets access to source and local socket addresses (ip, port, proto, af) as well as the whole message buffer and its size | ||
+ | |||
+ | <code c> | ||
+ | event_route[core: | ||
+ | xlog(" | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | === 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: | ||
+ | <code c> | ||
+ | modparam(" | ||
+ | |||
+ | event_route[htable: | ||
+ | $sht(a=> | ||
+ | $sht(a=> | ||
+ | } | ||
+ | |||
+ | request_route { | ||
+ | if(is_method(" | ||
+ | { | ||
+ | switch($rd) { | ||
+ | case " | ||
+ | lock(" | ||
+ | $sht(a=> | ||
+ | $sht(a=> | ||
+ | unlock(" | ||
+ | if($sht(a=> | ||
+ | { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | break; | ||
+ | ... | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | * **event_route [tm: | ||
+ | <code c> | ||
+ | event_route [tm: | ||
+ | xlog(" | ||
+ | t_set_fr(10000, | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | * **event_route [tm: | ||
+ | <code c> | ||
+ | request_route { | ||
+ | ... | ||
+ | t_on_branch_failure(" | ||
+ | t_relay(); | ||
+ | } | ||
+ | |||
+ | event_route[tm: | ||
+ | xlog(" | ||
+ | if (t_check_status(" | ||
+ | unregister(" | ||
+ | if (t_next_contact_flow()) { | ||
+ | t_relay(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Script Statements ===== | ||
+ | |||
+ | ==== if ==== | ||
+ | IF-ELSE statement | ||
+ | |||
+ | Prototype: | ||
+ | |||
+ | < | ||
+ | if(expr) { | ||
+ | | ||
+ | } else { | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The ' | ||
+ | |||
+ | The logical operators that can be used in ' | ||
+ | |||
+ | < | ||
+ | == equal | ||
+ | != not equal | ||
+ | =~ regular expression matching: Note: Posix regular expressions will be used, e.g. use [[: | ||
+ | !~ regular expression not-matching (NOT PORTED from Kamailio 1.x, use '!(x =~ y)') | ||
+ | > | ||
+ | >= greater or equal | ||
+ | < | ||
+ | <= less or equal | ||
+ | && | ||
+ | || logical OR | ||
+ | ! | ||
+ | </ | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | if(is_method(" | ||
+ | { | ||
+ | log(" | ||
+ | } else { | ||
+ | log(" | ||
+ | } | ||
+ | |||
+ | See also the FAQ for how the function return code is evaluated: | ||
+ | |||
+ | * https:// | ||
+ | ==== switch ==== | ||
+ | |||
+ | SWITCH statement - it can be used to test the value of a pseudo-variable. | ||
+ | |||
+ | IMPORTANT NOTE: ' | ||
+ | |||
+ | |||
+ | Example of usage: | ||
+ | < | ||
+ | route { | ||
+ | route(1); | ||
+ | switch($retcode) | ||
+ | { | ||
+ | case -1: | ||
+ | log(" | ||
+ | break; | ||
+ | case 1: | ||
+ | log(" | ||
+ | break; | ||
+ | case 2: | ||
+ | case 3: | ||
+ | log(" | ||
+ | break; | ||
+ | default: | ||
+ | log(" | ||
+ | } | ||
+ | |||
+ | # switch of R-URI username | ||
+ | switch($rU) | ||
+ | { | ||
+ | case " | ||
+ | log(" | ||
+ | break; | ||
+ | case " | ||
+ | log(" | ||
+ | break; | ||
+ | case " | ||
+ | case " | ||
+ | log(" | ||
+ | break; | ||
+ | default: | ||
+ | log(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | route[1]{ | ||
+ | if(is_method(" | ||
+ | { | ||
+ | return(-1); | ||
+ | }; | ||
+ | if(is_method(" | ||
+ | return(1); | ||
+ | } | ||
+ | if(is_method(" | ||
+ | return(2); | ||
+ | } | ||
+ | if(is_method(" | ||
+ | return(3); | ||
+ | } | ||
+ | return(-2); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | NOTE: take care while using ' | ||
+ | |||
+ | |||
+ | ==== while ==== | ||
+ | |||
+ | while statement | ||
+ | |||
+ | Example of usage: | ||
+ | |||
+ | $var(i) = 0; | ||
+ | while($var(i) < 10) | ||
+ | { | ||
+ | xlog(" | ||
+ | $var(i) = $var(i) + 1; | ||
+ | } | ||
+ | |||
+ | ===== Script Operations ===== | ||
+ | |||
+ | Assignments together with string and arithmetic operations can be done directly in configuration file. | ||
+ | ==== Assignment ==== | ||
+ | |||
+ | Assignments can be done like in C, via ' | ||
+ | * Unordered List Item AVPs - to set the value of an AVP | ||
+ | * script variables ($var(...)) - to set the value of a script variable | ||
+ | * shared variables ($shv(...)) | ||
+ | * $ru - to set R-URI | ||
+ | * $rd - to set domain part of R-URI | ||
+ | * $rU - to set user part of R-URI | ||
+ | * $rp - to set the port of R-URI | ||
+ | * $du - to set dst URI | ||
+ | * $fs - to set send socket | ||
+ | * $br - to set branch | ||
+ | * $mf - to set message flags value | ||
+ | * $sf - to set script flags value | ||
+ | * $bf - to set branch flags value | ||
+ | |||
+ | < | ||
+ | $var(a) = 123; | ||
+ | </ | ||
+ | |||
+ | For avp's there a way to remove all values and assign a single value in one statement (in other words, delete existing AVPs with same name, add a new one with the right side value). This replaces the := assignment operator from kamailio < 3.0. | ||
+ | < | ||
+ | $(avp(i: | ||
+ | $(avp(i: | ||
+ | </ | ||
+ | |||
+ | ==== String Operations ==== | ||
+ | For strings, ' | ||
+ | |||
+ | < | ||
+ | $var(a) = " | ||
+ | $var(b) = " | ||
+ | </ | ||
+ | ==== Arithmetic Operations ==== | ||
+ | |||
+ | For numbers, one can use: | ||
+ | * + : plus | ||
+ | * - : minus | ||
+ | * / : divide | ||
+ | * * : multiply | ||
+ | * % : modulo (Kamailio uses ' | ||
+ | * | : bitwise OR | ||
+ | * & : bitwise AND | ||
+ | * ^ : bitwise XOR | ||
+ | * ~ : bitwise NOT | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | |||
+ | Example: | ||
+ | |||
+ | < | ||
+ | $var(a) = 4 + ( 7 & ( ~2 ) ); | ||
+ | </ | ||
+ | |||
+ | NOTE: to ensure the priority of operands in expression evaluations do use __parenthesis__. | ||
+ | |||
+ | Arithmetic expressions can be used in condition expressions. | ||
+ | |||
+ | < | ||
+ | if( $var(a) & 4 ) | ||
+ | log(" | ||
+ | </ | ||
+ | |||
+ | ===== Operators ===== | ||
+ | |||
+ | - type casts operators: (int), (str). | ||
+ | - string comparison: eq, ne | ||
+ | - integer comparison: ieq, ine | ||
+ | |||
+ | Note: The names are not yet final (use them at your own risk). Future version might use ==/!= only for ints (ieq/ine) and eq/ne for strings (under debate). They are almost equivalent to == or !=, but they force the conversion of their operands (eq to string and ieq to int), allowing among other things better type checking on startup and more optimizations. | ||
+ | |||
+ | Non equiv. examples: | ||
+ | |||
+ | 0 == "" | ||
+ | |||
+ | " | ||
+ | |||
+ | Note: internally == and != are converted on startup to eq/ | ||
+ | |||
+ | - Kamailio tries to guess what the user wanted when operators that support multiple types are used on different typed operands. In general convert the right operand to the type of the left operand and then perform the operation. Exception: the left operand is undef. This applies to the following operators: +, == and !=. | ||
+ | | ||
+ | For +: undef + expr -> undef is converted to string => "" | ||
+ | For == and !=: undef == expr -> undef is converted to type_of expr. | ||
+ | If expr is undef, then undef == undef is true (internally is converted | ||
+ | to string). | ||
+ | |||
+ | - expression evaluation changes: Kamailio will auto-convert to integer or string in function of the operators: | ||
+ | | ||
+ | | ||
+ | |||
+ | - script operators for dealing with empty/ | ||
+ | defined expr - returns true if expr is defined, and false if not. | ||
+ | Note: only a standalone avp or pvar can be | ||
+ | | ||
+ | strlen(expr) - returns the lenght of expr evaluated as string. | ||
+ | strempty(expr) - returns true if expr evaluates to the empty | ||
+ | | ||
+ | Example: if (defined $v && !strempty($v)) $len=strlen($v); | ||
+ | |||
+ | ===== Command Line Parameters ===== | ||
+ | |||
+ | Kamailio can be started with a set of command line parameters, providing more flexibility to control what is doing at runtime. Some of them can be quite useful when running on containerised environments. | ||
+ | |||
+ | To see the the available command line parameters, run **kamailio -h**: | ||
+ | |||
+ | < | ||
+ | # kamailio -h | ||
+ | |||
+ | version: kamailio 5.4.0-dev4 (x86_64/ | ||
+ | Usage: kamailio [options] | ||
+ | Options: | ||
+ | -a mode Auto aliases mode: enable with yes or on, | ||
+ | disable with no or off | ||
+ | --alias=val | ||
+ | (like for ' | ||
+ | -A define | ||
+ | -A ' | ||
+ | -b nr Maximum receive buffer size which will not be exceeded by | ||
+ | auto-probing procedure even if OS allows | ||
+ | -c Check configuration file for syntax errors | ||
+ | -d | ||
+ | -D | ||
+ | -D..do not fork (almost) anyway; | ||
+ | -DD..do not daemonize creator; | ||
+ | -DDD..daemonize (default) | ||
+ | -e Log messages printed in terminal colors (requires -E) | ||
+ | -E Log to stderr | ||
+ | -f file Configuration file (default: / | ||
+ | -g gid | ||
+ | -G file Create a pgid file | ||
+ | -h This help message | ||
+ | --help | ||
+ | -I Print more internal compile flags and options | ||
+ | -K Turn on " | ||
+ | -l address | ||
+ | mean listening on more addresses). The address format is | ||
+ | [proto: | ||
+ | where proto=udp|tcp|tls|sctp, | ||
+ | addr_lst= addr|(addr, addr_lst), | ||
+ | addr=host|ip_address|interface_name and | ||
+ | advaddr=addr[: | ||
+ | E.g: -l localhost, -l udp: | ||
+ | -l udp: | ||
+ | -l " | ||
+ | The default behaviour is to listen on all the interfaces. | ||
+ | --loadmodule=name load the module specified by name | ||
+ | --log-engine=log engine name and data | ||
+ | -L path Modules search path (default: / | ||
+ | -m nr Size of shared memory allocated in Megabytes | ||
+ | --modparam=modname: | ||
+ | type has to be ' | ||
+ | example: --modparam=corex: | ||
+ | -M nr Size of private memory allocated, in Megabytes | ||
+ | -n processes Number of child processes to fork per interface | ||
+ | (default: 8) | ||
+ | -N | ||
+ | -O nr Script optimization level (debugging option) | ||
+ | -P file Create a pid file | ||
+ | -Q | ||
+ | -r Use dns to check if is necessary to add a " | ||
+ | field to a via | ||
+ | -R Same as `-r` but use reverse dns; | ||
+ | (to use both use `-rR`) | ||
+ | --server-id=num set the value for server_id | ||
+ | --subst=exp set a subst preprocessor directive | ||
+ | --substdef=exp set a substdef preprocessor directive | ||
+ | --substdefs=exp set a substdefs preprocessor directive | ||
+ | -S | ||
+ | -t dir | ||
+ | -T | ||
+ | -u uid | ||
+ | -v | ||
+ | --version | ||
+ | -V | ||
+ | -x name Specify internal manager for shared memory (shm) | ||
+ | - can be: fm, qm or tlsf | ||
+ | -X name Specify internal manager for private memory (pkg) | ||
+ | - if omitted, the one for shm is used | ||
+ | -Y dir | ||
+ | -w dir | ||
+ | -W type poll method (depending on support in OS, it can be: poll, | ||
+ | epoll_lt, epoll_et, sigio_rt, select, kqueue, / | ||
+ | </ | ||
+ | |||
+ | ==== Log Engine CLI Parameter ==== | ||
+ | |||
+ | The **--log-engine** parameter allows to specify what logging engine to be used, which is practically about the format of the log messages. If not set at all, then Kamailio does the classic style of line-based plain text log messages. | ||
+ | |||
+ | The value of this parameter can be **--log-engine=name** or **--log-engine=name: | ||
+ | |||
+ | The name of the log engine can be: | ||
+ | |||
+ | * **json** - write logs in structured JSON format | ||
+ | * the **data** for **json** log engine can be a set of character flags: | ||
+ | * **a** - add log prefix as a special field | ||
+ | * **A** - do not add log prefix | ||
+ | * **c** - add Call-ID (when available) as a dedicated JSON attribute | ||
+ | * **j** - the log prefix and message fields are printed in JSON structure format, detecting if they are enclosed in between **{ }** or adding them as a **text** field | ||
+ | * **M** - strip EOL (' | ||
+ | * **N** - do not add EOL at the end of JSON document | ||
+ | * **p** - the log prefix is printed as it is in the root json document, it has to start with comma (**,**) and be a valid set of json fields | ||
+ | * **U** - CEE (Common Event Expression) schema format - https:// | ||
+ | |||
+ | Example of JSON logs when running Kamailio with " | ||
+ | |||
+ | < | ||
+ | { " | ||
+ | |||
+ | { " | ||
+ | </ | ||
+ | |||
+ | Example config for printing log message with **j** flag: | ||
+ | |||
+ | < | ||
+ | xinfo(" | ||
+ | </ | ||
+ | |||
+ | Example config for printing log messages with **p** flag: | ||
+ | |||
+ | < | ||
+ | log_prefix=", | ||
+ | </ |
cookbooks/devel/core.1570796339.txt.gz · Last modified: 2019/10/11 12:18 by miconda