<div dir="ltr">Ruddy, he&#39;s asking the next question...<div>I have my routing table, but I want to provide the customer with an a-z or  just npa-nxx rate list.</div><div>How do I automatically comb my database for each possible destination sub-type to generate a rate deck, and properly merge carriers with my pre-defined profit margin?</div>

<div><br></div><div>It&#39;s not a simple question...<br><div><div><br clear="all"><div dir="ltr"><font face="Verdana, Arial, Helvetica, sans-serif"><span style="font-size:small">-Avi<br></span></font></div><br>
<br><br><div class="gmail_quote">On Thu, Sep 27, 2012 at 1:31 PM, Ruddy Gbaguidi <span dir="ltr">&lt;<a href="mailto:plugworld@micnes.com" target="_blank">plugworld@micnes.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi<br>
It all depends on your database design.<br>
What you can do is first have a provider&#39;s rates table.<br>
It will have the provider name/id, the destination prefix, and price.<br>
So, when you have a full destination number (eg 10 digits), you run a query<br>
where the number contains the provider prefix.<br>
Then you order by prefix length descending and by price ascending..<br>
<br>
It is called least cost routing.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:asterisk-biz-bounces@lists.digium.com">asterisk-biz-bounces@lists.digium.com</a><br>
[mailto:<a href="mailto:asterisk-biz-bounces@lists.digium.com">asterisk-biz-bounces@lists.digium.com</a>] On Behalf Of Gerry Jacobsen<br>
Sent: 2012-09-27 03:26<br>
To: Commercial and Business-Oriented Asterisk Discussion<br>
Subject: [asterisk-biz] Algorithms for generating dialing codes and rates?<br>
<br>
Hello,<br>
<br>
is anyone aware of algorithms or software which can generate customer rate<br>
tables with dialing codes and rates from given provider rates - without<br>
having a predefined destination, dialing code table for customers ?<br>
<br>
Inputs:<br>
<br>
- several offers from providers with break-out codes and rates<br>
- parameter: maximum break-out code length<br>
- parameter: profit margin<br>
<br>
Output:<br>
- Customer rate table with breakout codes / destinations and rates<br>
<br>
Anyone?<br>
<br>
TIA<br>
<br>
Gerry<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-biz mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-biz" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-biz</a><br>
<br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-biz mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-biz" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-biz</a><br>
</div></div></blockquote></div><br></div></div></div></div>