<div dir="ltr"><div><div><div>Hello, I have to take care of an old server running kamailio 1.4 (I plan to upgrade to latest, but I cannot do it at the moment).<br></div>It uses carrierroute and it works fine.<br>Now I am testing adding a new carrier and it worked.<br>
However, sometimes I get a failure to resolve a route (using cr_route):<br>Oct  9 21:29:04 centos53-02121 /usr/local/src/svn/kamailio-1.4/kamailio[3160]: ERROR:carrierroute:cr_do_route: desired routing domain doesn't exist, prefix 99900000112233445566778899, carrier 10, domain 0<br>
<br></div>I can see the cause of the problem is because an element called "id" is solved differently sometimes when "cr_reload_routes" is issued.<br></div>I am using always this same table:<br><div><div>
<br><br><span style="font-family:courier new,monospace">mysql> select * from carrierroute where carrier=10;<br>+------+---------+--------+-------------+-------+------+------+-------+--------------------+----------------+----------------+-------------+<br>
| id   | carrier | domain | scan_prefix | flags | mask | prob | strip | rewrite_host       | rewrite_prefix | rewrite_suffix | description |<br>+------+---------+--------+-------------+-------+------+------+-------+--------------------+----------------+----------------+-------------+<br>
| 4271 |      10 | 0      | 999000      |     0 |    0 |    1 |     6 | <a href="http://192.168.2.123:5060">192.168.2.123:5060</a> |                |                | NULL        | <br>| 4272 |      10 | 1      | 999000      |     0 |    0 |    1 |     6 | <a href="http://192.168.2.123:5060">192.168.2.123:5060</a> |                |                | NULL        | <br>
+------+---------+--------+-------------+-------+------+------+-------+--------------------+----------------+----------------+-------------+<br>2 rows in set (0.00 sec)</span><br><br>When cr_route works fine, the reload logged this:<br>
Oct  9 21:31:21 centos53-02121 /usr/local/src/svn/kamailio-1.4/kamailio[7902]: DBG:carrierroute:get_route_tree_by_id: tree carrier_10, domain 0 : 0<br>Oct  9 21:31:21 centos53-02121 /usr/local/src/svn/kamailio-1.4/kamailio[7902]: DBG:carrierroute:get_route_tree_by_id: tree carrier_10, domain 1 : 1<br>
<br>But when it fails, it logged this:<br>Oct  9 21:29:04 centos53-02121 /usr/local/src/svn/kamailio-1.4/kamailio[3160]: DBG:carrierroute:get_route_tree_by_id: tree carrier_10, domain 0 : 1<br>Oct  9 21:29:04 centos53-02121 /usr/local/src/svn/kamailio-1.4/kamailio[3160]: DBG:carrierroute:get_route_tree_by_id: tree carrier_10, domain 1 : 2<br>
<br></div><div>So I understand that the problem is a mismatch between a value that is produced by kamailio when I ask for a domain (named '0' and '1') and value of id that probably was computed based on domain at the time the route_tree was created.<br>
</div><div>So, I was thinking, maybe domain names '0' and '1' would not be good for this and I should use some longer names. Well i should not expect a domain named '0' to always result in an id=0. But I would expect that whatever id is resolved, it should happen equally for both values being matched that came from the same base element (supposedly, the domain name).<br>
</div><div>I will test using longer names anyway, but since this problem doesn't happen everytime I do cr_reload_routes, I was hoping to get an opinion about it.<br><br></div><div>Regards,<br>Takeshi<br></div><div><br>
</div></div></div>