<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 12/12/2013 02:42 PM, Victor
Chukalovskiy wrote:<br>
</div>
<blockquote cite="mid:52AA1192.6020005@gmail.com" type="cite">
<pre wrap="">Hello,
For those interested, I added a piece to mod lcr wiki. It makes sorting
/ routing logic better than default logic:
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org/wiki/Mod_lcr#Custom_SQL_with_sub-query_-_for_real-life_ratesheet_complexities">http://wiki.freeswitch.org/wiki/Mod_lcr#Custom_SQL_with_sub-query_-_for_real-life_ratesheet_complexities</a>
Why it helps:
Rates rates can often be given both on per-NPA or per-NPANXX level
depending on the carrier and on the NPA. Moreover, some carriers may
have NPANXX rate lower than the corresponding NPA rate, while others
will have it inverse. Neither simple ORDER BY rate, prefix; nor ORDER BY
prefix, rate; give the truly cheapest route. The LCR logic should be
two-step process to accommodate this.
Cheers,
-Victor
</pre>
</blockquote>
Unless I misunderstand what you're saying, this is what the
reorder_by_rate param does.<br>
<br>
You'll always want to pick the longest digit match per carrier.
Then you probably want to grab the cheapest overall rate of the
matches you got back.<br>
<br>
-Ray<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<span style="color: rgb(0, 0, 0); font-family: sans-serif;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
19.046875px; orphans: auto; text-align: left; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline !important;
float: none;"></span>
</body>
</html>