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

Steven Lam, KeenSystems B.V. s.lam at keensystems.eu
Thu Dec 29 14:47:55 CET 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111229/c66a0808/attachment.htm>


More information about the Users mailing list