Hello Alan, Your query is wrong. You cannot put "PA%" into the query. You MUST
escape the "%", by using "%%".
I have %% in my query: $ cat /etc/freeradius/mods-config/preprocess/hints DEFAULT Realm == "nodo.unex.es" Reply-Message = "%{sqllocal:SELECT username FROM radpostauth WHERE client like 'PA%%' and reply='Access-Accept' and mac='%{Calling-Station-Id}' and authdate > (SELECT DATE_SUB(NOW(),INTERVAL 1 DAY)) order by authdate desc limit 1}", Tipo-Usuario := NODO Pay attention to the real problem. The Calling-Station-Id exists in the
Access-Request, and is expanded everywhere else.
In the query you're worried about, the SQL module returns no results. The module returns no results because mac its empty... ¿why? (0) preprocess: hints: Matched DEFAULT at 31 (0) preprocess: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} (0) preprocess: --> nodowifi@nodo.unex.es (0) preprocess: SQL-User-Name set to 'nodowifi@nodo.unex.es' rlm_sql (sqllocal): Reserved connection (4) (0) preprocess: EXPAND /var/log/freeradius/sqllog.sql (0) preprocess: --> /var/log/freeradius/sqllog.sql (0) preprocess: Executing select query: SELECT username FROM radpostauth WHERE client like 'PA%' and reply='Access-Accept' and mac='' and authdate > (SELECT DATE_SUB(NOW(),INTERVAL 1 DAY)) order by authdate desc limit 1 (0) preprocess: SQL query returned no results rlm_sql (sqllocal): Released connection (4) (0) preprocess: EXPAND %{sqllocal:SELECT username FROM radpostauth WHERE client like 'PA%%' and reply='Access-Accept' and mac='%{Calling-Station-Id}' and authdate > (SELECT DATE_SUB(NOW(),INTERVAL 1 DAY)) order by authdate desc limit 1} (0) preprocess: -->
The Calling-Station-Id exists, so the problem is somewhere else.
So... the problem isn't the expansion of Calling-Station-Id.
I don't know where is my problem, but I think my query its ok Thank you very much :::::::::::::::::::::::::::::::::::: :: Ana Gallardo Gómez :: ::::::::::::::::::::::::::::::::::::