Hi,

I'm sorry I mistyped. I meant '%{KULeuven}' instead of %'{KULeuven}'. So you guys think I need to use that variable?

Here's my query:


        accounting_update_query_alt = " \
          INSERT INTO ${acct_table1} \
            (acctsessionid,    acctuniqueid,      username, \
             realm,            nasipaddress,      nasportid, \
             nasporttype,      acctstarttime,     acctsessiontime, \
             acctauthentic,    connectinfo_start, acctinputoctets, \
             acctoutputoctets, calledstationid,   callingstationid, \
             servicetype,      framedprotocol,    framedipaddress, \
             acctstartdelay,   xascendsessionsvrkey,  \
             vendorspecific, acctinputpackets, acctoutputpackets) \
          VALUES \
            ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', \
             '%{SQL-User-Name}', \
             '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', \
             '%{NAS-Port-Type}', \
             DATE_SUB('%S', \
                      INTERVAL (%{%{Acct-Session-Time}:-0} + \
                                %{%{Acct-Delay-Time}:-0}) SECOND), \
                      '%{Acct-Session-Time}', \
             '%{Acct-Authentic}', '', \
             '%{%{Acct-Input-Gigawords}:-0}' << 32 | \
             '%{%{Acct-Input-Octets}:-0}', \
             '%{%{Acct-Output-Gigawords}:-0}' << 32 | \
             '%{%{Acct-Output-Octets}:-0}', \
             '%{Called-Station-Id}', '%{Calling-Station-Id}', \
             '%{Service-Type}', '%{Framed-Protocol}', \
             '%{Framed-IP-Address}', \
             '0', '%{X-Ascend-Session-Svr-Key}', \
             '%{KULeuven-Test}', '%{Acct-Input-Packets}', \
             '%{Acct-Output-Packets}')"

With freeradius -X, I see in the queries that are printed out, that this variable is empty...



On Fri, May 15, 2009 at 3:14 PM, Alan DeKok <aland@deployingradius.com> wrote:
Jeroen Vanderauwera wrote:
> I have some problems with radius. I want to log the Value (an integer)
> in my Vendor-Specific attribute to a mysql database.
> I use %'{Vendor-Specific}' as variable to write it to the database but
> it always writes 0x25ce0000010630390000 to the database instead of the
> Value.

 That is the value of %{Vendor-Specific}

> At the system where you have to authenticate I put the following
> variables into the radiuspacket:
> Vendor-Id = 9678 --> is registered at
> http://beta.iana.org/assignments/enterprise-numbers
> Vendor-Type
> <http://beta.iana.org/assignments/enterprise-numbers%0AVendor-Type> = 1
> Vendor-Length = 6
> Vendor-Value = 12345

  You've created the dictionary file entry for that... but aren't using
the dictionary name you created.

 Why?

> So this seems to be right. Somewhere it's logic that if you use
> %'{Vendor-Specific}' as variable in the query, that you will store
> 0x25ce0000010630390000.

 Yes, that *IS* the value of Vendor-Specific.

> But how am I able to store 12345 into the
> database? I also tried to use %'{KULeuven-Test}' and just %'{Test}',
> but those variables are just empty...

 Because that isn't the correct format.  Really.

 Why are you using %{Vendor-Specific}, and %'{KULeuven-Test}' ?

 Why the *extra* quotes in your VSA?  Why not just

       %{KULeuven-Test}

 ?

 Adding the extra quote marks '..'  is breaking it.

 Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html