Mod radius cdr

From FreeSWITCH Wiki
Jump to: navigation, search
Warning

NOTE All the text below was last edited in 2007, it is therefore likely out-of-date, inaccurate and in dire need of a refresh

 


Contents

Building & Installation

This module is not built by default. In order to build this module, you will need to perform the following steps:

  • Download and install the 'freeradius-client' library. You will need to run the CVS head version. Documentation on how to do this can be found here: freeradius-client
  • Uncomment the 'mod_radius_cdr' entry in 'modules.conf'.
  • Run 'make' && 'make install'.

Install Configuration Files

You will need to copy the configuration files from the source directory, into your FreeSWITCH configuration directory.

The files you need to copy are 'mod_radius_cdr.conf.xml' and the the 'radius' directory ( and it's contents ).

  • Edit 'conf/modules.conf' to load mod_radius_cdr with the other event_handlers that you want enabled.
  • Edit 'conf/freeswitch.xml' to include 'mod_radius_cdr.conf.xml'.
  • Run FreeSWITCH. You should see the following in the startup messages:
 2007-06-18 10:21:51 [CONSOLE] switch_loadable_module.c:736 switch_loadable_module_load_file() Successfully Loaded [mod_radius_cdr]

Module Configuration

The dictionary directive specifies the location of the RADIUS dictionary file. If the module can't find this file, it won't run.

 <param name="dictionary" value="/usr/local/freeswitch/conf/radius/dictionary"/>

The radius_retries directive tells the module how many times to try sending a request to a server before failing. The default is 3 retries. The radius_timeout directive tells the module how many seconds to wait between request attempts before timing out. The default is 5 seconds. The total time a request may be pending is ( radius_timeout * radius_retries * number_of_servers ). Currently, the module blocks the thread while it is sending the requests. This may cause threads to hang around longer than expected after a call, if your RADIUS servers are not reachable/responding.

 <param name="radius_retries" value="3"/>
 <param name="radius_timeout" value="5"/>

The acctserver directive defines the servers to be used ( sequentially ) for sending requests. The format for the value is: host:port:secret. The host SHOULD be defined as an IP address, not as DNS hostname. You can specify a DNS hostname, but inconsistent behavior has been observed when doing this. A maximum of 8 servers can be defined.

 <param name="acctserver" value="127.0.0.1:1813:mysecret"/>
 <param name="acctserver" value="10.0.0.2:1813:anothersecret"/>
 <param name="acctserver" value="10.0.0.3:1813:toomanysecrets"/>

Example

Here's a sample RADIUS transaction ( logged to a detail file via FreeRADIUS server ):

 Fri Jun  8 08:23:10 2007
       Acct-Status-Type = Start
       Acct-Session-Id = "d734ff5e-bf04-4045-8cb3-f5744574808b"
       Freeswitch-Src = "8478797989"
       Freeswitch-CLID = "Chris Parker"
       Freeswitch-Dst = "888"
       Freeswitch-Dialplan = "XML"
       NAS-Port = 0
       Acct-Delay-Time = 0
       NAS-IP-Address = 127.0.0.1
       Client-IP-Address = 127.0.0.1
       Acct-Unique-Session-Id = "4b7754541b5902fa"
       Timestamp = 1181308990
 Fri Jun  8 08:23:31 2007
       Acct-Status-Type = Stop
       Acct-Session-Id = "d734ff5e-bf04-4045-8cb3-f5744574808b"
       Freeswitch-Hangupcause = Normal-Clearing
       Freeswitch-Src = "8478797989"
       Freeswitch-CLID = "Chris Parker"
       Freeswitch-Dst = "888"
       Freeswitch-Dialplan = "XML"
       Freeswitch-Lastapp = "bridge"
       Freeswitch-Billusec = 21460442
       NAS-Port = 0
       Acct-Delay-Time = 0
       NAS-IP-Address = 127.0.0.1
       Client-IP-Address = 127.0.0.1
       Acct-Unique-Session-Id = "4b7754541b5902fa"
       Timestamp = 1181309011