STUN module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”The idea
Section titled “The idea”A stun server working with the same port as SIP (5060) in order to gain accurate information. The benefit would be an exact external address in the case of NATs translating differently when given different destination ports.
Basic Operation
Section titled “Basic Operation” The stun server will use 4 sockets: socket1 = ip1 : port1 socket2 = ip1 : port2 socket3 = ip2 : port1 socket4 = ip2 : port2The sockets come from existing SIP sockets or are created.
socket1 will allways be the the SIP socket.
The server will create a separate process. This process will listen for data on created sockets.
The server will register a callback function to SIP. This function is called when a specific (stun)header is found.
Supported STUN Attributes
Section titled “Supported STUN Attributes”This stun implements rfc 3489 (and XOR_MAPPED_ADDRESS from rfc 5389)
MAPPED_ADDRESS, RESPONSE_ADDRESS, CHANGE_REQUEST, SOURCE_ADDRESS, CHANGED_ADDRESS, ERROR_CODE, UNKNOWN_ATTRIBUTES, REFLECTED_FROM, XOR_MAPPED_ADDRESS
Not supported attributes:
USERNAME, PASSWORD, MESSAGE_INTEGRITY, and associated ERROR_CODEs
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”primary_ip (str)
Section titled “primary_ip (str)”The ip of the interface SIP is working on.
...
modparam("stun","primary_ip","192.168.0.100")...primary_port (str)
Section titled “primary_port (str)”The port SIP is working on.
...
modparam("stun","primary_port","5060")...alternate_ip (str)
Section titled “alternate_ip (str)”Another ip from another interface.
...
modparam("stun","alternate_ip","11.22.33.44")...alternate_port (str)
Section titled “alternate_port (str)”Another port used by STUN.
...
modparam("stun","alternate_port","3479")...Exported MI Functions
Section titled “Exported MI Functions”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 Pistolea | 20 | 3 | 1891 | 19 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 12 | 9 | 114 | 107 |
| 3. | Stefan Darius (@dariusstefan) | 6 | 3 | 173 | 11 |
| 4. | Razvan Crainea (@razvancrainea) | 3 | 1 | 2 | 2 |
| 5. | Vlad Paiu (@vladpaiu) | 2 | 1 | 3 | 0 |
(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. | Vlad Paiu (@vladpaiu) | Nov 2011 - Nov 2011 |
| 4. | Bogdan-Andrei Iancu (@bogdan-iancu) | Sep 2009 - Apr 2011 |
| 5. | Razvan Pistolea | Sep 2009 - Sep 2009 |
(1) including any documentation-related commits, excluding merge commits
Documentation
Section titled “Documentation”Contributors
Section titled “Contributors”Last edited by: Razvan Crainea (@razvancrainea), Bogdan-Andrei Iancu (@bogdan-iancu), Razvan Pistolea.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0