uri_radius Module

Juha Heinanen

TutPro Inc.

Edited by

Juha Heinanen

Revision History
Revision $Revision: 4594 $$Date: 2008-08-06 12:08:33 +0200 (Wed, 06 Aug 2008) $

Table of Contents

1. Admin Guide
1.1. Overview
1.2. Dependencies
1.2.1. Kamailio Modules
1.2.2. External Libraries or Applications
1.3. Exported Parameters
1.3.1. radius_config (string)
1.3.2. service_type (integer)
1.3.3. use_sip_uri_host (integer)
1.4. Exported Functions
1.4.1. radius_does_uri_exist([pvar])
1.4.2. radius_does_uri_user_exist([pvar])

List of Examples

1.1. Set param_name parameter
1.2. Set service_type parameter
1.3. Set use_sip_uri_host parameter
1.4. radius_does_uri_exist usage
1.5. radius_does_uri_user_exist usage

Chapter 1. Admin Guide

1.1. Overview

This module implements some URI related Radius based tests.

1.2. Dependencies

1.2.1. Kamailio Modules

The module depends on the following modules (in the other words the listed modules must be loaded before this module):

  • none

1.2.2. External Libraries or Applications

The following libraries or applications must be installed before compilling Kamailio with this module loaded:

1.3. Exported Parameters

1.3.1. radius_config (string)

Radiusclient configuration file.

Default value is “/usr/local/etc/radiusclient-ng/radiusclient.conf”.

Example 1.1. Set param_name parameter

modparam("uri_radius", "radius_config", "/etc/radiusclient.conf")

1.3.2. service_type (integer)

Radius service type used in radius_does_uri_exist and radius_does_uri_user_exist checks.

Default value is 10 (Call-Check).

Example 1.2. Set service_type parameter

modparam("uri_radius", "service_type", 11)

1.3.3. use_sip_uri_host (integer)

If zero, radius_does_uri_exist sends to RADIUS server Request URI user@host in UserName attribute. If non-zero, radius_does_uri_exist sends to RADIUS server Request URI user in UserName attribute and host in SIP-URI-Host attribute.

Default value is 0.

Example 1.3. Set use_sip_uri_host parameter

modparam("uri_radius", "use_sip_uri_host", 1)

1.4. Exported Functions

1.4.1.  radius_does_uri_exist([pvar])

Checks from Radius if user@host in Request-URI or in URI stored in pseudo variable argument belongs to a local user. Can be used to decide if 404 or 480 should be returned after lookup has failed. If yes, loads AVP based on SIP-AVP reply items returned from Radius. Each SIP-AVP reply item must have a string value of form:




Returns 1 if Radius returns Access-Accept, -1 if Radius returns Access-Reject, and -2 in case of internal error.

This function can be used from REQUEST_ROUTE.

Example 1.4. radius_does_uri_exist usage

if (radius_does_uri_exist()) {

1.4.2.  radius_does_uri_user_exist([pvar])

Similar to radius_does_uri_exist, but check is done based only on Request-URI user part or user stored in pseudo variable argument. User should thus be unique among all users, such as an E.164 number.

This function can be used from REQUEST_ROUTE.

Example 1.5. radius_does_uri_user_exist usage

if (radius_does_uri_user_exist()) {