Thanks, Arran. I tried that and got "Failed to load module "foreach”.” which, I presume means I need to do an upgrade, right? Regards, Ben On 6 Jan 2015, at 02:19, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 5 Jan 2015, at 09:32, Ben Gatewood <Ben.Gatewood@essensys.co.uk> wrote:
Thanks, Arran. I have to confess I’ve hit a wall in my expertise and can’t figure out how to make your regex model work for cases where there are more than one Attr-255 in the request.
Foreach... operates the same as any other programming language.
Iterator is hard coded to the level of nesting.
foreach &Broadsoft-Attr-255 { # values of Broadsoft-Attr-255 are available as %{Foreach-Variable-0} if ("%{Foreach-Variable-0}" =~ /^([0-9]+)=(.*)$/) { # %{1} attr %{2} value } }
If you're doing presence checks you can also use:
if (&Broadsoft-Attr-255[*] == '<attr>=<value>') { # evaluates to true if any instance of Broadsoft-Attr-255 has the value <attr>=<value> }
but that's >= 3.0.6 only.
-Arran - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html