Write 3GPP attributes accounting into mysql problem

bit1 bit1 at freemail.hu
Wed Jan 15 13:43:17 CET 2014


Hi 
Thanks Phil.
I'v edited dialup.conf to: 
 accounting_start_query = "INSERT INTO ${acct_table1} (test1,test,fullpacket) VALUES ('%{request:3GPP-IMSI}','%{Cisco-AVPair}','%Z')"

Inserted into accounting {} and there is a foo:

Wed Jan 15 13:24:31 2014 : Info: [sql]  expand: %{User-Name} -> testuser
Wed Jan 15 13:24:31 2014 : Info: [sql] sql_set_user escaped user --> 'testuser'
Wed Jan 15 13:24:31 2014 : Info: [sql]  expand: INSERT INTO radacct (test1,test,fullpacket) VALUES ('%{request:3GPP-IMSI}','%{Cisco-AVPair}','%Z') -> INSERT INTO radacct (test1,test,fullpacket) VALUES ('','foo','        Acct-Status-Type = Start        Calling-Station-Id = "12312312312"  Framed-IP-Address = 10.0.0.1    Acct-Session-Id = "d43363551081e4a8"    NAS-IP-Address = 10.11.11.77    Framed-Protocol = GPRS-PDP-Context  Called-Station-Id = "test-gprs"         NAS-Identifier = "test-gprs"    User-Name = "testuser"  NAS-Port-Type = Virtual         Service-Type = Framed-User  3GPP-IMSI = "123123123123123"   Acct-Unique-Session-Id = "6ce7054b4a610197"     Cisco-AVPair = "foo"    SQL-User-Name = "testuser" ')
Wed Jan 15 13:24:31 2014 : Debug: rlm_sql (sql): Reserving sql socket id: 3
Wed Jan 15 13:24:31 2014 : Debug: rlm_sql (sql): Released sql socket id: 3

After then cleared the accounting {} and inserted Cisco-AVPair = "bar" into the radius acct packet:

Wed Jan 15 13:31:24 2014 : Info: [sql]  expand: INSERT INTO radacct (test1,test,fullpacket) VALUES ('%{request:3GPP-IMSI}','%{Cisco-AVPair}','%Z') -> INSERT INTO radacct (test1,test,fullpacket) VALUES ('','bar','        Acct-Status-Type = Start        Calling-Station-Id = "12312312312"  Framed-IP-Address = 10.0.0.1    Acct-Session-Id = "d43363551081e4a8"    NAS-IP-Address = 10.11.11.77    Framed-Protocol = GPRS-PDP-Context  Called-Station-Id = "test-gprs"         NAS-Identifier = "test-gprs"    User-Name = "testuser"  NAS-Port-Type = Virtual         Service-Type = Framed-User  3GPP-IMSI = "123123123123123"   Cisco-AVPair = "bar"    Acct-Unique-Session-Id = "6ce7054b4a610197"     SQL-User-Name = "testuser" ')

There is the "bar". It seems works with Cisco-AVPair (as man unlang mentioned) but not for 3GPP-*.

Regards
Dohány Tibor
mailto:bit1 at freemail.hu

Phil Mayers <p.mayers at imperial.ac.uk> írta:
>On 15/01/14 11:36, bit1 wrote:
>
>> Wed Jan 15 12:29:40 2014 : Info: [sql]  expand: INSERT INTO radacct (test,fullpacket) VALUES ('%{request:3GPP-IMSI}','%Z') -> INSERT INTO radacct (test,fullpacket) VALUES ('','  ... 3GPP-IMSI = "123123123123123"  ...)
>
>Well THAT is extremely weird.
>
>I wonder if it's a more general problem with all VSAs, as opposed to 
>something specific to 3GPP-*
>
>Could you try this:
>
>1. Set the SQL query to:
>
>INSERT INTO radacct (test,fullpacket) VALUES (
>'%{request:3GPP-IMSI}','%{Cisco-AVPair}','%Z')
>
>2. Put the following in your config:
>
>accounting {
>   ...
>   update request {
>     Cisco-AVPair += "foo"
>   }
>   sql
>   ...
>}
>
>3. Run a debug, and see if the Cisco-AVPair VSA is affected as well. 
>Possibly there's a bug in the SQL xlat for VSAs?
>-
>List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>


More information about the Freeradius-Users mailing list