Hello, How do you guys implement LCR in Asterisk? Thanks,
> Hello, > > How do you guys implement LCR in Asterisk? >I have experimented with 2 ways, both seem to have issues and further testing is taking place now. Method1, use realtime for extensions and load your routing tables in an outbound context. Our requirements are LCR for the ~150,000 USA NPA-NXX combinations, everything outside of that goes through a single carrier so no routing needed. The performance stinks, takes too long to start the call. I need to do further testing and see if this is just a MySQL server (hardware) performance issue or a database structure issue (missing useful indexes). The second method is to use #include lcrtableflatfile.conf in extensions .conf and drop a single outbound context in that file with all of the routes. This method is far faster completing calls, but the asterisk reload command takes a long, long, long time (several minutes) to read the huge file. During the reload calls fail. Any input from others that have already done what I am doing would be helpful, what works best? Damon
I use following for Asterisk LCR: http://www.telefonsparbuch.de/tmpl/calc/telephone/lcr/info/asterisk.htm It is primarily developed for German customers but it is really easy to adapt to other countries. The instructions for installation and usage are in English anyway... so no problem there. It bases on three components: 1. A extensions.conf macro to integrate into Asterisk - but it is fairly slim 2. a php script that does the actual provider lookup 3. a routing table for the various numbers (For the German market it can be created and updated online) Best regards, Arik
How about this: 1. Put all the routes of all the providers in a MySQL table 2. Write a script with a 'clever' algorithm to find out cheapest route of each prefix. 3. Based on #2.. make a lcr_cheapest_route.conf 4. include lcr_cheapest_route.conf in extension.conf But I don't know, how much resource asterisk will take after loading lcr_cheapest_route.conf Also, I don't have any idea about the performance would be. What do you think? Thanks> -----Original Message----- > From: asterisk@lists.styx.org > Sent: Tue, 16 Aug 2005 12:57:14 -0400 > To: asterisk-users@lists.digium.com > Subject: Re: [Asterisk-Users] Asterisk and LCR > > On Tue, Aug 16, 2005 at 10:22:01AM -0600, Damon Estep wrote: > > > > Any input from others that have already done what I am doing would be > > helpful, what works best? > > For 100k routes+, you will have trouble holding them in a SQL database, > particularly if your route selection query is complex. With a modern PC > running PostgreSQL, you'll run into trouble at around 250k BHCA even with > a much smaller number of routes. (This is quite apart from Asterisk > itself, > try writing a simple program that runs sample queries in a loop, perhaps > with several threads. To a certain extent it depends on how you write the > query and how judiciously you place indexes on the tables) When you want > NPANXX granularity from several carriers (commonly 75-100k routes each) > you'll get hit even worse. > > In my experience the safe limits of this approach are about a 2x DS3 > worth of traffic with 10,000 routes in the table... After that you've got > to pull everything into RAM and write a clever route selection > algorithm... > > -w > -- > William Waites > ww -NO@SPAM- magicphone.ca > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
> How about this: > > 1. Put all the routes of all the providers in a MySQL table > 2. Write a script with a 'clever' algorithm to find out cheapest routeof> each prefix.Are you saying realtime mysql is not clever? That is exactly what it is supposed to do.> 3. Based on #2.. make a lcr_cheapest_route.conf > 4. include lcr_cheapest_route.conf in extension.confThat is what we are doing, 3 minute reloads!> > But I don't know, how much resource asterisk will take after loading > lcr_cheapest_route.conf > Also, I don't have any idea about the performance would be. > > What do you think? > > Thanks > > > > > -----Original Message----- > > From: asterisk@lists.styx.org > > Sent: Tue, 16 Aug 2005 12:57:14 -0400 > > To: asterisk-users@lists.digium.com > > Subject: Re: [Asterisk-Users] Asterisk and LCR > > > > On Tue, Aug 16, 2005 at 10:22:01AM -0600, Damon Estep wrote: > > > > > > Any input from others that have already done what I am doing wouldbe> > > helpful, what works best? > > > > For 100k routes+, you will have trouble holding them in a SQLdatabase,> > particularly if your route selection query is complex. With a modernPC> > running PostgreSQL, you'll run into trouble at around 250k BHCA even > with > > a much smaller number of routes. (This is quite apart from Asterisk > > itself, > > try writing a simple program that runs sample queries in a loop,perhaps> > with several threads. To a certain extent it depends on how youwrite> the > > query and how judiciously you place indexes on the tables) When youwant> > NPANXX granularity from several carriers (commonly 75-100k routeseach)> > you'll get hit even worse. > > > > In my experience the safe limits of this approach are about a 2x DS3 > > worth of traffic with 10,000 routes in the table... After thatyou've> got > > to pull everything into RAM and write a clever route selection > > algorithm... > > > > -w > > -- > > William Waites > > ww -NO@SPAM- magicphone.ca > > _______________________________________________ > > Asterisk-Users mailing list > > Asterisk-Users@lists.digium.com > > http://lists.digium.com/mailman/listinfo/asterisk-users > > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk- > users_______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
> Are you saying realtime mysql is not clever? That is exactly what it is > supposed to do. >BTW, how do you integrate mysql with asterisk? any link, documention, tutorials would be greatly helpful. Thanks,
> > > Are you saying realtime mysql is not clever? That is exactly what itis> > supposed to do. > > > > > BTW, how do you integrate mysql with asterisk? > any link, documention, tutorials would be greatly helpful. >Search www.voip-info.org for asterisk realtime
I'm wondering how you guys handle least cost routing within Asterisk. Basically, we have a few providers with, obviously, different rates per route. Additionally, we have a number of clients who have DIDs assigned to them (either pointing to a single SIP peer or to more complex dialing rules, such as, ring multiple SIP peers, or ring SIP peers sequentially, or overflow to external forwarded number). What we are trying to do is to ease the pain of Asterisk dialing through the least cost route regardless of where the destination is. If the call is to go through a provider, well, then dial the least cost provider. If someone is dialing a number which happens to be one of the DIDs assigned in our system, it shouldn't have to go out through any provider but just be routed properly in the dialing plan. Also, if a client has defined a rule to forward calls to another number, how can I let the dial plan to dial out that number while taking advantage of the LCR in place? We looked at lcdc script but not quite sure is what we need or maybe don't understand it completely to implement it correctly. Thanks, Waldo
I use Portaone's PortaSIP for everything related to LCR Alyed ---------------------------------------- Return-Path: <asterisk-users-bounces@lists.digium.com> Wed Mar 29 16:48:54 2006 Received: from digium-69-16-138-164.phx1.puregig.net [69.16.138.164] by mail11.webcontrolcenter.com with SMTP; Wed, 29 Mar 2006 16:48:54 -0700 Received: from digium-69-16-138-164.phx1.puregig.net (localhost [127.0.0.1]) by lists.digium.com (Postfix) with ESMTP id 2D302C3B8; Wed, 29 Mar 2006 16:36:31 -0700 (MST) I'm wondering how you guys handle least cost routing within Asterisk. Basically, we have a few providers with, obviously, different rates per route. Additionally, we have a number of clients who have DIDs assigned to them (either pointing to a single SIP peer or to more complex dialing rules, such as, ring multiple SIP peers, or ring SIP peers sequentially, or overflow to external forwarded number). What we are trying to do is to ease the pain of Asterisk dialing through the least cost route regardless of where the destination is. If the call is to go through a provider, well, then dial the least cost provider. If someone is dialing a number which happens to be one of the DIDs assigned in our system, it shouldn't have to go out through any provider but just be routed properly in the dialing plan. Also, if a client has defined a rule to forward calls to another number, how can I let the dial plan to dial out that number while taking advantage of the LCR in place? We looked at lcdc script but not quite sure is what we need or maybe don't understand it completely to implement it correctly. Thanks, Waldo _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060329/d746d6e5/attachment.htm