Check on ADSL-Agent-Remote-Id instead of username

Alan DeKok aland at deployingradius.com
Mon Apr 16 14:28:23 CEST 2018


On Apr 16, 2018, at 6:19 AM, Marijn van Gool <marijn.vangool at comsave.com> wrote:
> Thanks a lot for your answer.
> I was looking around a bit more and started experimenting with the SQL query Alan provided me earlier:
> 
> if ("%{sql:SELECT agent_remote_id FROM table WHERE agent_remote_id = '%{ADSL-Agent-Remote-Id}}" != "") {
> 		update control {
> 			Auth-Type := Accept
> 		}
> 	}
> 
> I do receive the remote ID: (285)   ADSL-Agent-Remote-Id = 0x31323639314d563338
> As you can see it’s hex encoded..

  It's supposed to be hex.  It *might* be a string, but you have no guarantees.

> I believe this one will work once I know how to convert the ADSL-Agent-Remote-Id HEX encoded string to regular STRING hat I receive in the Access-Request packet.

	update request {
		Tmp-String-0 := "%{string:&ADSL-Agent-Remote-Id}"
	}

  That should help.

  Alan DeKok.




More information about the Freeradius-Users mailing list