[OpenSIPS-Users] drouting enhancement clarifications

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Apr 2 18:26:57 CEST 2012


Hi Brett,


On 03/30/2012 09:46 PM, Brett Nemeroff wrote:
> Hello List,
>
> Upon looking at the enhancements of drouting in 1.8, I'm a bit 
> confused at all the new options for the gwlist fields. I found this 
> snippet on the list:
> >>>>      gateways :  g1, g2, g3, g4, g5
> >>>>      carriers :  c1 = g1=75,g2=25  (a premium carrier), ordering based
> >>>>  on weight
> >>>>                  c2 = g3,g4  (a standard carrier), ordering based on
> >>>>  given order
> >>>>      rules:   prefix= 004021 ; list = #c1,#c2,g5  - first we will try do
> >>>>  distribute 75/25 the traffic
> >>>>                    between the gws from carrier c1 and if all fail, we
> >>>>  will try gws from carrier c2
> >>>>                    (according the ordering defined for c2), and so on
> >>>>
> >>>>               prefix= 004072 ; list = #c2=50,g5=50  - all traffic will
> >>>>  be weight balanced between carrier
> >>>>                    c2 and gw g5; of course, if carrier c2 is to be used,
> >>>>  the corresponding traffic will
> >>>>                    routed over the c2 gateways according to its
> >>>>  definition
> >>>>
> >>>>
>
> Which seems to indicate the new "weights" option can be used by specifying a gateway_id followed by an "=<0-100>" where<0-100>  is weight.
http://www.opensips.org/html/docs/modules/1.8.x/drouting.html#id249152

I admit the doc is not fully detailed, but I plan to put down a DR 
tutorial to explain everything in all details.
> I can't really find how this is documented anywhere. Also what gets picked first? 0 weight? or 100 weight?
weight doesn't say which is picked first - it is not a priority; weight 
tells what is the probability of that element to be select ; and of 
course, higher weight, higher chances to be select - exactly as with the 
weight in DNS records.
>
>
> What if I just want it to try 1 gateway for each carrier and not roll from gateway to gateway to gateway? For
> example, I'd like to see where I can do something like this in the CARRIER definition:
> g1=75,g2=25
>
> and then every time I pick that carrierid, 75% of the time g1 will get picked, and 25% of the time g2 will be
> picked. But it will never go from g1, then g2 (rather I'd like it to proceed in my script logic so I can pick
>
> another carrier).
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 :)

Regards,
Bogdan

>
>
> Thanks,
> -Brett
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


-- 
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/51ec5851/attachment.htm>


More information about the Users mailing list