issue with dialup.conf

Tyller D tyllerd at gmail.com
Sun Feb 6 15:55:34 CET 2011


Hi

I am having an issue, which may be the way I changed the dialup.conf or
maybe its my logic. This is what I have done & am trying to achieve.

freeradius is used to authenticate users at our hotspots, as we are using
different nas devices and we must cater for them all i did this.

in dictionary file I added an attribute called databank, then I created a
perl script to check which type of nas the user is coming from and renaming
databank to the correct attribute, now that works fine. Then on the stop
request I need to update the value associated to databank to be (databank -
(acctinputoctets+acctoutputoctets)). that way limiting users to only as much
"data" as we stipulated in the begining. my problem is that it doesn't
always update the databank value, I can see how much traffic a users used in
his session (i.e. in the radacct table) so the  accounting_stop_query &
accounting_stop_query_alt are not failing, its just not updating the
databank value in radcheck.

here are the two queries

        accounting_stop_query = " \
          UPDATE radacct,radcheck SET \
             radacct.acctstoptime       = '%S', \
             radacct.acctsessiontime    = '%{Acct-Session-Time}', \
             radacct.acctinputoctets    = '%{%{Acct-Input-Gigawords}:-0}' <<
32 | \
                                  '%{%{Acct-Input-Octets}:-0}', \
             radacct.acctoutputoctets   = '%{%{Acct-Output-Gigawords}:-0}'
<< 32 | \
                                  '%{%{Acct-Output-Octets}:-0}', \
             radacct.acctterminatecause = '%{Acct-Terminate-Cause}', \
                radcheck.value = radcheck.value - '%{Acct-Output-Octets}' -
'%{Acct-Input-Octets}', \
             radacct.acctstopdelay      = '%{%{Acct-Delay-Time}:-0}', \
             radacct.connectinfo_stop   = '%{Connect-Info}' \
          WHERE radacct.acctsessionid   = '%{Acct-Session-Id}' \
        AND radcheck.username = '%{SQL-User-Name}' \
        AND radcheck.attribute = 'databank' \
          AND radacct.username          = '%{SQL-User-Name}' \
          AND radacct.nasipaddress      = '%{NAS-IP-Address}'"



        accounting_stop_query_alt = " \
          UPDATE radacct,radcheck SET \
             radacct.acctstoptime       = '%S', \
             radacct.acctsessiontime    = '%{Acct-Session-Time}', \
             radacct.acctinputoctets    = '%{%{Acct-Input-Gigawords}:-0}' <<
32 | \
                                  '%{%{Acct-Input-Octets}:-0}', \
             radacct.acctoutputoctets   = '%{%{Acct-Output-Gigawords}:-0}'
<< 32 | \
                                  '%{%{Acct-Output-Octets}:-0}', \
             radacct.acctterminatecause = '%{Acct-Terminate-Cause}', \
             radacct.acctstopdelay      = '%{%{Acct-Delay-Time}:-0}', \
             radacct.connectinfo_stop   = '%{Connect-Info}', \
                radcheck.value = radcheck.value - '%{Acct-Output-Octets}' -
'%{Acct-Input-Octets}' \
          WHERE radacct.acctsessionid   = '%{Acct-Session-Id}' \
          AND radacct.username          = '%{SQL-User-Name}' \
          AND radacct.nasipaddress      = '%{NAS-IP-Address}' \
          AND radcheck.username                = '%{SQL-User-Name}' \
          AND radcheck.attribute = 'databank'"


does anyone know how this can happen? could it be something to do with
interim-updates (grasping at straws here).

any help would be great.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20110206/34a43d0b/attachment.html>


More information about the Freeradius-Users mailing list