[Devel] acc diff

Dan Pascu dan at ag-projects.com
Mon Oct 2 20:54:27 CEST 2006


On Monday 02 October 2006 21:44, Juha Heinanen wrote:
> Dan Pascu writes:
>  > Considering that the username is almost always taken from the the
>  > same place, why not use that as a default unless specifically
>  > overwritten by the user in the script? That way one can set it only
>  > when necessary (for example after a diversion / call forward), and
>  > not everytime.
>
> i don't know how User-Name as produced by default by current version of
> acc module could be overwritten.  if i define an extra attribute for
> User-Name, i get two User-Names in accounting request.  also, 1i
> specifically want to save cpu cycles and create User-Name value two
> times.

I was thinking that there can be an AVP that if set will be used as 
User-Name, else it will take it from where it takes it now (credentials 
or From)
That way you don't have to compute it 2 times, nor will there be 2 
attributes. Just set that AVP if you want the default overwritten.

something along the lines:

if (is_avp_set(some_avp_spec)) {
  take User-Name attribute from that AVP
} else {
  take User-Name attribute from credentials/from as now
}

-- 
Dan



More information about the Devel mailing list