AAA RADIUS module
Admin Guide
Section titled “Admin Guide”Overview
Section titled “Overview”This module provides a Radius implementation for the AAA API from the core.
It also provides two functions to be used from the script for generating custom Radius acct and auth requests. Detection and handling of SIP-AVPs from Radius replies is automatically and transparently done by the module.
Any module that wishes to use it has to do the following:
- include aaa.h
- make a bind call with a proper radius specific url
Dependencies
Section titled “Dependencies”OpenSIPS Modules
Section titled “OpenSIPS Modules”None.
External Libraries or Applications
Section titled “External Libraries or Applications”One of the following libraries must be installed before running OpenSIPS with this module loaded:
- radiusclient-ng 0.5.0 or higher See http://developer.berlios.de/projects/radiusclient-ng/.
- freeradius-client See http://freeradius.org/.
By default, radiusclient-ng is used. To change at compile time to freeradius, uncomment the USE_FREERADIUS=1 line in main Makefile.
Exported Parameters
Section titled “Exported Parameters”Sets of Radius AVPs to be used when building custom RADIUS requests (set of input RADIUS AVPs) or when fetching data from the RADIUS reply (set of output RADIUS AVPs).
The format for a set definition is the following:
- ” set_name = ( attribute_name1 = var1 [, attribute_name2 = var2 ]* ) ”
The left-hand side of the assignment must be an attribute name known by the RADIUS dictionary.
The right-hand side of the assignment must be a script pseudo variable or a script AVP. For more information about them see CookBooks - Scripting Variables.
...modparam("aaa_radius","sets","set4 = ( Sip-User-ID = $avp(i:10) , Sip-From-Tag=$si,Sip-To-Tag=$tt ) ")...
...modparam("aaa_radius","sets","set1 = (User-Name=$var(usr), Sip-Group = $var(grp), Service-Type = $var(type)) ")...
...modparam("aaa_radius","sets","set2 = (Sip-Group = $var(sipgrup)) ")...radius_config
Section titled “radius_config”Radiusclient configuration file.
This parameter is optional. It must be set only if the radius_send_acct and radius_send_auth functions are used.
...modparam("aaa_radius", "radius_config", "/etc/radiusclient-ng/radiusclient.conf")...Exported Functions
Section titled “Exported Functions”radius_send_auth(input_set_name,output_set_name)
Section titled “radius_send_auth(input_set_name,output_set_name)”This function can be used from the script to make custom radius authentication request. The function takes two parameters.
The first parameter represents the name of the set that contains the list of attributes and pvars that will form the authentication request (see the “sets” module parameter).
The second parameter represents the name of the set that contains the list of attributes and pvars that will be extracted form the authentication reply (see the “sets” module parameter).
The sets must be defined using the “sets” exported parameter.
The function return TRUE (retcode 1) if authentication was successful, FALSE (retcode -1) if an error (any kind of error) occured during authentication processes or FALSE (retcode -2) if authentication was rejected or denied by RADIUS server.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, ERROR_ROUTE and LOCAL_ROUTE.
...radius_send_auth("set1","set2");switch ($rc) { case 1: xlog("authentication ok \n"); break; case -1: xlog("error during authentication\n"); break; case -2: xlog("authentication denied \n"); break;}...radius_send_acct(input_set_name)
Section titled “radius_send_acct(input_set_name)”This function can be used from the script to make custom radius authentication request. The function takes only one parameter that represents the name of the set that contains the list of attributes and pvars that will form the accounting request.
Only one set is needed as a parameter because no AVPs can be extracted from the accounting replies.
The set must be defined using the “sets” exported parameter.
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE, BRANCH_ROUTE, ERROR_ROUTE and LOCAL_ROUTE.
...radius_send_acct("set1");...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. | Irina-Maria Stanescu | 24 | 9 | 1474 | 107 |
| 2. | Bogdan-Andrei Iancu (@bogdan-iancu) | 11 | 9 | 80 | 47 |
| 3. | Stefan Darius (@dariusstefan) | 6 | 3 | 222 | 26 |
| 4. | Anca Vamanu | 4 | 2 | 5 | 3 |
| 5. | Razvan Crainea (@razvancrainea) | 4 | 2 | 2 | 2 |
(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. | Bogdan-Andrei Iancu (@bogdan-iancu) | Aug 2009 - Jul 2026 |
| 2. | Stefan Darius (@dariusstefan) | Jun 2026 - Jul 2026 |
| 3. | Razvan Crainea (@razvancrainea) | Sep 2010 - Jun 2026 |
| 4. | Irina-Maria Stanescu | Jul 2009 - Jul 2010 |
| 5. | Anca Vamanu | 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), Irina-Maria Stanescu.
License
Section titled “License”All documentation files (i.e. .md extension) are licensed under the Creative Common License 4.0