[Asterisk-Users] Help with Weird Setup
Matt Riddell
matt.riddell at sineapps.com
Mon Aug 22 04:20:12 MST 2005
Joshua Abbott wrote:
> Hello,
> I have 2 outgoing calling companies. Say A and B.
> With A company, I'm given 250 Minutes free per month.
> I would like to start off by using A company until 250 minutes were
> depleted for that month then use B and of course switch back to A once
> the next month turns up.
>
> How would I do this?
Include it in your LCR dialling AGI.
I.E. Grab an agi file for Least Cost Routing, then add another field which
allows you to weight providers and another one to stole credit amount. In
each call decrease the credit amount and always select the highest weight
provider unless they have no credit remaining.
I.E. Pseudo SQL:
SELECT costPerMinute, iaxDialString FROM rate_table WHERE dest='0039' AND
credit>0 ORDER BY weight LIMIT 1
--
Cheers,
Matt Riddell
_______________________________________________
http://www.sineapps.com/news.php (Daily Asterisk News - html)
http://www.sineapps.com/rssfeed.php (Daily Asterisk News - rss)
More information about the asterisk-users
mailing list