[OpenSIPS-Users] drouting enhancement clarifications
Bogdan-Andrei Iancu
bogdan at opensips.org
Mon Apr 2 22:43:13 CEST 2012
Hi Brett,
On 04/02/2012 07:51 PM, Brett Nemeroff wrote:
> Bogdan,
>
> So the typical requirement I see is that I'll put in a handful of
> termination gateways for a given carrier, but the carriers usually
> (sometimes?) ask that if the call fails on one of the gateways (like a
> 503) to NOT send it to all the other gateways as well. In fact a
> "next_carrier" function would be ideal. Else, if I'm reading this
> right,if I use the carriers capabilities as listed it'll try every
> single one of the carrier's gateways, right? Or is the weight based
> selection going to pick just one gateways of the carriers each time?
Just to be clear - all the time, all the GWs (listed in rules or in a
carrier definition) are used (one by one). In what order, is dictate by
the "weight" flag - if set, ordering will be based on weight, otherwise
based on the definition order.
I agree, that maybe we need a way to select only one GW - this can be
very easy to do by having a new extra flag in the carrier definition -
as we have the "use weight flag", we can add a "use only first selected
GW flag" - and you mark only the carrier you like.
>
> I feel like a lot of my confusion stems from this:
>
> *
>
> list of GWs/carriers (string) - a comma separated list of
> gateways or carriers (defined by IDs) to be used for this rule;
> the carrier IDs are prefixed with “#” sign. For each ID (GW or
> carrier) you may specify a weight. For how this list will be
> interpreted (as order) see the rule selection section. Example
> of list: “gw1,gw4,#cr3”
>
> So this "gwX,#crX" notation is new and is specifically what I don't
> see documented other than in the paragraph listed above. So before
> we'd indicate a gwlist instead of a gateway by prefixing with a # like
> #5 is gwlist 5. But now we have gwX, which I can only assume is
> dr_gateways.gwid=X? and #cr3 which I'd assume is the list of gateways
> associated with carrier_id 3. but I'm not sure why one has a # and the
> other doesn't. Maybe I missed a documentation page? :)
>
I think the documentation (on defining the carriers and gateways) states
clearly that a gw/carrier has a string ID (rather than a numerical ID) -
what is the string ID, is in the definition of the gw or carrier; any
kind of string.
And when referring at any GW / carrier, you simply use the string ID.
You just use the "#" prefix to make difference between carriers and gws.
The "gwX" and "cX" patterns were used in my example just to be clear
what kind of IDs are, but you can use any kind of string there.
>
> Also can the weight based sorting be used on both in the dr_rules
> table to select a carrier and in the dr_carriers table to select a
> gateways (ie carrier 1 weight is 75% and carrier 2 is 25%.. BUT then
> carrier 1's gateway 5 is weight 75% and carrier 1's gateway 7 is
> weight 25%)
>
First, you can individually control if weights should be used at (1)
rule level (by the dr_routing() flags) and (2) at carrier level (by the
carrier definition). Secondly, at each level , if weight are to be used,
you can defined separate numbers.
Ex: carrier1= (gw1, gw2) - no weight to be used
carrier2 = (gw4=30, gw6=60) - use weight
rule for prefix 1234xxxx -> carrier1=40, carrier2=40, gw10=20
(use weights)
So first, a 40:40:20 weight based ordering will be done at rule level
(for carrie1, carrier2 and gw10). Then, inside carrier2, a 30:60 weight
based ordering will be done.
>
> Sorry for all the questions. I'm looking forward to the new
> functionality, hope I'm not jumping the gun here. :)
>
I will give you a 5 minute-ahead warning, if the case .....just kidding :)
Regards,
Bogdan
>
> -Brett
>
>
>
>
>
> On Mon, Apr 2, 2012 at 11:26 AM, Bogdan-Andrei Iancu
> <bogdan at opensips.org <mailto:bogdan at opensips.org>> wrote:
>
> When doing weight-based selection, all the entries of a carrier
> will be used (of course, based on weight). To be honest I haven;t
> foreseen this case - IMO, I supposed that if one GW of the carrier
> is down, you will always want to try the rest of the GWs from the
> same carrier, rather than falling to another carrier.
>> Or does it already do that? If I don't specify weights, does it try them in serial order?
> yes, but this is not triggered by the lack of weights, but from
> the carrier definition (see the wright flag in the carrier;s flag)
> or the do_routing() "W" flag.
>> Is this documented somewhere that I'm missing? The regular module docs dont' seem to show it.
> Well, you need to read the entire doc in order to get the big
> picture. But if something is found to be missing, I will take care
> of it :)
>
>
--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120402/98a61629/attachment-0001.htm>
More information about the Users
mailing list