PROTO_BIN module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”The proto_bin module is a transport module which implements Binary Interface TCP-based communication. It does not handle TCP connections management, but only offers higher-level primitives to read and write BIN messages over TCP. It calls registered callback functions for every complete message received.
Once loaded, you will be able to define BIN listeners in your configuration file by adding their IP and, optionally, a listening port, similar to this example:
...socket = bin:127.0.0.1 # change the listening IPsocket = bin:127.0.0.1:5080 # change the listening IP and port...Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- None.
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”bin_port (integer)
Section titled “bin_port (integer)”The default port to be used by all TCP listeners.
Default value is 5555.
...modparam("proto_bin", "bin_port", 6666)...bin_send_timeout (integer)
Section titled “bin_send_timeout (integer)”Time in milliseconds after a TCP connection will be closed if it is not available for blocking writing in this interval (and OpenSIPS wants to send something on it).
Default value is 100 ms.
...modparam("proto_bin", "bin_send_timeout", 200)...bin_max_msg_chunks (integer)
Section titled “bin_max_msg_chunks (integer)”The maximum number of chunks in which a BIN message is expected to arrive via TCP. If a received packet is more fragmented than this, the connection is dropped (either the connection is very overloaded and this leads to high fragmentation - or we are the victim of an ongoing attack where the attacker is sending very fragmented traffic in order to decrease server performance).
Default value is 32.
...modparam("proto_bin", "bin_max_msg_chunks", 8)...bin_async (integer)
Section titled “bin_async (integer)”Specifies whether the TCP connect and write operations should be done in an asynchronous mode (non-blocking connect and write) or not. If disabled, OpenSIPS will block and wait for TCP operations like connect and write.
Default value is 1 (enabled).
...modparam("proto_bin", "bin_async", 0)...bin_async_max_postponed_chunks (integer)
Section titled “bin_async_max_postponed_chunks (integer)”If bin_async is enabled, this specifies the maximum number of BIN messages that can be stashed for later/async writing. If the connection pending writes exceed this number, the connection will be marked as broken and dropped.
Default value is 32.
...modparam("proto_bin", "bin_async_max_postponed_chunks", 16)...bin_async_local_connect_timeout (integer)
Section titled “bin_async_local_connect_timeout (integer)”If bin_async is enabled, this specifies the number of milliseconds that a connect will be tried in blocking mode (optimization). If the connect operation lasts more than this, the connect will go to async mode and will be passed to TCP MAIN for polling.
Default value is 100 ms.
...modparam("proto_bin", "bin_async_local_connect_timeout", 200)...bin_async_local_write_timeout (integer)
Section titled “bin_async_local_write_timeout (integer)”If bin_async is enabled, this specifies the number of milliseconds that a write op will be tried in blocking mode (optimization). If the write operation lasts more than this, the write will go to async mode and will be passed to bin MAIN for polling.
Default value is 10 ms.
...modparam("proto_bin", "tcp_async_local_write_timeout", 100)...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. | Razvan Crainea (@razvancrainea) | 28 | 19 | 60 | 468 |
| 2. | Ionel Cerghit (@ionel-cerghit) | 15 | 3 | 1196 | 38 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | 9 | 7 | 25 | 7 |
| 4. | Liviu Chircu (@liviuchircu) | 8 | 6 | 33 | 45 |
| 5. | Vlad Patrascu (@rvlad-patrascu) | 8 | 3 | 160 | 135 |
| 6. | Stefan Darius (@dariusstefan) | 7 | 4 | 229 | 38 |
| 7. | Eseanu Marius Cristian (@eseanucristian) | 4 | 2 | 1 | 5 |
| 8. | Nick Altmann (@nikbyte) | 3 | 1 | 2 | 2 |
| 9. | Peter Lemenkov (@lemenkov) | 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) | Aug 2015 - Jun 2026 |
| 3. | Liviu Chircu (@liviuchircu) | Mar 2016 - Sep 2021 |
| 4. | Nick Altmann (@nikbyte) | May 2021 - May 2021 |
| 5. | Bogdan-Andrei Iancu (@bogdan-iancu) | Mar 2017 - Apr 2021 |
| 6. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - Feb 2021 |
| 7. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
| 8. | Ionel Cerghit (@ionel-cerghit) | Jul 2015 - Dec 2016 |
| 9. | Eseanu Marius Cristian (@eseanucristian) | Jul 2015 - Jul 2015 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Peter Lemenkov (@lemenkov), Ionel Cerghit (@ionel-cerghit).
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0