AUTH_DIAMETER module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module implements SIP authentication and authorization with DIAMETER server, namely DIameter Server Client (DISC).
NOTE: diameter support was developed for DISC (DIameter Server Client project at http://developer.berlios.de/projects/disc/). This project seems to be no longer maintained and DIAMETER specifications were updated in the meantime. Thus, the module is obsolete and needs rework to be usable with opendiameter or other DIAMETER servers.
The digest authentication mechanism is presented in next figure.
... a) First phase of Digest Authentication for SIP:
+----+ SIP INVITE +=====+ DIAMETER +------+ +------+ | | no Auth hdr #/////# AA-Request | | | | | |---------1--->#/////#-------2------->| |---2-->| | |UAC | #UAS//# |DClnt | |DSrv | | |<-----4-------#(SER)#<------3--------|(DISC)|<--3---|(DISC)| | | 401 #/////# DIAMETER | | | | +----+ Unauthorized +=====+ AA-Answer +------+ +------+ Result-Code=4001
b) Second phase of Digest Authentication for SIP:
+----+ SIP INVITE +=====+ DIAMETER +------+ +----+ | | Auth hdr #/////# AA-Request | | | | | |--------1---->#/////#-------2------>| |---2-->| | |UAC | #UAS//# |DClnt | |DSrv| | |<-------4-----#(SER)#<------3-------| |<--3---| | | | 200 OK #/////# DIAMETER | | | | +----+ +=====+ AA-Answer +------+ +----+ Result-Code=2001
...Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”The following modules must be loaded before this module:
- sl - used to send stateless replies.
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”diameter_client_host (string)
Section titled “diameter_client_host (string)”Hostname of the machine where the DIAMETER Client is running.
Default value is “localhost”.
...modparam("auth_diameter", "diameter_client_host", "10.10.10.10")...diameter_client_port (int)
Section titled “diameter_client_port (int)”Port number where the DIAMETER Client is listening.
Default value is “3000”.
...modparam("auth_diameter", "diameter_client_port", 3000)...use_domain (int)
Section titled “use_domain (int)”Specifies whether the domain name part of URI is used when checking the user’s privileges.
Default value is “0 (0==false and 1==true )”.
...modparam("auth_diameter", "use_domain", 1)...Exported Functions
Section titled “Exported Functions”diameter_www_authorize(realm)
Section titled “diameter_www_authorize(realm)”SIP Server checks for authorization having a DIAMETER server in backend. If no credentials are provided inside the SIP request then a challenge is sent back to UAC. If the credentials don’t match the ones computed by DISC then “403 Forbidden” is sent back.
Negative codes may be interpreted as follows:
- -5 (generic error) - some generic error occurred and no reply was sent out;
- -3 (stale nonce) - stale nonce;
Meaning of the parameters is as follows:
- realm - the realm to be use for authentication and authorization. The string may contain pseudo variables.
This function can be used from REQUEST_ROUTE.
...if(!diameter_www_authorize("siphub.net")){ /* user is not authorized */ exit;};...diameter_proxy_authorize(realm)
Section titled “diameter_proxy_authorize(realm)”SIP Proxy checks for authorization having a DIAMETER server in backend. If no credentials are provided inside the SIP request then a challenge is sent back to UAC. If the credentials don’t match the ones computed by DISC then “403 Forbidden” is sent back. For more about the negative return codes, see the above function.
Meaning of the parameters is as follows:
- realm - the realm to be use for authentication and authorization. The string may contain pseudo variables.
This function can be used from REQUEST_ROUTE.
...if(!diameter_proxy_authorize("siphub.net")){ /* user is not authorized */ exit;};...diameter_is_user_in(who, group)
Section titled “diameter_is_user_in(who, group)”The method performs group membership checking with DISC.
Meaning of the parameters is as follows:
- who - what header to be used to get the SIP URI that is wanted to be checked being member in a certain group. It can be: “Request-URI”, “From”, “To” or “Credentials”.
- group - the group name where to check if the user is part of.
This function can be used from REQUEST_ROUTE.
...if(!diameter_is_user_in("From", "voicemail")){ /* user is not authorized */ exit;};...Installation and Running
Section titled “Installation and Running”Notes about installation and running.
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. | Elena-Ramona Modroiu | 36 | 4 | 3607 | 16 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 27 | 17 | 362 | 360 |
| 3. | Daniel-Constantin Mierla (@miconda) | 15 | 13 | 52 | 44 |
| 4. | Stefan Darius (@dariusstefan) | 7 | 3 | 270 | 29 |
| 5. | Andrei Pelinescu-Onciul | 5 | 3 | 19 | 14 |
| 6. | Henning Westerholt (@henningw) | 5 | 3 | 7 | 7 |
| 7. | Elena-Ramona Modroiu | 4 | 2 | 19 | 3 |
| 8. | Anatoly Pidruchny | 3 | 1 | 25 | 23 |
| 9. | Jan Janak (@janakj) | 3 | 1 | 22 | 22 |
| 10. | Razvan Crainea (@razvancrainea) | 3 | 1 | 2 | 2 |
All remaining contributors: Konstantin Bokarius, Jesus Rodrigues, 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) | Jun 2026 - Jun 2026 |
| 3. | Bogdan-Andrei Iancu (@bogdan-iancu) | Sep 2003 - Jul 2008 |
| 4. | Daniel-Constantin Mierla (@miconda) | Nov 2006 - Mar 2008 |
| 5. | Konstantin Bokarius | Mar 2008 - Mar 2008 |
| 6. | Edson Gellert Schubert | Feb 2008 - Feb 2008 |
| 7. | Elena-Ramona Modroiu | Oct 2005 - Feb 2008 |
| 8. | Henning Westerholt (@henningw) | Sep 2007 - Dec 2007 |
| 9. | Jesus Rodrigues | Dec 2007 - Dec 2007 |
| 10. | Anatoly Pidruchny | Apr 2007 - Apr 2007 |
All remaining contributors: Jan Janak (@janakj), Andrei Pelinescu-Onciul, Elena-Ramona Modroiu.
(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), Daniel-Constantin Mierla (@miconda), Konstantin Bokarius, Edson Gellert Schubert, Elena-Ramona Modroiu, Henning Westerholt (@henningw), Anatoly Pidruchny, Elena-Ramona Modroiu.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0