[sr-dev] support r-uri pattern in lcr module

Juha Heinanen jh at tutpro.com
Fri Apr 20 07:36:45 CEST 2012


Andreas Granig writes:

> > if you need to do regex matching, then i would recommend using dialplan
> > module either alone or as the first step before using lcr module as is
> > as the second step.
> 
> No, usually we do it exactly the other way around. You've an R-URI with
> which you fetch a gw for the call, and depending on the gw, you apply
> dialplan sets specific to the gw selected by lcr module. That's because
> various peering partners require specific number formats, e.g. your
> national carrier wants national calls in national format for a- and
> b-numbers, whereas an international carrier needs it in e.164 format
> with a prefix of "00" or "+" or whatever.

what i tried to suggest is that you store gw's identity in
dialplan/attrs field or store there a prefix that you can use in lcr
module to choose a gw.

> Again, I understand why lcr works the way it does, but an additional
> regex-based use-case should be supported as well. It's up to the admin
> to consider which approach he might choose, and that's why I proposed to
> make it fully backwards compatible, so there won't be any tradeoff for
> the existing default approach. The regex mode will have its drawbacks in
> terms of performance or choosing the best match, but will have huge
> advantages in terms of flexibility. The good thing is that you can
> choose whatever suits your scenario best.

lcr module is already now quite (too) complex.  i'm afraid that adding a
new mode to it would increase its complexity beyond repair.  i would
therefore prefer a modular approach where one module does one simple
thing well and then applying the modules sequentially.

but if you don't see this kind of approach feasible, go ahead and add
regex support to lcr module (and of course to its README file).  i have
had in mind before 3.3 freeze to allow lcr_id 0 or null in lcr_gw table
meaning that the gw can be used in any lcr instance.

-- juha



More information about the sr-dev mailing list