I'd like to think I'm not stupid, but I've been dealing with OpenSER for 2-3 years now and it still frustrates me just as much as it did the very first time I looked at it.
Can LCR do failover? I have this below. I can see that one of my gateways is selected, seemingly at random, and then when it doesn't reply (because I used a bogus IP), it doesn't time-out after 3s and go to the next gw. Is this possible? How do I do it?
Btw... can anyone recommend a book on OpenSER, since the documentation is so lacking?
modparam("tm", "fr_inv_timer_avp", "$avp(i:705)")
route{
$avp(i:705) = "3";
...
if (!lookup("location")) {
switch ($retcode)
{
case -1:
case -3:
t_newtran();
sl_send_reply("100","Trying");
if (!load_gws()) {
sl_send_reply("500", "Internal server error, unable to load gateways");
exit;
}
if(!next_gw()){
sl_send_reply("503", "Service not available, no gateways found");
exit;
};
route(1);
}
}
route[1] {
if (is_method("INVITE")) {
t_on_branch("2");
t_on_reply("2");
t_on_failure("1");
}
if
(!t_relay()) {
sl_reply_error();
};
exit;
}