Hello... This is probably a very silly issue. I have the following on my default file: update control { Tmp-String-0 = "%{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'" Tmp-String-5 = "%{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'" } if (control:Tmp-String-0 > control:Tmp-String-5) { .... } On the radius logs I see the following: expand: %{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'} -> 693492 expand: %{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'}' -> 174080 ++[control] returns ok ++? if (control:Tmp-String-0 > control:Tmp-String-5) ? Evaluating (control:Tmp-String-0 > control:Tmp-String-5) -> FALSE ++? if (control:Tmp-String-0 > control:Tmp-String-5) -> FALSE why is the condition giving FALSE even though is already met? -- View this message in context: http://freeradius.1045715.n5.nabble.com/unlang-conditionals-tp4400590p440059... Sent from the FreeRadius - User mailing list archive at Nabble.com.
Hello... This is probably a very silly issue. I have the following on my default file: update control { Tmp-String-0 = "%{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'" Tmp-String-5 = "%{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'" } if (control:Tmp-String-0 > control:Tmp-String-5) { .... } On the radius logs I see the following: expand: %{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'} -> 693492 expand: %{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'}' -> 174080 ++[control] returns ok ++? if (control:Tmp-String-0 > control:Tmp-String-5) ? Evaluating (control:Tmp-String-0 > control:Tmp-String-5) -> FALSE ++? if (control:Tmp-String-0 > control:Tmp-String-5) -> FALSE why is the condition giving FALSE even though is already met? -- View this message in context: http://freeradius.1045715.n5.nabble.com/unlang-conditionals-tp4400590p440060... Sent from the FreeRadius - User mailing list archive at Nabble.com.
On 16/05/11 15:37, doqb@hotmail.com wrote:
Hello... This is probably a very silly issue. I have the following on my default file:
update control { Tmp-String-0 = "%{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'" Tmp-String-5 = "%{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'" } if (control:Tmp-String-0> control:Tmp-String-5) { .... }
On the radius logs I see the following:
expand: %{sql:select a from paq where CallingStationId='%{Calling-Station-Id}'} -> 693492 expand: %{sql:select b from paq where CallingStationId='%{Calling-Station-Id}'}' -> 174080 ++[control] returns ok
Maybe you want Tmp-Integer-X?
I found out after checking other posts that the correct syntax of the IF should be as follows: if ("%{control:Tmp-String-0}" > "%{control:Tmp-String-5}" ) { .... } this is working now for me. -- View this message in context: http://freeradius.1045715.n5.nabble.com/unlang-conditionals-tp4400590p440101... Sent from the FreeRadius - User mailing list archive at Nabble.com.
participants (2)
-
doqb@hotmail.com -
Phil Mayers