how to account different table sql by time decision

A.L.M.Buxey at lboro.ac.uk A.L.M.Buxey at lboro.ac.uk
Mon Jul 6 14:09:10 CEST 2015


Hi,

> i want to store accounting packet to different table sql with if time
> condition.
> like
> if (time > 1 am) and (time < 9 am)
> { store to acct2}
> else
> { store to acct1}
> 
> i think the solution is using unlang language and put in radius conf.
> im not familiar with unlang language.
> i would appreciate if anybody here could help me.

yep...you've pretty miuch got it - just convert it to unlang and have the required
other SQL instance configured  eg in 

accounting {

if (time logic here, based on regex or unlang and RADIUS attributes) {
	sql
	}
else {
	othersql
    	}
}

othersql being a named instance of the SQL module using a different table etc

alan


More information about the Freeradius-Users mailing list