Hi all, Is there a way of doing this or its equivalent? I'm tracking the index of a variable via expr and then trying to get the output of other variables respectively - I need to do this via a changing index that's housed in a variable, but (and I may be doing this wrong) FR won't start with the following: update control { Tmp-Integer-0 := 0 } foreach &control:Tmp-String-1 { # send the disconnect update control { CoA-Failure-Reason !* ANY CoA-Acct-Unique-Session-Id := "%{Foreach-Variable-0}" CoA-Acct-Session-Id := &control:Tmp-String-2[&control:Tmp-Integer-0] CoA-User-Name := &control:Tmp-String-3[&control:Tmp-Integer-0] } /usr/local/etc/raddb/policy.d/sql_active_device_disconnect[40]: CoA-Acct-Session-Id /usr/local/etc/raddb/policy.d/sql_active_device_disconnect[40]: ^ Array index is not an integer .. &control:Tmp-Integer-0 is an integer, unless it's really a string in disguise.. Thanks again, sorry for posting so much. Andy
On 14 Dec 2015, at 12:24, Franks Andy (IT Technical Architecture Manager) <Andy.Franks@sath.nhs.uk> wrote:
Hi all, Is there a way of doing this or its equivalent? I'm tracking the index of a variable via expr and then trying to get the output of other variables respectively - I need to do this via a changing index that's housed in a variable, but (and I may be doing this wrong) FR won't start with the following:
Array index is not an integer, it's an attribute reference, which is not supported. You'd need to use %{xlat:%%{control:Tmp-String-3[%{control:Tmp-Integer-0}]%}} It's probably not hard to implement array indexes as templates, but I don't have time to look at it right now. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
On 14 Dec 2015, at 12:30, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 14 Dec 2015, at 12:24, Franks Andy (IT Technical Architecture Manager) <Andy.Franks@sath.nhs.uk> wrote:
Hi all, Is there a way of doing this or its equivalent? I'm tracking the index of a variable via expr and then trying to get the output of other variables respectively - I need to do this via a changing index that's housed in a variable, but (and I may be doing this wrong) FR won't start with the following:
Array index is not an integer, it's an attribute reference, which is not supported.
You'd need to use %{xlat:%%{control:Tmp-String-3[%{control:Tmp-Integer-0}]%}}
It's probably not hard to implement array indexes as templates, but I don't have time to look at it right now.
You also can't send multiple disconnects unless you call out to radclient and do it that way. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (2)
-
Arran Cudbard-Bell -
Franks Andy (IT Technical Architecture Manager)