– Kamailio SIP Server –

Asterisk Load balancing and High Availability with OpenSER

OpenSER coupled with Asterisk are implemented in many huge installations.

The simplest way to set up load balancing is to use the dispatcher module.

The dispatcher.cfg file should be set up like:

# group  sip addresses of your * units
1 sip:
1 sip:
1 sip:

the basic openser.cfg should be like:



if ( method=="INVITE" ) {
# dst_select( "GROUP", "HASH METHOD")
  forward(uri:host, uri:port);

If you are interested in using the dispatcher to do 300 Redirect, you can do the following:

if ( method=="INVITE" ) {
  # you can also add prefixes, if you need to send account codes
  # like:
  # prefix("123456");

in this fashion, you can put in a very inexpensive SER/OpenSER installation to use as a load-balancer for your * units.

SRV Records

Another option is to use SRV records for your asterisk server group and forward the message into the domain.