This is what I did. A lot more stuff is involved but I will let you figure it out. I have it so that I manually have to go and enable a disabled asterisk server in Dispatcher because I want to make sure the failed one that comes back up is in sync with the spare.

### - Set timeout to failover
$avp(fr_inv_timer) = "2";
$avp(fr_timer) = "2";


switch($avp(vmserver))
{
case "1":
ds_select_dst("1","8");
#t_on_failure("10");
#t_relay();
break;
case "2":
ds_select_dst("2","8");
#t_on_failure("10");
#t_relay();
break;
case "3":
ds_select_dst("3","8");
#t_on_failure("10");
#t_relay();
break;
case "4":
ds_select_dst("4","8");
#t_on_failure("10");
#t_relay();
break;
default:
log("No Asterisk Server configured");
sl_send_reply("503","Service Unavailable");
}

t_on_failure("10");
t_relay();

avp_delete("$avp(vmserver)");
exit;


failure_route[10]{
### - Handle Asterisk Media Server Dispatcher Failures

if(t_was_cancelled() ) {
exit;
}


if( t_check_status("[56][0-9][0-9]") || t_check_status("408") ) {

### - We need to set the last Gateway as Inactive
ds_mark_dst();


if(ds_next_dst()) {

t_on_failure("10") ;

t_relay() ;
exit;
}
t_reply("503","Service not available, no more gateways");
exit ;
}
exit ;
}







On , gwallis <[email protected]> wrote:
Where/how is the failover route configured?



Any more details or manual/book or other doc links hints appreciated.



(Sorry in advance for the newbie -or RTFM avoidance- questions)



--

View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/best-way-to-use-one-active-one-hot-spare-asterisk-server-behind-OpenSIPS-tp6979044p6979499.html

Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



_______________________________________________

Users mailing list

[email protected]

http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to