Table of Contents
List of Tables
List of Examples
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. The server may also advertise different network addresses than the ones it is actually listening on.
The stun server will use 4 sockets:
where ip1 / port1 represent an UDP SIP listener and ip2 / port2 are configured via the alternate_ip and alternate_port parameters.
The sockets come from existing SIP sockets or are created.
Socket1 must allways be a SIP UDP listener from OpenSIPS.
If use_listeners_as_primary is enabled the STUN server will actually use multiple sets of sockets obtained from the IP/port combinations described above, each set corresponding to a SIP UDP listener from OpenSIPS.
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.
This stun implements RFC3489 (and XOR_MAPPED_ADDRESS from RFC5389)
Not supported attributes:
and associated ERROR_CODEs
The IP of an interface which is configured as an UDP SIP listener in OpenSIPS. This is a mandatory parameter, unless use_listeners_as_primary is enabled.
Syntax: "ip [/ advertised_ip]
By default, the primary_ip and the advertised primary_ip will be identical. This may be changed with an optional "/ xxx.xxx.xxx.xxx" string.
Example 1.1. Set
primary_ip
parameter
... modparam("stun", "primary_ip", "192.168.0.100") # Example of a STUN server within OpenSIPS which is behind NAT modparam("stun", "primary_ip", "192.168.0.100 / 64.50.46.78") ...
The port configured (together with the primary_ip) as an UDP SIP listener in OpenSIPS. The default value is 5060.
Syntax: "port [/ advertised_port]
By default, the primary_port and the advertised primary_port will be identical. This may be changed with an optional "/ adv_port" string.
Example 1.2. Set primary_port
parameter
... modparam("stun", "primary_port", "5060") # Listening on a primary port, but advertising a different one modparam("stun", "primary_port", "5060 / 5062") ...
Another IP from another interface. This is a mandatory parameter.
If use_listeners_as_primary is enabled, the alternate IP must be either:
an IP from an existing UDP SIP listener configured in OpenSIPS, but one that is different from all the other UPD listeners;
an IP that is different from the UDP SIP listeners configured in OpenSIPS.
Syntax: "ip [/ advertised_ip]
By default, the alternate_ip and the advertised alternate_ip will be identical. This may be changed with an optional "/ xxx.xxx.xxx.xxx" string.
Example 1.3. Set
alternate_ip
parameter
... modparam("stun","alternate_ip","11.22.33.44") # Example of a STUN server within OpenSIPS which is behind NAT modparam("stun", "alternate_ip", "192.168.0.100 / 64.78.46.50") ...
The port used by the STUN server for the second interface. The default value is 3478 (default STUN port).
If use_listeners_as_primary is enabled, the alternate port must be either:
a port from an existing UDP SIP listener configured in OpenSIPS, but one that is different from all the other UPD listeners;
a port that is different from the UDP SIP listeners configured in OpenSIPS.
Syntax: "port [/ advertised_port]
By default, the alternate_port and the advertised alternate_port will be identical. This may be changed with an optional "/ adv_port" string.
Example 1.4. Set
alternate_port
parameter
... modparam("stun","alternate_port","3479") # Listening on an alternate port, but advertising a different one modparam("stun", "alternate_port", "5060 / 5062") ...
Setting this parameter to 1 will allow all configured UDP SIP listeners to be automatically used as "primary" STUN sockets.
The primary_ip and primary_port parameters will be ignored when this behavior is enabled.
The default value is 0 (disabled).
Example 1.5. Set
use_listeners_as_primary
parameter
... modparam("stun","use_listeners_as_primary",1) ...
Table 2.1. 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) | 19 | 14 | 194 | 179 |
3. | Liviu Chircu (@liviuchircu) | 17 | 12 | 259 | 117 |
4. | Razvan Crainea (@razvancrainea) | 14 | 12 | 27 | 20 |
5. | Vlad Paiu (@vladpaiu) | 7 | 5 | 25 | 4 |
6. | Bernard | 7 | 1 | 391 | 75 |
7. | Maksym Sobolyev (@sobomax) | 4 | 2 | 2 | 3 |
8. | Peter Lemenkov (@lemenkov) | 3 | 1 | 1 | 1 |
9. | Vlad Patrascu (@rvlad-patrascu) | 2 | 1 | 1 | 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. Regarding imported patches/code, we do our best to count the work on behalf of the proper owner, as per the "fix_authors" and "mod_renames" arrays in opensips/doc/build-contrib.sh. If you identify any patches/commits which do not get properly attributed to you, please submit a pull request which extends "fix_authors" and/or "mod_renames".
(3) ignoring whitespace edits, renamed files and auto-generated files
Table 2.2. Most recently active contributors(1) to this module
Name | Commit Activity | |
---|---|---|
1. | Bogdan-Andrei Iancu (@bogdan-iancu) | Sep 2009 - May 2023 |
2. | Maksym Sobolyev (@sobomax) | Feb 2023 - Feb 2023 |
3. | Bernard | Oct 2021 - Oct 2021 |
4. | Razvan Crainea (@razvancrainea) | Oct 2011 - Sep 2019 |
5. | Vlad Paiu (@vladpaiu) | Sep 2011 - Aug 2019 |
6. | Liviu Chircu (@liviuchircu) | Mar 2014 - Nov 2018 |
7. | Peter Lemenkov (@lemenkov) | Jun 2018 - Jun 2018 |
8. | Vlad Patrascu (@rvlad-patrascu) | May 2017 - May 2017 |
9. | Razvan Pistolea | Sep 2009 - Sep 2009 |
(1) including any documentation-related commits, excluding merge commits
Last edited by: Bernard, Peter Lemenkov (@lemenkov), Liviu Chircu (@liviuchircu), Bogdan-Andrei Iancu (@bogdan-iancu), Razvan Pistolea.
Documentation Copyrights:
Copyright © 2009 Voice Sistem SRL