best way to use one active one hot spare asterisk server behind OpenSIPS

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

best way to use one active one hot spare asterisk server behind OpenSIPS

gwallis
I have my phones using DNS-SRV for HA with two kept in sync Asterisk PBXs.

What is the best way to setup OpenSIPS (all my DIDs go to my OpenSIPS server) to deal with both of my Asterisk servers. OpenSIPS seems to handle DNS-SRV, but what is the recommended configuration for my simple topology.

[Vitelity/Bandwidth/Etc.]---[openSIPS as sip switch]---|---[Asterisk0]
                                                                           |---[Asterisk1]
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

Ovidiu Sas
You can simply forward all your calls to the active asterisk server
with a failover route to the hot spare.
If a failover occurred, mark your old hot spare as active and your old
active as spare (this will route future calls to your new active
asterisk server).

Another option would be to keep both asterisk servers active, and load
balance between them (with a failure route to the other one, in case
one is down)

Regards,
Ovidiu Sas


On Wed, Nov 9, 2011 at 1:49 PM, gwallis <[hidden email]> wrote:

> I have my phones using DNS-SRV for HA with two kept in sync Asterisk PBXs.
>
> What is the best way to setup OpenSIPS (all my DIDs go to my OpenSIPS
> server) to deal with both of my Asterisk servers. OpenSIPS seems to handle
> DNS-SRV, but what is the recommended configuration for my simple topology.
>
> [Vitelity/Bandwidth/Etc.]---[openSIPS as sip switch]---|---[Asterisk0]
>
> |---[Asterisk1]
>
> --
> 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-tp6979044p6979044.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

osiris123d
I've implemented Dispatcher with an Active/Standby Asterisk solution and also using a special failure route(Like Ovidiu stated) and also editing "fr_inv_timer" and "fr_timer" for timeouts.

On , Ovidiu Sas <[hidden email]> wrote:

> You can simply forward all your calls to the active asterisk server
>
> with a failover route to the hot spare.
>
> If a failover occurred, mark your old hot spare as active and your old
>
> active as spare (this will route future calls to your new active
>
> asterisk server).
>
>
>
> Another option would be to keep both asterisk servers active, and load
>
> balance between them (with a failure route to the other one, in case
>
> one is down)
>
>
>
> Regards,
>
> Ovidiu Sas
>
>
>
>
>
> On Wed, Nov 9, 2011 at 1:49 PM, gwallis [hidden email]> wrote:
>
> > I have my phones using DNS-SRV for HA with two kept in sync Asterisk PBXs.
>
> >
>
> > What is the best way to setup OpenSIPS (all my DIDs go to my OpenSIPS
>
> > server) to deal with both of my Asterisk servers. OpenSIPS seems to handle
>
> > DNS-SRV, but what is the recommended configuration for my simple topology.
>
> >
>
> > [Vitelity/Bandwidth/Etc.]---[openSIPS as sip switch]---|---[Asterisk0]
>
> >
>
> > |---[Asterisk1]
>
> >
>
> > --
>
> > 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-tp6979044p6979044.html
>
> > Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> >
>
> > _______________________________________________
>
> > Users mailing list
>
> > [hidden email]
>
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> >
>
>
>
> _______________________________________________
>
> Users mailing list
>
> [hidden email]
>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

gwallis
Thanks guys! That was very quick, much appreciated. I will go over your suggestions asap.
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

gwallis
In reply to this post by Ovidiu Sas
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)
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

osiris123d
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 <[hidden email]> 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
>
> [hidden email]
>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

Ovidiu Sas
In reply to this post by gwallis
I suggest start reading the opensips documentation page:
http://www.opensips.org/Resources/Documentation
The routes are described here.:
http://www.opensips.org/Resources/DocsCoreRoutes17

Check the default opensips config file, try to understand it and then
you will be able to build and debug your own configs.

Regards,
Ovidiu Sas


On Wed, Nov 9, 2011 at 3:51 PM, gwallis <[hidden email]> 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
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

gwallis
Thanks Ovidiu!
Reply | Threaded
Open this post in threaded view
|

Re: best way to use one active one hot spare asterisk server behind OpenSIPS

gwallis
In reply to this post by osiris123d
Excellent I will setup my own lab OpenSIPS and dig into the programming seems like a worthwhile endeavor. Thanks!