SIPCAPTURE module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”Offer a possibility to store incoming/outgoing SIP messages in database.
OpenSIPs can capture SIP messages in three mode
- IPIP encapsulation. (ETHHDR+IPHDR+IPHDR+UDPHDR).
- Monitoring/mirroring port.
- Homer encapsulation protocl mode (HEP v1).
The capturing can be turned on/off using fifo commad.
opensipsctl fifo sip_capture on
opensipsctl fifo sip_capture off
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- database module - mysql, postrgress, dbtext, unixodbc…
External Libraries or Applications
Section titled “External Libraries or Applications”The following libraries or applications must be installed before running OpenSIPS with this module loaded:
- None.
Exported Parameters
Section titled “Exported Parameters”db_url (str)
Section titled “db_url (str)”Database URL.
Default value is "".
...modparam("sipcapture", "db_url", "mysql://user:passwd@host/dbname")...table_name (str)
Section titled “table_name (str)”Name of the table’s name where to store the SIP messages.
Default value is “sip_capture”.
...modparam("sipcapture", "table_name", "homer_capture")...capture_on (integer)
Section titled “capture_on (integer)”Parameter to enable/disable capture globaly (on(1)/off(0))
Default value is “0”.
...modparam("sipcapture", "capture_on", 1)...hep_capture_on (integer)
Section titled “hep_capture_on (integer)”Parameter to enable/disable capture of HEP (on(1)/off(0))
Default value is “0”.
...modparam("sipcapture", "hep_capture_on", 1)...raw_ipip_capture_on (integer)
Section titled “raw_ipip_capture_on (integer)”Parameter to enable/disable IPIP capturing (on(1)/off(0))
Default value is “0”.
...modparam("sipcapture", "raw_ipip_capture_on", 1)...raw_moni_capture_on (integer)
Section titled “raw_moni_capture_on (integer)”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”.
...modparam("sipcapture", "raw_moni_capture_on", 1)...raw_socket_listen (string)
Section titled “raw_socket_listen (string)”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 "".
...modparam("sipcapture", "raw_socket_listen", "10.0.0.1:5060-5090")...modparam("sipcapture", "raw_socket_listen", "10.0.0.1:5060")...raw_interface (string)
Section titled “raw_interface (string)”Name of the interface to bind on the raw socket.
Default value is "".
...modparam("sipcapture", "raw_interface", "eth0")...raw_sock_children (integer)
Section titled “raw_sock_children (integer)”Parameter define how much children must be created to listen the raw socket.
Default value is “1”.
...modparam("sipcapture", "raw_sock_children", 6)...promiscuous_on (integer)
Section titled “promiscuous_on (integer)”Parameter to enable/disable promiscuous mode on the raw socket. Linux only.
Default value is “0”.
...modparam("sipcapture", "promiscuous_on", 1)...raw_moni_bpf_on (integer)
Section titled “raw_moni_bpf_on (integer)”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”.
...modparam("sipcapture", "raw_moni_bpf_on", 1)...capture_node (str)
Section titled “capture_node (str)”Name of the capture node.
Default value is “homer01”.
...modparam("sipcapture", "capture_node", "homer03")...Exported MI Functions
Section titled “Exported MI Functions”sip_capture
Section titled “sip_capture”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_Database setup
Section titled “Database setup”Before running OpenSIPS with sipcapture, 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 or the sipcapture-st-create.sql SQL script in the database directories in the opensips/scripts folder as template. You can also find the complete database documentation on the project webpage, http://www.opensips.org/html/docs/db/db-schema-devel.html.
Limitation
Section titled “Limitation”- Only one capturing mode on RAW socket is supported: IPIP or monitoring/mirroring port. Don’t activate both at the same time. 2. By default MySQL doesn’t support INSERT DELAYED for partitioning table. You can patch MySQL (http://bugs.mysql.com/bug.php?id=50393) or use separate tables (pseudo partitioning) 3. Mirroring port capturing works only on Linux.
Contributors
Section titled “Contributors”By Commit Statistics
Section titled “By Commit Statistics”Top contributors by DevScore(1), authored commits(2) and lines added/removed(3)
| # | Name | DevScore | Commits | Lines++ | Lines— |
|---|---|---|---|---|---|
| 1. | Alexandr Dubovikov (@adubovikov) | 22 | 2 | 2360 | 0 |
| 2. | Stefan Darius (@dariusstefan) | 10 | 5 | 369 | 46 |
| 3. | Liviu Chircu (@liviuchircu) | 10 | 2 | 302 | 300 |
| 4. | Ionut Ionita (@ionutrazvanionita) | 5 | 3 | 3 | 8 |
| 5. | Bogdan-Andrei Iancu (@bogdan-iancu) | 4 | 2 | 2 | 1 |
| 6. | Vlad Paiu (@vladpaiu) | 3 | 1 | 3 | 3 |
| 7. | Razvan Crainea (@razvancrainea) | 3 | 1 | 2 | 2 |
| 8. | Dusan Klinec (@ph4r05) | 3 | 1 | 1 | 1 |
(1) DevScore = author_commits + author_lines_added / (project_lines_added / project_commits) + author_lines_deleted / (project_lines_deleted / project_commits)
(2) including any documentation-related commits, excluding merge commits
(3) ignoring whitespace edits, renamed files and auto-generated files
By Commit Activity
Section titled “By Commit Activity”| # | Name | Commit Activity |
|---|---|---|
| 1. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 2. | Razvan Crainea (@razvancrainea) | Jun 2026 - Jun 2026 |
| 3. | Ionut Ionita (@ionutrazvanionita) | Jan 2016 - Oct 2016 |
| 4. | Dusan Klinec (@ph4r05) | Dec 2015 - Dec 2015 |
| 5. | Liviu Chircu (@liviuchircu) | Mar 2014 - Jul 2014 |
| 6. | Bogdan-Andrei Iancu (@bogdan-iancu) | Aug 2012 - May 2014 |
| 7. | Vlad Paiu (@vladpaiu) | Mar 2013 - Mar 2013 |
| 8. | Alexandr Dubovikov (@adubovikov) | Nov 2011 - Nov 2011 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Vlad Paiu (@vladpaiu), Alexandr Dubovikov (@adubovikov).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0