FreeRADIUS WikiMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

Rlm sql mysql

From FreeRADIUS Wiki

Freeradius is able to use several backends to ultimately provide authentication.

It is important that install mysql before compiling Freeradius. Freeradius should automatically detect the necessary mysql libraries in order to connect to it.

Once your radius server is compiled and running, you then need to configure the sql.conf file. This provides freeradius with the information that it needs to connect to the server and also to define the queries it uses to query the database.

The Mysql Schema can be used as a base for creating your mysql database backend.

Install MySQL first. Then install freeradius with MySQL support. The first time I did my install, I did this backwards, and things never worked right.

I am going to be adding notes on my newest attempts at installation of FR1.1 My goal is to have EVERYTHING running via MySQL, from authentication and accounting to error logs. -Anson


                       [DO A CDR VOIP IN A FEW MINUTES]

Well rlm_sql with mysql driver function very good... but the sql module config file example its for DIAL UP if you want to use MYSQL and VOIP you can change sql.conf and mysql schema to use VSA atributes like pgsql_voip.conf and write a CDR... but if you dont want do that you can write a CDR with the sql.conf and MYSQL SCHEMA example Mysql Schema ... you can use:

AcctSessionId = call ID

CalledStationid = ANI remember replace "=23" by "#"

CallingStationId = DENIS remember replace "=23" by "#"

UserName = GW or GK Alias

NASIPAddress = Gateway who did AAA (AUTHENTICATION - AUTORIZATION - ACCOUNTING)

AcctStartTime = When the call started

AcctStopTime = When the call finished

AcctSessionTime = Call Duration in seconds

But remember radius do one row by each one call leg... when you do a traffic report you must filter that...

MYSQL QUERY EXAMPLES:

FOR DATES:

SELECT DISTINCT (acctsessionid),acctstoptime,calledstationid,calledstationid,acctsessiontime FROM radacct WHERE acctstoptime>'2006-01-29 00:00:00' and acctstoptime<'2006-02-05 00:00:00' AND calledstationid LIKE '123%' calledstationid LIKE '1234%' and acctsessiontime!='0';

but if you want to do a report with ASR and ACD you must take out the acctsessiontime!='0';

We use DISTINCT(acctsessionid) for use only one row for call...

THIS IS A WAY TO DO VOIP ACCOUNTING IN FEW MINUTES... IF YOU WANT TO USE FIELDS LIKE DISCONNECTION CAUSE or VOICE QUALITY YOU MUST USE CISCO WITH VSA ATRUBITUES...

a = calls with call duration different dur from zero

b= calls with call duration = zero

ASR= (a*100)/b

a=Total duration of all calls in minutes

b=Total calls

ACD=a/b

By Pablo Grois. mail: pablogrois@gmail.com msn: pablogrois@hotmail.com -forka

Retrieved from "http://wiki.freeradius.org/Rlm_sql_mysql"

This page has been accessed 29,763 times. This page was last modified on 2 July 2007, at 15:28.


Find

Browse
Main Page
Community portal
Current events
Recent changes
Random page
Help
Edit
View source
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More…