views:

643

answers:

2

I need to load balance incoming calls to asterisk. To do this, I have set up the Openser server in front of it and I loaded and configured the dispatcher modules to do so. What I want to do is that the Openser server will receive the calls and route them to the least "busy" Asterisk server which will take care of the rest (I have an IVR menu set up in each of the servers). I am using X-Lite softphone for testing. The same users are registered in both Asterisk and Openser. When I initiate the call it just goes across the Openser server, it does not get forwarded to any of the Asterisk boxes. I am wondering if I am missing any configuration or step in my set up.

Thank you in advance

A: 

The dispatcher module cannot do any type of load balancing. It is a "stateless" module, that means that it does not keep track of how many calls are sent to each box.

You can choose different types of routing logic, the available types are:

“0” - hash over callid
“1” - hash over from uri.
“2” - hash over to uri.
“3” - hash over request-uri.
“4” - round-robin (next destination).
“5” - hash over authorization-username 
“6” - random (using rand()).
“7” - hash over the content of PVs string.
“X” - if the algorithm is not implemented, the first entry in set is chosen.

The one most likely to distribute the load fairly is round-robin (option 5).

To use it, call the following function in the route section of your openser.cnf:

ds_select_dst("1", "5");

The first parameter is your GW group, the second is the routing type.

For more info check this page

Hope this helps

Alex
A: 

The dispatcher module cannot do that. You'd have to use the (surprise!) load balancer module

viraptor