Hello.
We’re using the LCR module with version 3.1.1 of Kamailio. We’re trying to add two gateways, with the same IP address, we have this configuration running in the previous version of Kamailio (v 1.5), without any problem, but in this version seems to have some issues.
This is what I’m trying to do :
mysql> select * from lcr_gw;
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| id | lcr_id | gw_name | ip_addr | hostname | port | params | uri_scheme | transport | strip | tag | flags | defunct |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| 1 | 1 | GW_1 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 303 | 1 | NULL |
| 8 | 1 | GW_33 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 4411 | 1 | NULL |
| 6 | 1 | GW_6 | 10.0.0.212 | NULL | 5060 | NULL | 1 | 1 | 5 | 308 | 1 | NULL |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
And this is the output from the logs :
/usr/local/sbin/kamailio[2829]: ERROR: lcr [lcr_mod.c:818]: gw <10.0.0.209, 5060, > is not unique
What could be the problem?. Os simply the new LCR does not support have two gateways with the same IP address?
Thanks,
Ricardo Martinez.-
Nobody on this one?.
Ricardo.-
*De:* Ricardo Martinez [mailto:rmartinez@redvoiss.net] *Enviado el:* miércoles, 02 de febrero de 2011 17:58 *Para:* 'sr-users@lists.sip-router.org' *Asunto:* LCR module : same IP address for different prefix.
Hello.
We’re using the LCR module with version 3.1.1 of Kamailio. We’re trying to add two gateways, with the same IP address, we have this configuration running in the previous version of Kamailio (v 1.5), without any problem, but in this version seems to have some issues.
This is what I’m trying to do :
mysql> select * from lcr_gw;
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| id | lcr_id | gw_name | ip_addr | hostname | port | params | uri_scheme | transport | strip | tag | flags | defunct |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| 1 | 1 | GW_1 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 303 | 1 | NULL |
| 8 | 1 | GW_33 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 4411 | 1 | NULL |
| 6 | 1 | GW_6 | 10.0.0.212 | NULL | 5060 | NULL | 1 | 1 | 5 | 308 | 1 | NULL |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
And this is the output from the logs :
/usr/local/sbin/kamailio[2829]: ERROR: lcr [lcr_mod.c:818]: gw <10.0.0.209, 5060, > is not unique
What could be the problem?. Os simply the new LCR does not support have two gateways with the same IP address?
Thanks,
Ricardo Martinez.-
Ricardo Martinez writes:
We’re using the LCR module with version 3.1.1 of Kamailio. We’re trying to add two gateways, with the same IP address, we have this configuration running in the previous version of Kamailio (v 1.5), without any problem, but in this version seems to have some issues.
in sr 3.1 two gws are considered unique if they have the same ip address, port, and hostname. in sr 3.0 and in k 1.5 two gws are considered unique if they have the same ip address and belong to same gw grp.
-- juha
Hello Ricardo,
I already wrote on this list about this issue. Currently the only way to do it is to disable duplicate gws checking in sources itself. In general, gw duplication checking should be extended to check not only by ip_addr or its hostname, but to include 'tag' and even 'strip' columns. IMHO duplication checking could be removed at all and only DB unique constraint checking used.
Antanas
On 2011.02.04 22:41, Ricardo Martinez wrote:
Nobody on this one?.
Ricardo.-
*De:*Ricardo Martinez [mailto:rmartinez@redvoiss.net mailto:rmartinez@redvoiss.net] *Enviado el:* miércoles, 02 de febrero de 2011 17:58 *Para:* 'sr-users@lists.sip-router.org mailto:sr-users@lists.sip-router.org' *Asunto:* LCR module : same IP address for different prefix.
Hello.
We’re using the LCR module with version 3.1.1 of Kamailio. We’re trying to add two gateways, with the same IP address, we have this configuration running in the previous version of Kamailio (v 1.5), without any problem, but in this version seems to have some issues.
This is what I’m trying to do :
mysql> select * from lcr_gw;
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| id | lcr_id | gw_name | ip_addr | hostname | port | params | uri_scheme | transport | strip | tag | flags | defunct |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
| 1 | 1 | GW_1 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 303 | 1 | NULL |
| 8 | 1 | GW_33 | 10.0.0.209 | NULL | 5060 | NULL | 1 | 1 | 3 | 4411 | 1 | NULL |
| 6 | 1 | GW_6 | 10.0.0.212 | NULL | 5060 | NULL | 1 | 1 | 5 | 308 | 1 | NULL |
+----+--------+---------+---------------+----------+------+--------+------------+-----------+-------+------+-------+---------+
And this is the output from the logs :
/usr/local/sbin/kamailio[2829]: ERROR: lcr [lcr_mod.c:818]: gw <10.0.0.209, 5060, > is not unique
What could be the problem?. Os simply the new LCR does not support have two gateways with the same IP address?
Thanks,
Ricardo Martinez.-
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Antanas Masevicius writes:
I already wrote on this list about this issue. Currently the only way to do it is to disable duplicate gws checking in sources itself. In general, gw duplication checking should be extended to check not only by ip_addr or its hostname, but to include 'tag' and even 'strip' columns. IMHO duplication checking could be removed at all and only DB unique constraint checking used.
i'll need to check for possible problems and if none are found, i'll remove the duplicate check.
-- juha
Juha Heinanen writes:
Antanas Masevicius writes:
I already wrote on this list about this issue. Currently the only way to do it is to disable duplicate gws checking in sources itself. In general, gw duplication checking should be extended to check not only by ip_addr or its hostname, but to include 'tag' and even 'strip' columns. IMHO duplication checking could be removed at all and only DB unique constraint checking used.
i'll need to check for possible problems and if none are found, i'll remove the duplicate check.
i just committed to master branch changes to lcr module that allow gateways of an lcr instance to be "non-unique".
-- juha
Juha,
Thank you for your work! This feature is highly needed i suspect.
Antanas NTT
On 2011.02.09 06:25, Juha Heinanen wrote:
Juha Heinanen writes:
Antanas Masevicius writes:
I already wrote on this list about this issue. Currently the only way to do it is to disable duplicate gws checking in sources itself. In general, gw duplication checking should be extended to check not only by ip_addr or its hostname, but to include 'tag' and even 'strip' columns. IMHO duplication checking could be removed at all and only DB unique constraint checking used.
i'll need to check for possible problems and if none are found, i'll remove the duplicate check.
i just committed to master branch changes to lcr module that allow gateways of an lcr instance to be "non-unique".
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Antanas Masevicius writes:
Thank you for your work! This feature is highly needed i suspect.
it would be possible to cherry-pick the patch also to 3.1, but i don't know if that is appropriate, because removing gw uniqueness check is not strictly a bug fix. it is just a piece of not needed code.
-- juha
Hello Juha. How can access this change in the code?. Do I need to update to the last version? 3.1.2 ?? Hope you can help me.
Thanks Ricardo.-
-----Mensaje original----- De: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] En nombre de Juha Heinanen Enviado el: miércoles, 09 de febrero de 2011 18:00 Para: Antanas Masevicius CC: sr-users@lists.sip-router.org Asunto: Re: [SR-Users] LCR module : same IP address for different prefix.
Antanas Masevicius writes:
Thank you for your work! This feature is highly needed i suspect.
it would be possible to cherry-pick the patch also to 3.1, but i don't know if that is appropriate, because removing gw uniqueness check is not strictly a bug fix. it is just a piece of not needed code.
-- juha
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Ricardo Martinez writes:
How can access this change in the code?. Do I need to update to the last version? 3.1.2 ?? Hope you can help me.
currently the trivial change (do not check uniqueness of gateway's ip address) is only in master branch. patch to 3.1 is included below.
-- juha
** lcr_mod.c 2011-03-18 16:36:30.000000000 +0200 --- /usr/src/openxg-sip-proxy/modules/lcr/lcr_mod.c 2011-03-18 16:3 5:45.000000000 +0200 *************** *** 783,808 **** }
! /* ! * Check if ip_addr/grp_id of gateway is unique. */ - static int gw_unique(const struct gw_info *gws, const unsigned int count, - const unsigned int ip_addr, const unsigned int port, - char *hostname, unsigned int hostname_len) - { - unsigned int i; - - for (i = 1; i <= count; i++) { - if ((gws[i].ip_addr == ip_addr) && - (gws[i].port == port) && - (gws[i].hostname_len == hostname_len) && - (strncasecmp(gws[i].hostname, hostname, hostname_len) == 0)) { - return 0; - } - } - return 1; - } - static int insert_gw(struct gw_info *gws, unsigned int i, unsigned int gw_id, char *gw_name, unsigned int gw_name_len, unsigned int scheme, unsigned int ip_addr, --- 783,791 ---- }
! /* ! * Insert gw info into index i of gws table */ static int insert_gw(struct gw_info *gws, unsigned int i, unsigned int gw_id, char *gw_name, unsigned int gw_name_len, unsigned int scheme, unsigned int ip_addr, *************** *** 813,823 **** unsigned int tag_len, unsigned int flags, unsigned int defunct_until) { - if (gw_unique(gws, i - 1, ip_addr, port, hostname, hostname_len) == 0) { - LM_ERR("gw <%s, %u, %.*s> is not unique\n", ip_string, port, - hostname_len, hostname); - return 0; - } gws[i].gw_id = gw_id; if (gw_name_len) memcpy(&(gws[i].gw_name[0]), gw_name, gw_name_len); gws[i].gw_name_len = gw_name_len; --- 796,801 ----