SQL fields not lining up
Scott Pettit - Vorco
SPettit at vorco.net
Sun Oct 20 07:46:32 CEST 2013
Thanks. Yes someone else did build these configs and that snippet has got me to the right place.
FWIW here is what was wrong:
UPDATE ${acct_table2} SET \
acctstoptime = '%S', \
acctsessiontime = '%{Acct-Session-Time}', \
acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
'%{%{Acct-Input-Octets}:-0}', \
acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
'%{%{Acct-Output-Octets}:-0}', \
acctterminatecause = '%{Acct-Terminate-Cause}', \
acctstopdelay = '%{%{Acct-Delay-Time}:-0}', \
connectinfo_stop = '%{Connect-Info}', \
nastxspeed = '%{Cisco-AVPair[1]}', \
nasrxspeed = '%{Cisco-AVPair[2]}', \
disccauseext = '%{Cisco-AVPair[3]}', \
ciscoavpairother1 = '%{Cisco-AVPair[4]}', \
ciscoavpairother2 = '%{Cisco-AVPair[0]' \
WHERE acctsessionid = '%{Acct-Session-Id}' \
AND username = '%{SQL-User-Name}' \
AND nasipaddress = '%{NAS-IP-Address}’"
The Cisco-AVPair[0] wasn’t closed off with } so the query was inputting junk.
It also appears that those Cisco-AVPair attributes would be better handled with rewrites as the contents of those attributes can change around depending on what the BRAS sends for that user.
-Scott
________________________________
The content of this message and any attachments may be privileged, confidential or sensitive. Any unauthorised used is prohibited. Views expressed in this message are those of the individual sender, except where stated otherwise with appropriate authority. All pricing provided is valid at the time of writing only and due to factors such as the exchange rate, may change without notice. Sales are made subject to our Terms & Conditions, available on our website or on request.
________________________________
More information about the Freeradius-Users
mailing list