Hi All,
I am trying to set up SER with Dispatcher to loadbalancing the traffic to 2 * boxes. SER was able to select the * IPs from the dispatcher.list, but * SIP response back authentication required. It work perfectly if I i use rewritehostport instead of using the dispatch module. I am pulling my hair now and still don't know where the problem at.
openser.cfg
if (uri=~"sip:\+?[1-9][0-9]*@.*") {
ds_select_dst("2", "0");
route(4);
route(5);
return;
};
route[4] {
if (isflagset(6)) {
force_rport();
fix_nated_contact();
force_rtp_proxy();
};
}
route[5] {
setflag(1);
t_on_reply("1");
forward(uri:host, uri:port);
append_hf("P-hint: main PSTN route\r\n");
t_on_failure("1");
if (!t_relay()) {
sl_reply_error();
return;
};
}
onreply_route[1] {
if (isflagset(6) && status=~"(180)|(183)|2[0-9][0-9]") {
if (!search("^Content-Length:[ ]*0")) {
force_rtp_proxy();
};
};
if (nat_uac_test("1")) {
fix_nated_contact();
};
}
failure_route[1] {
append_hf("P-hint: backup PSTN route\r\n");
rewritehost("x.x.x.x");
rewriteport( "5060");
append_branch();
t_relay();
}
SIP.conf form *
[general]
host=dynamic
bindaddr=0.0.0.0
port=5060
useragent=x
context=default
disallow=all
allow=g729
allow=ulaw
autocreatepeer=yes
dtmfmode=rfc2833
qualify=no
nat=yes
canreinvite=no