rlm_cache filtering

liran kessel lirankessel at gmail.com
Mon Jul 15 16:34:37 CEST 2019

I have activated rlm_cache so as to reduce the amount of times the freeradius will query the DB.
I made the Calling-Station-Id the cache key and have added this code to the accounting section:

       if (ok){
       else   {
                       if ("%{sql:select case when exists(select * from [TABLE_NAME] where ne_id='%{Calling-Station-Id}') then 1 else 0 end}" == 1){

However what happens is that all Calling-Station-Ids are stored to the cache and so the 2nd time I get a packet they execute the sql module.
How can I configure filtering of the cache in the “else” section so as to decide which Calling-Station-Id to save in cache and which not?


More information about the Freeradius-Users mailing list