src/modules/acc_radius/README
c6ad00da
 ACC_RADIUS Module
d4031fa7
 
 Juha Heinanen
 
    <jh@tutpro.com>
 
 Daniel-Constantin Mierla
 
    asipto.com
    <miconda@gmail.com>
 
 Edited by
 
 Daniel-Constantin Mierla
 
    asipto.com
    <miconda@gmail.com>
 
9cb2a163
    Copyright © 2002, 2003 FhG FOKUS
d4031fa7
      __________________________________________________________________
 
    Table of Contents
 
    1. Admin Guide
 
         1. Overview
         2. Dependencies
 
               2.1. Kamailio Modules
               2.2. External Libraries or Applications
 
ba7961bb
         3. Parameters
d4031fa7
 
               3.1. radius_config (string)
               3.2. radius_flag (integer)
               3.3. radius_missed_flag (integer)
               3.4. service_type (integer)
               3.5. radius_extra (string)
dbaecdfa
               3.6. rad_time_mode(integer)
d4031fa7
 
ba7961bb
         4. Functions
d4031fa7
 
               4.1. acc_rad_request(comment)
 
    List of Examples
 
    1.1. radius_config example
    1.2. radius_flag example
    1.3. radius_missed_flag example
    1.4. service_type example
    1.5. radius_extra example
dbaecdfa
    1.6. rad_time_mode example
    1.7. acc_rad_request usage
d4031fa7
 
 Chapter 1. Admin Guide
 
    Table of Contents
 
    1. Overview
    2. Dependencies
 
         2.1. Kamailio Modules
         2.2. External Libraries or Applications
 
ba7961bb
    3. Parameters
d4031fa7
 
         3.1. radius_config (string)
         3.2. radius_flag (integer)
         3.3. radius_missed_flag (integer)
         3.4. service_type (integer)
         3.5. radius_extra (string)
dbaecdfa
         3.6. rad_time_mode(integer)
d4031fa7
 
ba7961bb
    4. Functions
d4031fa7
 
         4.1. acc_rad_request(comment)
 
 1. Overview
 
    ACC_RADIUS module is used to account transaction information to RADIUS
    server. It binds to ACC module API and uses the same accounting
    mechanisms as for other backends.
 
    Therefore you need this module just to send accounting data to a RADIUS
    server - for more documentation regarding accounting, see the ACC
    readme.
 
 2. Dependencies
 
    2.1. Kamailio Modules
    2.2. External Libraries or Applications
 
 2.1. Kamailio Modules
 
    The module depends on the following modules (in the other words the
    listed modules must be loaded before this module):
      * acc - accounting module
 
 2.2. External Libraries or Applications
 
    The following libraries or applications must be installed before
    running Kamailio with this module loaded:
dbaecdfa
      * radiusclient-ng 0.5.0 or higher, freeradius-client
        https://github.com/FreeRADIUS/freeradius-client/ or radcli
        http://radcli.github.io/radcli/.
      * freeradius-client library can be used after setting FREERADIUS
        variable in source code with 'export FREERADIUS=1' before compile.
      * radcli library can be used after setting RADCLI variable in source
        code with 'export RADCLI=1' before compile.
d4031fa7
 
ba7961bb
 3. Parameters
d4031fa7
 
    3.1. radius_config (string)
    3.2. radius_flag (integer)
    3.3. radius_missed_flag (integer)
    3.4. service_type (integer)
    3.5. radius_extra (string)
dbaecdfa
    3.6. rad_time_mode(integer)
d4031fa7
 
 3.1. radius_config (string)
 
    This parameter is radius specific. Path to radius client configuration
    file, set the referred config file correctly and specify there address
    of server, shared secret (should equal that in
    /usr/local/etc/raddb/clients for freeRadius servers) and dictionary,
    see etc for an example of config file and dictionary.
 
    If the parameter is set to empty string, the RADIUS accounting support
    will be disabled (even if compiled).
 
9cb2a163
    Default value is “NULL”.
d4031fa7
 
    Example 1.1. radius_config example
 ...
 modparam("acc_radius", "radius_config", "/etc/radiusclient/radiusclient.conf")
 ...
 
 3.2. radius_flag (integer)
 
    Request flag which needs to be set to account a transaction -- RADIUS
    specific.
 
    Default value is not-set (no flag).
 
    Example 1.2. radius_flag example
 ...
 modparam("acc_radius", "radius_flag", 2)
 ...
 
 3.3. radius_missed_flag (integer)
 
    Request flag which needs to be set to account missed calls -- RADIUS
    specific.
 
    Default value is not-set (no flag).
 
    Example 1.3. radius_missed_flag example
 ...
 modparam("acc_radius", "radius_missed_flag", 3)
 ...
 
 3.4. service_type (integer)
 
    Radius service type used for accounting.
 
    Default value is 15 (SIP).
 
    Example 1.4. service_type example
 ...
 modparam("acc_radius", "service_type", 16)
 ...
 
 3.5. radius_extra (string)
 
    Extra values to be logged via RADIUS - RADIUS specific.
 
    Default value is NULL.
 
    Example 1.5. radius_extra example
 ...
 modparam("acc_radius", "radius_extra", "via=$hdr(Via[*]); email=$avp(s:email)")
 ...
 
dbaecdfa
 3.6. rad_time_mode(integer)
 
    Radius Event-Timestamp for accounting.
 
    Values can be:
      * 0 - (default), format is only unix timestamp for Event-Timestamp
        (For example: 1445590624)
      * 1 - format is unix timestamp with microseconds in Addition, it
        needs to change Event-Timestamp attribute type in dictionary to
        string both radius server and client (For example:
        1445590624.377372)
 
    Default value is 0 (Unix timestamp).
 
    Example 1.6. rad_time_mode example
 ...
 modparam("acc_radius", "rad_time_mode", 1)
 ...
 
ba7961bb
 4. Functions
d4031fa7
 
    4.1. acc_rad_request(comment)
 
9cb2a163
 4.1.  acc_rad_request(comment)
d4031fa7
 
    Like acc_log_request of acc module, acc_rad_request reports on a SIP
    request event. It reports to radius server as configured in
9cb2a163
    “radius_config”.
d4031fa7
 
    Meaning of the parameters is as follows:
0527dea7
      * comment - Comment to be appended. The first token can be a SIP
        response code that it is wanted to be interpreted as event type
        (e.g., using 200 means the transaction is considered successfully
        responded).
d4031fa7
 
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
 
dbaecdfa
    Example 1.7. acc_rad_request usage
d4031fa7
 ...
 acc_rad_request("Some comment");
 ...
0527dea7
 # write record as when the transaction was responded with a 200 code
d4031fa7
 acc_rad_request("200 From Config");
 ...