[Devel] acc diff

Dan Pascu dan at ag-projects.com
Tue Oct 3 15:25:23 CEST 2006


That's exactly my point. I do NOT want to do all this avp testing and 
manipulation in the script. This was previously done by openser.
What is the point of replicating the same logic in 99% of the openser.cfg 
scripts out there?

You remove it from the set, but everyone will put it back because they 
need it for billing and almost everyone will use the same logic so 
nothing is gained only things are more complicated to accomplish now.

I would rather want to see a default for this (since almost everyone will 
use it) and a way to overwrite it.

Something like:

modparam("acc", "radius_extra", "User-Name=$un")

where $un would map to the credentials if defined else to the from uri 
(that is mapped internally by openser without script avp manipulations). 
If you want something else just use another pseudo variable and do your 
own computing.

On Tuesday 03 October 2006 16:09, Juha Heinanen wrote:
> Dan Pascu writes:
>  > Currently it is taken from the credentials username or if that is
>  > not present from the From field's username. So what is the value
>  > (pseudo variable) we can attach to an extra User-Name attribute we
>  > send to radius accounting to get the old behavior without resorting
>  > to contorted tests and avp manipulations in the script?
>
> something like this:
>
> 	define(`USERNAME', i:102)
> 	define(`AUTHENTICATED', 10)
>
> 	modparam("acc", "radius_extra", "User-Name=$avp(USERNAME)")
>
> 	...
>
> 	set AUTHENTICATED flag after successful authentication
> 	...
>
> 	if (isflagset(AUTHENTICATED)) {
> 		avp_printf($avp(USERNAME), "$au@$ar");
> 	} else {
> 		avp_write("$fu", $avp(USERNAME));
> 	}
>
> -- juha

-- 
Dan



More information about the Devel mailing list