<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:10pt"><div style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><font size="3"><span style="font-family: times new roman,new york,times,serif;">&gt;I am using this module in production with more then 400k routes loaded</span><br style="font-family: times new roman,new york,times,serif;"></font><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="3"><span style="font-family: times new roman,new york,times,serif;">&gt;for 8 different providers and it is working like a charm.</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;As Henning mentioned, the interface is a little bit cumbersome but usable.</span><br
 style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;You can put all the carriers under the same table and prioritize the</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;gateway based on domains.&nbsp; Like tis you don't need to hardcode</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;anything in the config file.</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;Carrierroute was designed to deal with a big amount of routing rules</span><br style="font-family: times new roman,new
 york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;and it is doing an amazing job.</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;LCR was designed to deal with a limited number of routes/gateways but</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;it has a different level of flexibility and a more mature interface.</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;</span><br style="font-family: times new roman,new york,times,serif;"><span style="font-family: times new roman,new york,times,serif;">&gt;Carrierroute is a brand new module and for sure it will improve in</span><br style="font-family: times new roman,new york,times,serif;"><span
 style="font-family: times new roman,new york,times,serif;">&gt;flexibility as times go by (just like the lcr did along releases).</span></font><br><br><span style="color: rgb(0, 0, 0);">Ovidiu (or anyone else....)</span><br style="color: rgb(0, 0, 0);"><br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">I think I may almost have it..... If I treat all routes as being in the same carrier, I can just use cr_rewrite_uri("1","call_id"), and then cr_rewrite_uri("2","call_id") in failure_route[1] and cr_rewrite_uri("2","call_id") in failure_route[2], correct? I tested this and it seems to work. I guess it's up to me then to populate the rewrite_host column with a gateway belonging to the cheapest carrier for domain 1, the a gateway from the next cheapest carrier for domain 2 and so on. Still sound right?</span><br><br>Here's where it gets a bit tricky. We have OpenSER running in 6 different locations. The gateways we use will differ for each
 location (we always want to use the closest gateway belonging to a carrier). So, I figured I could use the 'user' functionality in carrierroute to do this. I could simply put the domain (IP address) in the domain column, leave the user blank (we don't have users... calls are forwarded from asterisk), and then associate a carrier in the cr_preferred_carrier column. You can see all that in my subscriber table below. <br><br>Doesn't seem to work though. When routing a call, OpenSER complains that it can't find a default carrier, and then because it seems not to match the incoming call against an entry in the subscriber table, it can't find a carrier to use, and fails the call.<br><br>So... how would I be able to use the source IP address of the asterisk box that sends the calls to OpenSER in the subscriber table so that I could have different routing entries for each OpenSER system???<br><br>Here's my db tables...<br><br><br><font size="2"><span
 style="font-family: Courier New,courier,monaco,monospace,sans-serif;">mysql&gt; select * from route_tree;</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+-----------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">| id | carrier&nbsp;&nbsp; |</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+-----------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">|&nbsp; 1 | Hong Kong | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">|&nbsp; 0 | San Jose&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+-----------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">mysql&gt; select * from carrierroute order by carrier, scan_prefix, domain;</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+---------+-------------+--------+------+-------+--------------+----------------+----------------+---------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier
 New,courier,monaco,monospace,sans-serif;">| id | carrier | scan_prefix | domain | prob | strip | rewrite_host | rewrite_prefix | rewrite_suffix | comment |</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+---------+-------------+--------+------+-------+--------------+----------------+----------------+---------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">|&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 200.1.1.1&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">|&nbsp; 4 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 200.1.1.2&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">|&nbsp; 5 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0
 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 200.1.1.3&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">|&nbsp; 9 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 100.1.1.1&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">| 10 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 100.1.1.2&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">| 11 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1
 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp; 0 | 100.1.1.3&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp; | </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">+----+---------+-------------+--------+------+-------+--------------+----------------+----------------+---------+</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;">mysql&gt; select id, username, domain, cr_preferred_carrier from
 subscriber;<br>+----+----------+----------------+----------------------+<br>| id | username | domain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | cr_preferred_carrier |<br>+----+----------+----------------+----------------------+<br>|&nbsp; 1 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 192.168.255.53 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 | <br>|&nbsp; 2 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 192.168.255.54 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 | <br>+----+----------+----------------+----------------------+<br></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif;"></span></font><br><br><br></div><br></div></div><br>
      <hr size=1>Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>