Alan DeKok wrote:
David Mitchell wrote:
The SSID is in a Cisco-AVPair. I can include them all via
Start = "Connect: User: %{User-Name} ( client: %{Calling-Station-Id} location: %{WISPr-Location-Name}) %{Cisco-AVPair[*]}"
or the first one by using %{Cisco-AVPair[1]}. But I have no guarantee that the ssid will be the first AV pair.
Yes... there's no simple way to do that right now.
Is usage of Cisco-AVPair, or other similar variables, common enough to include code for it? For example, perhaps they could be accessed via a Perl hash-like structure as %{Cisco-AVPair[ssid]} to get "TEST" from Cisco-AVPair = "ssid=TEST". I don't think the coe would be hard to write, but I have no idea where it would fit in.
I've tried using unlang constructs to pull the data out, but can't figure out the right syntax. I'm trying something like the config below, just to see if the 'if/else' clauses even fire and they don't. No matter what I put in for the regexp, SSID never gets redefined to TRUE or FALSE. It always outputs as 'Junk'. I'm sure this is doable, I just don't know the exact syntax. Any ideas? Thanks in advance.
From linelog configuration:
Accounting-Request { SSID="Junk" Pairs = "%{Cisco-AVPair[0]}"
You can't do that. The configuration files are NOT a programming language. If you want to set temporary variables (really attributes), see the "update" section.
Oddly, I can do that. It works fine and I can reference the variables later as ${SSID} and ${Pairs}. I was hoping that I could use unlang constructs in the linelog config file but it sounds like that isn't the case. I can live with just dumping %{Cisco-AVPair[*]} into my logs, I just end up with some extra junk I don't care about. I've never been 100% clear on where I can and can't use unlang syntax. Thanks for the help, -David Mitchell
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- ----------------------------------------------------------------- | David Mitchell (mitchell@ucar.edu) Network Engineer IV | | Tel: (303) 497-1845 National Center for | | FAX: (303) 497-1818 Atmospheric Research | -----------------------------------------------------------------