[OpenSIPS-Users] load_balance not using group id in failure route

Razvan Crainea razvancrainea at opensips.org
Tue Jan 3 14:36:25 CET 2012


Hi, Steven!

This is not wrong, this is the desired behaviour in order to use the 
failover features.
I see that you have only one destination in group 2. Will this be the 
final scenario? If yes, then you shouldn't use load balance, but a 
simple RURI rewriting.
However, if you want to use multiple gateways from failure route, there 
is a hack you can do, but I don't recommend it. You can reset the 
*lb_mask*, *lb_id* and *lb_grp* AVPs just before calling the 
load_balance function.

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer


On 01/03/2012 02:34 PM, Steven Lam, KeenSystems B.V. wrote:
>
> Is nobody using this? :-(
>
> I really want to know if I'm doing something wrong here...
>
> Steven
>
> *From:*users-bounces at lists.opensips.org 
> [mailto:users-bounces at lists.opensips.org] *On Behalf Of *Steven Lam, 
> KeenSystems B.V.
> *Sent:* donderdag 29 december 2011 14:48
> *To:* users at lists.opensips.org
> *Subject:* [OpenSIPS-Users] load_balance not using group id in failure 
> route
>
> Hi all,
>
> Using the load balancer on OpenSIPS 1.7.1 I found that when calling 
> load_balance in a failure_route with a group other than the one on the 
> initial call, the load_balance still uses the "old" group.
>
> For example:
>
> The table looks like this:
>
> +----+----------+------------------+-----------+
>
> | id | group_id | dst_uri          | resources |
>
> +----+----------+------------------+-----------+
>
> |  1 |        1 | sip:192.168.9.22 | all=10    |
>
> |  2 |        1 | sip:192.168.9.27 | all=20    |
>
> |  3 |        2 | sip:192.168.9.18 | all=10    |
>
> +----+----------+------------------+-----------+
>
> Script looks like this:
>
> ...
>
> if ( load_balance("1","all") ) {
>
>      xlog("==================> Destination is $du\n");
>
>      t_on_failure("1");
>
>      t_relay();
>
>      exit;
>
> }
>
> ...
>
> failure_route[1] {
>
>  lb_disable();
>
>   if ( load_balance("2","all") ) {
>
>     t_on_failure("1");
>
>     xlog("==================> New destination is $du\n");
>
>     t_relay();
>
>   } else {
>
>     t_reply("500","Error");
>
>   }
>
> }
>
> This will result in routing a INVITE to sip:192.168.9.27, when this 
> fails the INVITE will be routed to sip:192.168.9.22 _/NOT/_ 
> 192.168.9.18. To me this looks wrong.
>
> Is this by design? If so how can I force load_balance to use a uri 
> from group 2 after using one from group 1?
>
> Hope someone can give me some advice on this.
>
> Steven
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20120103/e3163f36/attachment.htm>


More information about the Users mailing list