On 20-10 14:33, Andreas Granig wrote:
Hi all,
Since SER does not provide DNS SRV failover capability, how do you
perform failover for your PSTN gateways?
I currently think about some sort of load balancing with exec_dset()
which looks up a gateway in a mysql db and give it 10 tries to find a
gateway (SER is running on my.domain:5060)
route
{
if (!mf_process_maxfwd_header("10"))
{
sl_send_reply("483", "Too many hops");
break;
}
<snip>
exec_dset("/my/sipgw-balancing-script"); # returns a random GW
t_on_failure("1");
t_relay();
<snip>
}
failure_route[1]
{
if(t_check_status("503")
{
rewritehostport("my.domain:5060"); # peform loop
append_branch();
t_relay();
}
}
Is this good practice? Any other ideas/optimizations?
I would probably try to avoid mysql, because the scripts needs to
connect to the mysql server and perform authentication/authorization
each time -- that can be slow.
Jan.