From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Olle E. Johansson
Sent: woensdag 12 december 2012 11:01
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: Re: [SR-Users] Dispatching to Asterisk cluster

 

 

12 dec 2012 kl. 10:18 skrev Grant Bagdasarian <GB@cm.nl>:



Hello,

 

We have a cluster of three Asterisk machines. Each machine answers an incoming call and transfers it to unique remote destination.

So, Asterisk01 transfers to Destination01, Asterisk02 to Destination02, Asterisk03 to Destination03.

 

The Asterisk machines are allowed to receive and answer only 50 calls each.

 

I have a Kamailio in front of these three machine. It is currently used to dispatch calls to the three machines using round-robin.

But I need some way to equally dispatch a maximum of 50 calls to each device in the Asterisk dispatcher set.

 

I was thinking of using the dispatcher module and using the 10 algorithm, to load balance based on call load. But I’m not sure if that will guarantee a maximum of 50 calls being dispatched to each Asterisk.

Theoretically, if I set the ds_hash_size to 7, which is 128 slots, at some point two of them should have 43 calls and one 42 calls.

Also the value of ds_hash_size should be the power of two. Are decimal values allowed, like 7,229 which equals to almost 150?

 

Perhaps I should use the ratelimit module for this?

 

I’d appreciate it if someone could give me some advice on this.

 

In addition, consider setting the maxcalls option in asterisk.conf and Asterisk will not accept any calls over that limit, leaving it up to Kamailio to handle where to send the call when Asterisk is filled with media.

 

/O

 

Ah, yes. I totally forgot about that option. Thank you!

 

This way I’ll be able to leave Kamailio in round-robin mode.