[Kamailio-Users] LCR problem with "id" column and match priorities.

Ricardo Martinez rmartinez at redvoiss.net
Tue Oct 20 23:28:05 CEST 2009


Hello List.

I'm having a weird behavior with the LCR module.

I have a particular prefix routed as follows (according to the LCR
tables) :

 

mysql> select * from lcr where prefix=0251;

+-----+--------+----------+--------+----------+

| id  | prefix | from_uri | grp_id | priority |

+-----+--------+----------+--------+----------+

|  89 | 1351   |          |     51 |        1 | 

| 127 | 1351   |          |     43 |        2 | 

+-----+--------+----------+--------+----------+

 

The gw's group are as follows : 

 

mysql> select * from gw where grp_id=51;               

+-----+----------------+--------+---------------+----------+------+-----
-------+-----------+-------+------+--------+------+-------+

| id  | gw_name        | grp_id | ip_addr       | hostname | port |
uri_scheme | transport | strip | tag  | weight | ping | flags |

+-----+----------------+--------+---------------+----------+------+-----
-------+-----------+-------+------+--------+------+-------+

| 100 | GW1.TERMN1     |     51 | XX.XXX.XXX.16 |          | 5060 |
1 |         1 |     4 | 1351 |     25 |    1 |     0 | 

| 101 | GW2.TERMN1     |     51 | XX.XXX.XXX.13 |          | 5060 |
1 |         1 |     4 | 1351 |     25 |    1 |     0 | 

| 102 | GW3.TERMN1     |     51 | XX.XXX.XXX.32 |          | 5060 |
1 |         1 |     4 | 1351 |     25 |    1 |     0 | 

| 103 | GW4.TERMN1     |     51 | XX.XXX.XXX.35 |          | 5060 |
1 |         1 |     4 | 1351 |     25 |    1 |     0 | 

+-----+----------------+--------+---------------+----------+------+-----
-------+-----------+-------+------+--------+------+-------+

4 rows in set (0.00 sec)

 

mysql> 

mysql> select * from gw where grp_id=43;

+----+------------------+--------+---------------+----------+------+----
--------+-----------+-------+------+--------+------+-------+

| id | gw_name          | grp_id | ip_addr       | hostname | port |
uri_scheme | transport | strip | tag  | weight | ping | flags |

+----+------------------+--------+---------------+----------+------+----
--------+-----------+-------+------+--------+------+-------+

| 76 | GW1.TERMN222     |     43 | XX.XXX.XXX.16 |          | 5060 |
1 |         1 |     4 | 1343 |     25 |    1 |     0 | 

| 77 | GW2.TERMN222     |     43 | XX.XXX.XXX.13 |          | 5060 |
1 |         1 |     4 | 1343 |     25 |    1 |     0 | 

| 78 | GW3.TERMN222     |     43 | XX.XXX.XXX.32 |          | 5060 |
1 |         1 |     4 | 1343 |     25 |    1 |     0 | 

| 79 | GW4.TERMN222     |     43 | XX.XXX.XXX.35 |          | 5060 |
1 |         1 |     4 | 1343 |     25 |    1 |     0 | 

+----+------------------+--------+---------------+----------+------+----
--------+-----------+-------+------+--------+------+-------+

4 rows in set (0.00 sec)

 

 

So, when a call with prefix 1351 arrived at the proxy, the LCR module is
changing the RURI for 1343 (matching the 2nd priority for that prefix).

This keep happening even if change the priority value 2 for priority
value 5.  I even changed the priority 1 for priority 0 as follows : 

 

+-----+--------+----------+--------+----------+

| id  | prefix | from_uri | grp_id | priority |

+-----+--------+----------+--------+----------+

|  89 | 1351   |          |     51 |        0 | 

| 127 | 1351   |          |     43 |        1 | 

+-----+--------+----------+--------+----------+

 

But the LCR module keep using the "second" priority.

After doing some tests I've found two ways to use the "first" priority
for the prefix.  

1.- Removing the second priority

2.- Re-ordering the "id" column and using correlative values as
indicated in the next table : 

 

 

mysql> select * from lcr where prefix=0251 order by id;

+-----+--------+----------+--------+----------+

| id  | prefix | from_uri | grp_id | priority |

+-----+--------+----------+--------+----------+

| 127 | 1351   |          |     51 |        1 | 

| 128 | 1351   |          |     43 |        2 | 

+-----+--------+----------+--------+----------+

 

So, when the prefix are with "no correlatives" values in the "id" column
seems to be a problem to match the first priority.  But when the values
are correlative there is no problem.

Is this the correct behavior?  Maybe I'm missing something?

What happens for example if I need to add a third priority to a certain
prefix after doing several changes in the LCR table?  I need to re-order
every time the "id" values to make them correlatives?

 

 

I really hope that someone could give me a hand here.

 

Ricardo Martinez.-

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20091020/f0f4c55c/attachment.htm>


More information about the sr-users mailing list