Difference between revisions of "Howto use SIP Failover (2.X)"

From berofix - professional SIP gateway
Jump to: navigation, search
(How to use Timeouts for failover)
Line 59: Line 59:
  
 
for example:
 
for example:
T0:5;T200:60
+
response_timer = T0:5;T200:60
  
 
When the timers run out and the corresponding SIP Status has not been received an internal ISGW error code is generated. The Error Code map looks like:  
 
When the timers run out and the corresponding SIP Status has not been received an internal ISGW error code is generated. The Error Code map looks like:  

Revision as of 15:09, 5 March 2015

Introduction

In the 2.X FW we have added SIP Failover Support in the Config String "more". This feature allows to provide a backup SIP Peer which is used in case the primary SIP Peer will not be reachable or will return a Server Error (503) for invites that we send to it.

So the SIP Failover peer, needs to be defined as seperate SIP Entry. And can be specified in the config string of the primary SIP Peer or even in the dialplan directly.

Step-by-Step tutorial

Initially you have one SIP Server that might fail:

Sip-failover-1.png

Now you add a backup SIP Server that should be used in case that SIP-Server failed. We name it SIP-Failover-Server: 

Sip-failover-2.png

Next Step is to edit the main SIP-Server Account Settings and go to "more" and then define the SIP-Failover-Server as  
the "Failover-Account" via the Dropdown. Also specify the Failover-Timeout after which the failed call should be re-
routed to the SIP-Failover-Server.

Sip-failover-3.png


Implementing ISDN Fallback with SIP Failover

The berofix itself can be specified as SIP Failover Peer. So if you need an ISDN Fallback in case a SIP Peer is unreachable or responds Server Errors you need to do the following steps:

1.) Add a "fallback" SIP Entry with the IP Address of berofix itself

Sip-failover-4.png

2.) modify the primary SIP Peer and configure the failover_proxy=fallback, also add a failover_prefix=fallback (in "more")

Sip-failover-5.png

3.) create a SIP-ISDN Dialplan Entry with the Settings:
    FromID = .* (or local IP Address of berofix)
    ToID = ISDN-FALLBACK-GROUP
    Destination = fallback(.*)
    NewDestination = \1

Sip-failover-6.png

The Dialplan Entry should have a higher priority then the primary SIP Peer Entries.

How to use Timeouts for failover

beroFix has a number of Timers that can be started when a SIP Invite is sent out. You can define the Timers:

T0     - has any SIP Response arrived (including a Status 100)
T183   - has a SIP 183 Status arrived 
T180   - has a SIP 180 Status arrived 
T200   - has a SIP 200 Status arrived

The timer is defined in the config string (advanced Settings). The syntax is:

TXXX:${time in seconds};TYYY:${time in seconds}

for example: response_timer = T0:5;T200:60

When the timers run out and the corresponding SIP Status has not been received an internal ISGW error code is generated. The Error Code map looks like:

T0    - ISGW Error 9000
T183  - ISGW Error 9183
T180  - ISGW Error 9180
T200  - ISGW Error 9200

These Error codes can either be used to drop the call (the ISDN Release cause can be defined in the causes map), or to do a failover to another SIP Account. For the failover case you need to define the ISGW Errors in the failover_causes advanced settings string:

failover_causes=503:9000:9200