SER Load balancing (SIP proxy load balancing)
SER provide Dispatcher Module for call load balancing. First compile dispatcher module and make changes in ser.cfg .
Dispatcher module configuration step by step---
cd ser-0.9.6
make modules modules=modules/dispatcher
cp modules/dispatcher/dispatcher.so /usr/local/lib/ser/modules/
Create Destination address (sip proxy/ gateways address) list file
vi /usr/local/etc/ser/dispatcher.list
Copy & paste following lines
--------------------------------
# proxies
#Group Protocoltype:proxy/gateway address:port
1 sip:127.0.0.1:5080
1 sip:127.0.0.1:5082
# gateways
3 sip:127.0.0.1:7070
3 sip:127.0.0.1:7072
3 sip:127.0.0.1:7074
--------------------------------
Add following configuration in ser.cfg
#load dispatcher module
loadmodule " /usr/local/lib/ser/modules/dispatcher.so"
#include dispatcher list (sip proxy address)
modparam("dispatcher", "list_file", "/usr/local/etc/ser/dispatcher.list ")
# if you wants to use focally proxy group 1 then
# modparam("dispatcher", "force_dst", 1)
# make the changes rout section where you was configure host forwarding
route{
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
drop();
};
ds_select_dst("1", "0");
# ds_select_dst("3", "0");
# 1 means call load balancing on group 1 (proxy) & 3 means load balancing on group 3(gateways).
forward(uri:host, uri:port);
# t_relay();
}
After configuring ser.cfg restart ser and enjoy.