Least Cost Routing (LCR) with Asterisk and A2Billing
A2Billing is a great piece of call billing software for Asterisk. It can be integrated with FreePBX and used in lots of different ways.
I run my own Asterisk system with FreePBX and use a2billing to do least cost routing. It’s possible to import rate tables from many different voip providers and then let a2billing route the call based on the cheapest route.
One of the things you need to be aware of is that a2billing will route based on the ‘best matching’ rate. So, lets say you are trying to call +17061234567 and you have rate cards for 2 providers. If provider_a has a rate for +17061 at $0.02/min and provider_b has a rate for +1706 at $0.01/min, a2billing will choose the more expensive provider_a as the rate is a better match. This could require some manipulation of the rate tables to get things to work how you want.
As I said a2billing can also integrate with FreePBX so that you can pass all outgoing calls from FreePBX to A2Billing to allow it to do the routing. You also get the benefit of better CDR reports.
So, if you’re looking for something to do least cost routing for Asterisk then it might be worth checking out a2billing!
Last updated by .
Related posts:
- FreePBX vs A2Billing
- Routing a call based on time of day with FreePBX
- Integrating FreePBX with A2Billing
Avaialble systems include FreePBX, PBX-in-a-Flash, Elastix, A2Billing and FusionPBX.
More details and prices can be found at sysadminman.net

DefLeppard:
Hello, thanks for your this post. I was wondering why LCR was not working for me.
I have 2 providers, one with 3 digit prefixes and the other with 6 digit prefixes (all USA). I wanted to make LCR work with this setup but every time I dial out the call always goes from the 6 digit prefix provider even though the other one may have lower rates.
It seems from your post I won’t be able to achieve it. Is there an alternative way to achieve this?
25 July 2011, 8:26 ammatt:
It is indeed the default behaviour of a2billing to match the most specific rate, and then the cheapest.
This does cause problems if you have multiple rate cards with different length prefixes. See here for some discussion and possible solutions – http://www.asterisk2billing.org/cgi-bin/trac.cgi/ticket/787
25 July 2011, 8:42 am