Hello Juha. Yes, sorry for the "wrong output" I made a mistake trying to protect the data. Let's assume the next table :
mysql> select * from lcr where prefix=1351 order by id; +-----+--------+----------+--------+----------+ | id | prefix | from_uri | grp_id | priority | +-----+--------+----------+--------+----------+ | 127 | 1351 | | 51 | 1 | | 128 | 1351 | | 43 | 2 | +-----+--------+----------+--------+----------+
The dump command shows the correct order and priority for the prefix 1351:
GW:: GRP_ID=51 IP_ADD=XX.XX.XX.13 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=4 TAG=1351 WEIGHT=25 FLAGS=0 PING=1 GW:: GRP_ID=51 IP_ADD=XX.XX.XX.16 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=4 TAG=1351 WEIGHT=25 FLAGS=0 PING=1 GW:: GRP_ID=51 IP_ADD=XX.XX.XX.32 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=4 TAG=1351 WEIGHT=25 FLAGS=0 PING=1 GW:: GRP_ID=51 IP_ADD=XX.XX.XX.35 HOSTNAME= PORT=5060 SCHEME=sip TRANSPORT=udp STRIP=4 TAG=1351 WEIGHT=25 FLAGS=0 PING=1 RULE:: PREFIX=1351 FROM_URI= GRP_ID=51 PRIORITY=1 RULE:: PREFIX=1351 FROM_URI= GRP_ID=43 PRIORITY=2
In both cases the "dump" show the correct information.
To solve the problem I just reorder the "records" in the lcr table. I deleted the 89 and 127 record and then added two correlative records : 127 and 128.
Regards, Ricardo.-
-----Mensaje original----- De: Juha Heinanen [mailto:jh@tutpro.com] Enviado el: miƩrcoles, 21 de octubre de 2009 3:10 Para: Ricardo Martinez CC: users@lists.kamailio.org Asunto: [Kamailio-Users] LCR problem with "id" column and match priorities.
Ricardo Martinez writes:
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.
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 |
+-----+--------+----------+--------+----------+
there is something wrong in above, because where clause is not matching the output.
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.
are you saying that the problem goes away if you in the first table change id 89 to id 127?
rather that printing your mysql tables, show what lcr dump mi commands give.
-- juha