[OpenSIPS-Users] best way to use one active one hot spare asterisk server behind OpenSIPS

duane.larson at gmail.com duane.larson at gmail.com
Wed Nov 9 21:59:23 CET 2011


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 <gary.wallis at voicecarrier.com> 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

> Users at lists.opensips.org

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20111109/3000daa0/attachment-0001.htm>


More information about the Users mailing list