MI_DATAGRAM module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This is a module which provides a UNIX/UDP SOCKET transport layer implementation for the Management Interface.
DATAGRAM command syntax
Section titled “DATAGRAM command syntax”The MI requests and replies follow the JSON-RPC syntax.
If case of an error generated by the MI engine, mostly internal errors, an error message in plain text is sent back in the datagram.
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- No dependencies on other OpenSIPS modules.
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”socket_name (string)
Section titled “socket_name (string)”The name of a UNIX SOCKET or an IP address. The UNIX datagram or UDP socket will be created using this parameter in order to read the external commands. Both IPv4 and IPv6 are supported.
Default value is NONE.
...modparam("mi_datagram", "socket_name", "/tmp/opensips.sock")...modparam("mi_datagram", "socket_name", "udp:192.168.2.133:8080")...children_count (string)
Section titled “children_count (string)”The number of child processes to be created. Each child process will be a datagram server.
Default value is 1.
...modparam("mi_datagram", "children_count", 3)...unix_socket_mode (integer)
Section titled “unix_socket_mode (integer)”Permission to be used for creating the listening UNIX datagram socket. Not necessary for a UDP socket. It follows the UNIX conventions.
Default value is 0660 (rw-rw----).
...modparam("mi_datagram", "unix_socket_mode", 0600)...unix_socket_group (integer) unix_socket_group (string)
Section titled “unix_socket_group (integer) unix_socket_group (string)”Group to be used for creating the listening UNIX socket.
Default value is the inherited one.
...modparam("mi_datagram", "unix_socket_group", 0)modparam("mi_datagram", "unix_socket_group", "root")...unix_socket_user (integer) unix_socket_group (string)
Section titled “unix_socket_user (integer) unix_socket_group (string)”User to be used for creating the listening UNIX socket.
Default value is the inherited one.
...modparam("mi_datagram", "unix_socket_user", 0)modparam("mi_datagram", "unix_socket_user", "root")...socket_timeout (integer)
Section titled “socket_timeout (integer)”The reply will expire after trying to sent it for socket_timeout milliseconds.
Default value is 2000.
...modparam("mi_datagram", "socket_timeout", 2000)...trace_destination (string)
Section titled “trace_destination (string)”Trace destination as defined in the tracing module. Currently the only tracing module is proto_hep. This is where traced mi messages will go.
**WARNING:**A tracing module must be loaded in order for this parameter to work. (for example proto_hep).
Default value is none(not defined).
...modparam("proto_hep", "trace_destination", "[hep_dest]10.0.0.2;transport=tcp;version=3")
modparam("mi_datagram", "trace_destination", "hep_dest")...trace_bwlist (string)
Section titled “trace_bwlist (string)”Filter traced mi commands based on a blacklist or a whitelist. trace_destination must be defined for this parameter to have any purpose. Whitelists can be defined using ‘w’ or ‘W’, blacklists using ‘b’ or ‘B’. The type is separate by the actual blacklist by ’:’. The mi commands in the list must be separated by ’,’.
Defining a blacklists means all the commands that are not blacklisted will be traced. Defining a whitelist means all the commands that are not whitelisted will not be traced. WARNING: One can’t define both a whitelist and a blacklist. Only one of them is allowed. Defining the parameter a second time will just overwrite the first one.
**WARNING:**A tracing module must be loaded in order for this parameter to work. (for example proto_hep).
Default value is none(not defined).
...## blacklist ps and which mi commands## all the other commands shall be tracedmodparam("mi_datagram", "trace_bwlist", "b: ps, which")...## allow only sip_trace mi command## all the other commands will not be tracedmodparam("mi_datagram", "trace_bwlist", "w: sip_trace")...pretty_printing (int)
Section titled “pretty_printing (int)”Indicates whether the JSONRPC responses sent through MI should be pretty-printed or not.
Default value is “0 - no pretty-printing”.
...modparam("mi_fifo", "pretty_printing", 1)...Exported Functions
Section titled “Exported Functions”No function exported to be used from configuration file.
Example
Section titled “Example”This is an example showing the DATAGRAM format for the “get_statistics dialog: tm:” MI commad: request.
{"jsonrpc":"2.0","method":"get_statistics","id":"1065","params":[["dialog:","tm:"]]}Frequently Asked Questions
Section titled “Frequently Asked Questions”Q: Both UNIX and UDP type of socket can be created simultaneusly?
This version supports only one kind of socket at a time. If there are more than one value set for socket_name the last one will take effect.
Q: Is there a limit in the datagram request’s size?
The maximum length of a datagram request or reply is 65457 bytes.
Q: Where can I find more about OpenSIPS?
Take a look at https://opensips.org/.
Q: Where can I post a question about this module?
First at all check if your question was already answered on one of our mailing lists:
E-mails regarding any stable OpenSIPS release should be sent to users@lists.opensips.org and e-mails regarding development versions should be sent to devel@lists.opensips.org.
If you want to keep the mail private, send it to users@lists.opensips.org.
Q: How can I report a bug?
Please follow the guidelines provided at: https://github.com/OpenSIPS/opensips/issues.
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. | Bogdan-Andrei Iancu (@bogdan-iancu) | 48 | 35 | 498 | 441 |
| 2. | Ancuta Onofrei | 28 | 2 | 2423 | 252 |
| 3. | Vlad Patrascu (@rvlad-patrascu) | 22 | 2 | 213 | 1073 |
| 4. | Razvan Crainea (@razvancrainea) | 13 | 11 | 51 | 35 |
| 5. | Liviu Chircu (@liviuchircu) | 13 | 10 | 85 | 116 |
| 6. | Daniel-Constantin Mierla (@miconda) | 9 | 7 | 18 | 16 |
| 7. | Stefan Darius (@dariusstefan) | 8 | 4 | 355 | 48 |
| 8. | Ionut Ionita (@ionutrazvanionita) | 8 | 4 | 267 | 40 |
| 9. | Henning Westerholt (@henningw) | 5 | 3 | 10 | 12 |
| 10. | Maksym Sobolyev (@sobomax) | 4 | 2 | 1 | 2 |
All remaining contributors: Walter Doekes (@wdoekes), Klaus Darilion, Julián Moreno Patiño, Konstantin Bokarius, Peter Lemenkov (@lemenkov), Dusan Klinec (@ph4r05), Edson Gellert Schubert.
(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) | Oct 2011 - Jun 2026 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | Jun 2007 - Dec 2025 |
| 4. | Liviu Chircu (@liviuchircu) | Mar 2014 - May 2024 |
| 5. | Maksym Sobolyev (@sobomax) | Feb 2023 - Feb 2023 |
| 6. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - Jan 2019 |
| 7. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
| 8. | Ionut Ionita (@ionutrazvanionita) | Jan 2017 - Feb 2017 |
| 9. | Julián Moreno Patiño | Feb 2016 - Feb 2016 |
| 10. | Dusan Klinec (@ph4r05) | Dec 2015 - Dec 2015 |
All remaining contributors: Walter Doekes (@wdoekes), Henning Westerholt (@henningw), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Ancuta Onofrei.
(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), Vlad Patrascu (@rvlad-patrascu), Peter Lemenkov (@lemenkov), Ionut Ionita (@ionutrazvanionita), Julián Moreno Patiño, Bogdan-Andrei Iancu (@bogdan-iancu), Klaus Darilion, Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Ancuta Onofrei.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0