User Tools

Site Tools


cookbooks:devel:core

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cookbooks:devel:core [2021/09/10 10:00]
henningw
cookbooks:devel:core [2021/12/06 10:54]
miconda [defenv]
Line 7: Line 7:
 This tutorial collects the functions and parameters exported by Kamailio core to configuration file. This tutorial collects the functions and parameters exported by Kamailio core to configuration file.
  
-**Note:** The parameters on this page are **NOT** in alphabetical order. Test+**Note:** The parameters on this page are **NOT** in alphabetical order.
  
 ===== Structure ===== ===== Structure =====
Line 395: Line 395:
  
 It is a simplified alternative of using **#!substdef** with **$env(NAME)** in the replacement part. It is a simplified alternative of using **#!substdef** with **$env(NAME)** in the replacement part.
-    + 
 +==== defenvs ==== 
 + 
 +Similar to **#!defenv**, but the value is defined in between double quotes to make it convenient to be used as a string token. 
 + 
 +<code c> 
 +#!defenvs ENVVAR 
 +#!defenvs ID=ENVVAR 
 +</code>
 ==== subst ==== ==== subst ====
  
Line 1378: Line 1386:
 ==== maxbuffer ==== ==== maxbuffer ====
  
-The size in bytes not to be exceeded during the auto-probing procedure of descovering the maximum buffer size for receiving UDP messages. Default value is 262144.+The size in bytes not to be exceeded during the auto-probing procedure of discovering and increasing the maximum OS buffer size for receiving UDP messages (socket option SO_RCVBUF). Default value is 262144.
  
 Example of usage: Example of usage:
Line 1384: Line 1392:
     maxbuffer=65536     maxbuffer=65536
  
 +Note: it is not the size of the internal SIP message receive buffer.
 ==== max_branches ==== ==== max_branches ====
  
Line 3949: Line 3958:
       * **A** - do not add log prefix       * **A** - do not add log prefix
       * **c** - add Call-ID (when available) as a dedicated JSON attribute       * **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') from the value of the log message field       * **M** - strip EOL ('\n') from the value of the log message field
       * **N** - do not add EOL at the end of JSON document       * **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://cee.mitre.org/language/1.0-beta1/core-profile.html
  
 Example of JSON logs when running Kamailio with "**--log-engine=json:M**" : Example of JSON logs when running Kamailio with "**--log-engine=json:M**" :
Line 3958: Line 3970:
  
 { "idx": 1, "pid": 18239, "level": "DEBUG", "module": "core", "file": "core/socket_info.c", "line": 644, "function": "grep_sock_info", "logprefix": "{1 1 OPTIONS 715678756@192.168.188.20} ", "message": "checking if host==us: 9==9 && [127.0.0.1] == [127.0.0.1]" } { "idx": 1, "pid": 18239, "level": "DEBUG", "module": "core", "file": "core/socket_info.c", "line": 644, "function": "grep_sock_info", "logprefix": "{1 1 OPTIONS 715678756@192.168.188.20} ", "message": "checking if host==us: 9==9 && [127.0.0.1] == [127.0.0.1]" }
 +</code>
  
 +Example config for printing log message with **j** flag:
 +
 +<code>
 +xinfo("{ \"src_ip\": \"$si\", \"method\": \"$rm\", \"text\": \"request received\" }");
 +</code>
 +
 +Example config for printing log messages with **p** flag:
 +
 +<code>
 +log_prefix=", \"src_ip\": \"$si\", \"tv\": $TV(Sn), \"mt\": $mt, \"ua\": \"$(ua{s.escape.common})\", \"cseq\": \"$hdr(CSeq)\""
 </code> </code>
cookbooks/devel/core.txt · Last modified: 2022/04/11 17:10 by bkaufman