[Devel] LCR and avps

Dan Pascu dan at ag-projects.com
Tue Jan 2 17:27:42 CET 2007


On Tuesday 02 January 2007 16:35, Juha Heinanen wrote:
> Helge Waastad writes:
>  > you are probably right.
>  >
>  > (Even if I'm not in the postion to really evulate this)
>
> pseudo variable parameter is more flexible that avp, because if your
> source address happens to have a pseudo variable item, you don't need
> first to assign that item to an avp.

The module avp parameter is more clear than an unnamed function parameter 
and has the implicit fallback capability (if not defined).
The function parameter only adds marginal flexibility IMO, but it leads to 
either complex scripting or unclear scripting (see below):

1. If you wish to add the fallback capability to it (use source ip if avp 
parameter is undefined), then it may raise questions as to why do you 
pass an undefined avp to the function as an argument if what you really 
want is the source ip.

2. If you do not add this fallback capability, then the behavior will not 
be unclear but you need to test yourself the cases in the script and call 
the function accordingly:

if (have_avp) {
  from_gw($avp);
} else {
  from_gw($si);
}

IMO, when adding such arguments that need to use a fallback mechanism, a 
module parameter is much cleaner both in meaning and script complexity.

>
> when i have, i'll add the parameter and rename from_gw with group
> parameter to from_gw_group.

-- 
Dan



More information about the Devel mailing list