<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please
use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on
sr-users mailing list:
*
http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask
on sr-dev mailing list:
*
http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the
developers to troubleshoot the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
Multiple rules with the same prefix and with the stopper flag are added. All the rules
have the same priority in the target table.
When routing calls to this prefix (load_gw + next_gw), the LCR module does not load
balance the calls, it always sends to the same GW.
#### Reproduction
Scenario is the following, the LCR rules have one default GW which is reachable via an
empty rule. However, a certain prefix must not be sent there, so a rule with the stopper
flag is added pointing to another GW. This works fine and the default GW is never
attempted.
However, for load balance purposes, it is necessary to send calls to this prefix to 2
different GWs. So another rule with the same prefix is added with the stopper flag set
too. The target table was updated accordingly and has the same priority.
When we have all this setup, by calling "next_gw()" we always get the same GW
(which is random depending on the DB situation I think). The other(s) GW is never
attempted.
This does not allow to load balance 2 GWs for rules with the stopper flag.
Given the stopper flag should prevent selecting shorter prefixes, it should not restrict
the routing for rules with the same prefix (same length). Having this, the load balance of
stopper rules would be possible.
### Possible Solutions
Apparently, there is no workaround, expect by not using the stopper flag, however then
there is a risk of sending calls to GWs with shorter prefix length which is not desired.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE,
USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC,
DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER,
USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535,
DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 67f967
compiled on 11:40:41 Mar 11 2019 with gcc 4.8.5
```
* **Operating System**:
```
uname -a
Linux uat1-sbc-0002 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64
x86_64 x86_64 GNU/Linux
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2105