16 Mar
2011
16 Mar
'11
9:43 a.m.
On 16/03/11 12:44, Suman Dash wrote:
I am looking forward for a short example on how to store a SQL query to a variable which can be used in next condition in UNLANG.
I have no knowledge of unlang but i got a fair amount of idea with the condition checks , just need a little insight on the result stores .
FreeRadius comes with several "Tmp-X" variables defined (see dictionary.freeradius.internal) or you can define your own. e.g. authorize { ... update request { Tmp-Integer-0 := "%{sql: ...}" } update request { Tmp-Integer-1 := "%{sql: ...}" } update reply { Session-Timeout := "%{expr:%{Tmp-Integer-0} - %{Tmp-Integer-1}}" } ... } Or do the maths in the SQL query itself.