24 April 2012
by: Khaled Tewfik
If you are building a redundant setup for call handling using two or more SIP end-points, such as IP-PBXs or IP Fax Servers, you will want to consider ways to either load balance traffic between the end-points or have them work in an active/passive mode where one takes over if another fails.
It is not necessary to use the same redundancy mode for handling incoming traffic as outgoing traffic. For example, you may want incoming traffic to be load balanced between two end points but use an active/passive mode for outgoing traffic, where outcalls are done though the active end-point but switch to the other if that one fails to service the request.
To implement an inbound load balancing solution with disjoint end-points you need a load balancing strategy that eliminates the possibility of a race condition, where two end-points could end up answering the same call, while ensuring traffic is handled by the first available end point. Fortunately SIP provides a very simple solution to this problem by making it possible for more than one end-point to register to receive calls on the same SIP account. With such a setup two end-points register with the SIP Trunk service provider indicating that they are both ready to receive calls. When an incoming call arrives the service provider will generate an INVITE to both registered end-points. The service provider gives the call to the first end-point that accepts the INVITE and sends a CANCEL message to the other end-point.
To implement an inbound active/passive redundancy solution you can either make use of the registration mechanism, where only the active end-point registers to receive calls and if it fails the passive one takes over, or use a call forwarding scheme, where each end-point registers for its own SIP account and have the account associated with the primary end-point call forward to the account associated with the passive end point on no-answer or if the primary fails to register. The first approach, where only the active end-point registers, requires that the passive device incorporates some sort of watchdog that detects when the active has stopped working and automatically switches roles so the active takes over the passive role and registers. If your end-point device does not support this watchdog functionality, then you can use the second approach, where each end-point is assigned its own SIP account.
Redundancy for outbound traffic is also possible but how it is implemented depends heavily on the capabilities of your device and how you configure it. In all cases, the SIP Trunk service provider should allow you to make calls from any number of devices provided they are using the correct SIP credentials. The device need not register for incoming calls with the SIP service provider in order to be able to make out-calls.
As an example of a redundant outbound setup, two Fax Servers, where end-users submit their faxes by email, may both receive requests, using the DNS MX records to have each Fax Server act as an alternate to the other and to present fax traffic to them in a load balanced way. In this scenario whichever server receives an email-to-fax request will be able to call using the SIP account credentials it is configured with. If one server fails to accept an email the sender would automatically re-direct that email to the alternate by making use of the DNS MX records. If a server fails to process requests but is still able to accept emails then a watchdog that can detect this condition can be used to force it to no longer be able to accept emails.
The above example demonstrates that outbound redundancy is clearly supported at the SIP Trunking level and it is only a matter of determining how it can be accomplished with the particular device, application and setup used for a particular customer.