SIP Callgroups Failover and Load-Balancing (SBC)

This guide will show you how to use and configure SIP callgroups that can be used for failover-scenarios or load-balancing.

How does it work?

SIP-Peers that share the same callgroup name are put together in a callgroup.
If an INVITE fails with a status defined in failover_causes (configure failover_causes)
→ the next SIP-Peer from the callgroup with the highest priority is selected and a new INVITE is sent.

The configuration of the other SIP-Peer is applied when used as failover.

If the SIP-Peers have the callgroup priority set to the same value, the INVITE will go out to one of the SIP-Peers at random. This can be used for load-balancing and is also described in this document further down. (Load-Balancing)

Configure the SIP Callgroups

Configure SIP-Peers

In this example, I have configured 3 different SIP-Peers that go out to different local asterisk servers.

  • asterisk1 - IP: 172.20.30.240

  • asterisk2 - IP: 172.20.30.241

  • asterisk3 - IP: 172.20.30.242

If asterisk1 is unavailable, it should failover to asterisk2 and if asterisk2 is unavailable too, it should failover to asterisk3.

In your scenario, it might be different SIP-Providers or SIP-Servers.

asterisk1, asterisk2 and asterisk3 are configured under SIP

Configure Callgroup

Head to the More tab on each of your configured SIP-Peers and set the value of Callgroup to the same name. This will be the name of the callgroup.

In our test scenario I will name it “callgroup1”. You can create many different callgroups according to your needs.

Configure Callgroup Priority

Now set each of Callgroup Priority to a value from 1-100.

  • 1 has the highest priority and will be chosen first

  • 100 has the lowest priority and will be chosen last

If the SIP-Peers have the same callgroup priority, the call will go out to one of the SIP-Peers at random. (Load-Balancing)

callgroup is set to callgroup1 and priority to 100 and maximum calls to 3

Failover with Priority

In this example I want asterisk1 to have the highest priority and asterisk3 the lowest.
Therefore I apply the following settings:

  • asterisk1 - Callgroup Priority: 100

  • asterisk2 - Callgroup Priority: 90

  • asterisk3 - Callgroup Priority: 80

(optional) Configuring the failover_causes

You can edit and configure the SIP-Response codes, that will lead to a failover further down in the extra options. Like this:

  • failover_causes=408:503:909

The default failover causes are 408, 503 and 909, so you only have to set this option when adding or removing causes for the failover.

Definition of the extra option failover_causes

Option: failover_causes
Values: <colon separated causes>
Default: 408:503:909
colon separated list of sip reject causes, on which failover is used

  • 408 Request Timeout
    The server was not found in time or the server could not produce a response within the specified amount of time due to various reasons.

  • 503 Service Unavailable
    The server is undergoing maintenance is temporarily overloaded or cannot handle the request and is therefore unavailable.

  • 909 Failover Timeout occurred (ISGW)
    Internal beroNet call termination cause

A complete list of response-codes can be found here: Gateway ISDN Cause/SIP Response map

Load-balancing (Random)

If you want to balance your load over different servers, you can set the callgroup priority to the same value on every SIP-Peer. Now the INVITE will go out to one of the SIP-Peers at random.

  • asterisk1 - Callgroup Priority: 100

  • asterisk2 - Callgroup Priority: 100

  • asterisk3 - Callgroup Priority: 100

Configure the Dialplan

The Dialplan will look like normal, the callgroups will work in the background so configure your dialplan with the first SIP-Peer that should receive the initial INVITE.

 

 

 

 

If you need scheduled remote assistance, you can request our on-demand support services: https://www.beronet.com/support