how to account different table sql by time decision

johan firdianto johanfirdi at gmail.com
Tue Jul 7 16:25:32 CEST 2015


if acct packet goes at first time , sql instance would be insert, and
subsquent should be update.
if have 2 table radacct, 1rst radacct for accounting for night hours and
the others for work hours. how to make sure there are 2 insert operation in
a session accounting ?
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
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list