Hi All, I have 100 Trunks from my Provider. My Provider is restricting me to make only 120 minutes Call duration / trunk / day. So I want to load balance my calls to these 100 trunks. Please advise in this regard ASAP. Thanks in advance. Regards-----------Abid SaleemTechnical Manager NGNTerminus Technologies -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110629/3d4f8918/attachment.htm>
On Wed, 29 Jun 2011, Abid Saleem wrote:> I have 100 Trunks from my Provider. My Provider is restricting me to > make only 120 minutes Call duration / trunk / day. So I want to load > balance my calls to these 100 trunks. Please advise in this regard ASAP. > Thanks in advance.The arrangement sounds 'sketchy' to me :) You will need to use a database (MySQL, ASTDB, etc) of some sort to keep persistent (surviving a crash or restart) track of the usage. You will also need some sort of lock mechanism (usually a feature of a 'real' database) to prevent race conditions with regard to simultaneous calls. While you can code up database access in dialplan, my personal preference is to wrap database code up in an AGI because you have better control, robustness and maintainability. Also, database access in dialplan is just plain ugly. Is your intent to 'load balance' between 100 trunks or will you fill up one before moving on to the next? Can unused capacity be 'rolled over' to the next day? What happens if you 'go over?' Will the call in flight be terminated? Will the next origination fail? Will you get a nasty rate spike? -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Wednesday 29 Jun 2011, Abid Saleem wrote:> Hi All, > I have 100 Trunks from my Provider. My Provider is restricting me to make > only 120 minutes Call duration / trunk / day. So I want to load balance my > calls to these 100 trunks. Please advise in this regard ASAP. Thanks in > advance. Regards-----------Abid SaleemTechnical Manager NGNTerminus > TechnologiesWhat you will have to do is, set up a database keeping track of how much time has been used on each trunk; and create two AGI scripts. One, which you run immediately before your Dial() statement, sets a channel variable indicating which trunk to use. (Inside a loop, pick a trunk at random; and if there are minutes to spare on that trunk, and it's not in use, exit the loop. Then set a channel variable, and mark the trunk as in use.) Another, which you run in your h extensions, updates the database; subtracting the duration of the call just finished from the time allotted to that trunk, and marking it available. If you were pathologically dishonest, this technique probably would also work for leeching other people's bandwidth in doses small enough to go unnoticed ..... ;) -- AJS Answers come *after* questions.
On 06/29/2011 09:49 AM, Abid Saleem wrote:> I have 100 Trunks from my Provider. My Provider is restricting me to > make only 120 minutes Call duration / trunk / day. So I want to load > balance my calls to these 100 trunks. Please advise in this regard > ASAP. Thanks in advance.I read a scam involving the dumping of wholesale call volumes onto retail/access trunks. Groundbreaking and original. Not. -- Alex Balashov - Principal Evariste Systems LLC 260 Peachtree Street NW Suite 2200 Atlanta, GA 30303 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/
---------------------------------------- From: "Abid Saleem" <abid_asterisk at hotmail.com> Sent: Friday, July 01, 2011 9:49 AM To: "Users List" <asterisk-users at lists.digium.com> Subject: Re: [asterisk-users] Load Balance Trunks Dear Steve Edward, I appreciate your response and help. Here are the answers inline to your questions. Please help me in writing an AGI script or whatever required if you can as I am not a programmer. Is your intent to 'load balance' between 100 trunks or will you fill up > one before moving on to the next? Can unused capacity be 'rolled over' to> the next day? Abid -> The intention is to load balance between 100 oreven more trunks. Filling up one trunk may have another problem because we have another restriction on 5 simultaneous calls per trunk. Yes unused capacity can be rolled over to the next day. Anything is fine that does not break these two restrictions of 120 mins/day/trunk and 5 simultaneous calls/trunk. > What happens if you 'go over?' Will the call in flight be terminated? Will > the next origination fail? Will you get a nasty rate spike? Abid -> If we go over, the call will not be terminated nor the next origination will fail nor we will get nasty rate spike but they will send us warnings and then finally block our trunks. abod -> Another solution would be to use call groups. You could create a load balancer that increments the group everytime a call is sent to a trunk when the call attempt clears the group is decremented. Check your counts and use the first trunk that is not saturated. It is a very lowtech soltion and would require some planning on how you want your roll over to occure but it would work and you would not have to use any agi or database tech if you did not want to. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110701/3a415bee/attachment.htm>