Table of Contents
db_url
(str)
table_name
(str)
mt_mode
(str)
hash_source
(str)
db_insert_mode
(integer)
capture_on
(integer)
hep_capture_on
(integer)
raw_ipip_capture_on
(integer)
raw_moni_capture_on
(integer)
raw_socket_listen
(string)
raw_interface
(string)
raw_sock_children
(integer)
promiscuous_on
(integer)
raw_moni_bpf_on
(integer)
capture_node
(str)
List of Examples
db_url
parametersip_capture
parametermt_mode
parametermt_mode
parametercapture_on
parameterhep_capture_on
parameterraw_ipip_capture_on
parameterraw_moni_capture_on
parameterraw_socket_listen
parameterraw_socket_listen
parameterraw_sock_children
parameterpromiscous_on
parameterraw_moni_bpf_on
parametercapture_node
parameterTable of Contents
db_url
(str)
table_name
(str)
mt_mode
(str)
hash_source
(str)
db_insert_mode
(integer)
capture_on
(integer)
hep_capture_on
(integer)
raw_ipip_capture_on
(integer)
raw_moni_capture_on
(integer)
raw_socket_listen
(string)
raw_interface
(string)
raw_sock_children
(integer)
promiscuous_on
(integer)
raw_moni_bpf_on
(integer)
capture_node
(str)
The sipcapture module stores incoming/outgoing SIP messages in database.
Kamailio can capture SIP messages in three modes
IPIP encapsulation. (ETHHDR+IPHDR+IPHDR+UDPHDR).
Monitoring/mirroring port.
Homer encapsulation protocol mode (HEP v1, v2, v3).
The capturing can be turned on/off using mi or rpc commands. Example:
kamctl fifo sip_capture on
kamctl fifo sip_capture off
The following modules must be loaded before this module:
database module - mysql, postrgress, dbtext, unixodbc...
Database URL.
Default value is "".
Example 1.1. Set db_url
parameter
... modparam("sipcapture", "db_url", "mysql://user:passwd@host/dbname") ...
Name of the table's name used to store the SIP messages. Can contain multiple tables, separated by "|".
Default value is "sip_capture".
Example 1.2. Set sip_capture
parameter
... modparam("sipcapture", "table_name", "homer_capture") ... modparam("sipcapture", "table_name", "homer_capture1|homer_capture2"); ...
Name of the mode used for storing data in multiple tables. Modes can be "rand" (random), "round_robin" (use a round_robin algorithm) or "hash" (use hashing to determine the table to store). These modes are only triggered if there is more than one table specified in table_name parameter, separated by "|".
Default value is "rand".
The field of the SIP message used for hashing, when mt_mode is set to "hash". The value can be "call_id", "to_user" or "from_user".
Default value is "call_id".
If set to 1, use INSERT DELAYED to store sip message into capture table when the DB driver has support for it. If no INSERT DELAYED support is offered by DB driver, then standard INSERT is used.
Default value is 0 (no INSERT DELAYED).
Parameter to enable/disable capture globaly (on(1)/off(0))
Default value is "0".
Parameter to enable/disable capture of HEP (on(1)/off(0))
Default value is "0".
Parameter to enable/disable IPIP capturing (on(1)/off(0))
Default value is "0".
Example 1.8. Set raw_ipip_capture_on
parameter
... modparam("sipcapture", "raw_ipip_capture_on", 1) ...
Parameter to enable/disable monitoring/mirroring port capturing (on(1)/off(0)) Only one mode on raw socket can be enabled! Monitoring port capturing currently supported only on Linux.
Default value is "0".
Example 1.9. Set raw_moni_capture_on
parameter
... modparam("sipcapture", "raw_moni_capture_on", 1) ...
Parameter indicate an listen IP address of RAW socket for IPIP capturing. You can also define a port/portrange for IPIP/Mirroring mode, to capture SIP messages in specific ports:
"10.0.0.1:5060" - the source/destination port of the SIP message must be equal 5060
"10.0.0.1:5060-5090" - the source/destination port of the SIP message must be equal or be between 5060 and 5090.
The port/portrange must be defined if you are planning to use mirroring capture! In this case, the part with IP address will be ignored, but to make parser happy, use i.e. 10.0.0.0
Default value is "".
Example 1.10. Set raw_socket_listen
parameter
... modparam("sipcapture", "raw_socket_listen", "10.0.0.1:5060-5090") ... modparam("sipcapture", "raw_socket_listen", "10.0.0.1:5060") ...
Name of the interface to bind on the raw socket.
Default value is "".
Example 1.11. Set raw_socket_listen
parameter
... modparam("sipcapture", "raw_interface", "eth0") ...
Parameter define how many children that must be created to listen the raw socket.
Default value is "1".
Example 1.12. Set raw_sock_children
parameter
... modparam("sipcapture", "raw_sock_children", 6) ...
Parameter to enable/disable promiscuous mode on the raw socket. Linux only.
Default value is "0".
Activate Linux Socket Filter (LSF based on BPF) on the mirroring interface. The structure is defined in linux/filter.h. The default LSF accept a port/portrange from the raw_socket_listen param. Currently LSF supported only on Linux.
Default value is "0".
Name: sip_capture
Parameters:
capture_mode : turns on/off SIP message capturing. Possible values are:
on
off
The parameter is optional - if missing, the command will return the status of the SIP message capturing (as string “on” or “off” ) without changing anything.
MI FIFO Command Format:
:sip_capture:_reply_fifo_file_ capture_mode _empty_line_
Before running Kamailio with the sipcapture module, you have to setup the database tables where the module will store the data. For that, if the table were not created by the installation script or you choose to install everything by yourself you can use the sipcapture_create.sql, SQL script in the sql folder of sipcapture module as template. You can also find the complete database documentation on the project webpage, http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.