High Availability (HA) for Asterisk with Failover Between Two Servers

Description:

I have set up a high-availability (HA) configuration with Asterisk, where Server 1 (Primary) and Server 2 (Backup) are configured to handle SIP traffic. I am using a shared virtual IP (VIP) for both servers, and I would like to ensure seamless failover between them for ongoing calls.

Scenario:

  • Primary Server (Asterisk 1): Handles SIP INVITE requests, receives calls.
  • Backup Server (Asterisk 2): Remains idle but is ready to take over in case the primary server fails.

The goal is to ensure that:

  • Initial Call Setup: A softphone sends a SIP INVITE to the virtual IP (VIP) 10.1.1.112. The SIP INVITE is routed to Server 1 (Asterisk 1), which processes the call.
  • Failure Handling: If Server 1 (Asterisk 1) crashes or is shut down unexpectedly, Server 2 (Asterisk 2) takes over the VIP 10.1.1.112 and continues processing the call.

Current Setup:

  • Server 1 (Primary): IP 10.1.1.111
  • Server 2 (Backup): IP 10.1.1.110
  • Shared VIP: 10.1.1.112 for SIP traffic.

Question:

How can I configure Asterisk to allow Server 2 to take over ongoing calls when Server 1 fails, and maintain call state such as active channels and call progress? What settings are needed for smooth failover, and how can I handle SIP signaling and media in this setup?


Thank you in advance for your help! I look forward to your suggestions and insights.

Asterisk doesn’t support live call fail over.

What you are looking for is called UCARP which provide failover

Le 02/04/2025 à 12:38, zzoah via Asterisk Community a écrit :

[zzoah] zzoah https://community.asterisk.org/u/zzoah
April 2

Description:

I have set up a high-availability (HA) configuration with Asterisk,
where Server 1 (Primary) and Server 2 (Backup) are configured to
handle SIP traffic. I am using a shared virtual IP (VIP) for both
servers, and I would like to ensure seamless failover between them for
ongoing calls.

Scenario:

  • Primary Server (Asterisk 1): Handles SIP INVITE requests,
    receives calls.
  • Backup Server (Asterisk 2): Remains idle but is ready to take
    over in case the primary server fails.

The goal is to ensure that:

  • Initial Call Setup: A softphone sends a SIP INVITE to the
    virtual IP (VIP) 10.1.1.112. The SIP INVITE is routed to Server 1
    (Asterisk 1), which processes the call.
  • Failure Handling: If Server 1 (Asterisk 1) crashes or is shut
    down unexpectedly, Server 2 (Asterisk 2) takes over the VIP
    10.1.1.112 and continues processing the call.

Current Setup:

  • Server 1 (Primary): IP 10.1.1.111
  • Server 2 (Backup): IP 10.1.1.110
  • Shared VIP: 10.1.1.112 for SIP traffic.

Question:

How can I configure Asterisk to allow Server 2 to take over ongoing
calls when Server 1 fails, and maintain call state such as active
channels and call progress? What settings are needed for smooth
failover, and how can I handle SIP signaling and media in this setup?


Thank you in advance for your help! I look forward to your
suggestions and insights.


Visit Topic
https://community.asterisk.org/t/high-availability-ha-for-asterisk-with-failover-between-two-servers/107698/1
or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here
<>.


Daniel

Could Kamailio help manage this issue when acting as a proxy? Specifically, can Kamailio handle ongoing calls by maintaining the SIP signaling and seamlessly redirecting traffic to the backup server (Server 2) when Server 1 encounters a failure?

1 Like

If your intention is to continue using Asterisk in that scenario and have active calls continue in it, then no. It would not. Existing calls would drop, new calls would work.

Yes, I meant for new calls.

Le 02/04/2025 à 12:56, jcolp via Asterisk Community a écrit :

[jcolp] jcolp https://community.asterisk.org/u/jcolp Asterisk
Project Lead
April 2

If your intention is to continue using Asterisk in that scenario and
have active calls continue in it, then no. It would not. Existing
calls would drop, new calls would work.


Visit Topic
https://community.asterisk.org/t/high-availability-ha-for-asterisk-with-failover-between-two-servers/107698/5
or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here
<>.


Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.