Good day! We have made sql oracle function. This function insert data into sql table, but we call into this funtion as "select myfunction ('aaa','bbbbbb') from dual" and it returns "OK: Quota consumed." And... this is wotking!! In unlang we added: if ("%{sqlauth: select myfunction ('...','...') from dual}") { ok } Now: Wed Jan 28 16:15:43 2009 : Info: expand: select myfunction... Wed Jan 28 16:15:43 2009 : Debug: rlm_sql (sqlauth): Reserving sql socket id: 0 Wed Jan 28 16:15:43 2009 : Info: sql_xlat finished Wed Jan 28 16:15:43 2009 : Debug: rlm_sql (sqlauth): Released sql socket id: 0 Wed Jan 28 16:15:43 2009 : Info: expand: %{sqlauth: select myfunction... -> OK: Quota consumed. Wed Jan 28 16:15:43 2009 : Info: ++++[reply] returns noop So, I can see my data from Access-Request in my sql table. tnt@kalik.net wrote:
I try to add prepaid system to my equipment. In this case when quota is reached, equipment sends Access-Request with quota comsumed and I need to store this data in sql. But. Unfortunately, I must think about how many on-line customers send quota to sql in same time. Yes, I can write perl script with sql insert and update and freeradius will execute this one every time for quota data. But, I think this is not for system with many customers.
Perl is very fast but it needs to open (and close) the connection to the database and that is expensive. Unlang uses threads open by freeradius at startup. So it will work faster. But I don't think that INSERT is supported.
Ivan Kalik Kalik Informatika ISP
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Yours faithfully, Anton Borisov.