2. Set up Mirroring at PBX bundled SIP Servers
Using the mirroring function of Brekeke PBX, the register information at the primary server of Brekeke PBX will be mirrored on the secondary server.
Note:
- From version 3.9.1.0 of Brekeke PBX, the mirroring function is enhanced significantly. Now, the basic heartbeat and switching over feature are included in the mirroring function. With this update, no additional settings at [Heartbeat] page are required when settings explained on this page is applied.
- To continue using the same interface address after failover occurs, make sure to set the same interface address at the secondary server of Brekeke PBX. The interface address of the primary server can be found at: [Brekeke PBX admintool (primary server)]>[SIP Server]>[Configuration]>[System]>[Network]->[Interface address].
- Set port forwarding to the SERVICE_IP_ADDRESS at the router which both Brekeke PBX are behind.
- Redundancy function uses some OS commands for managing Service IP address and Default Gateway IP address. Before you setup redundancy function, please make sure these OS commands are installed properly.
No mirroring settings are required when shared third party database set at the bundled SIP server (Brekeke PBX bundled SIP server > [Database]) of both primary and secondary servers.
Mirroring settings at the bundled SIP server of both primary and secondary server of Brekeke PBX
1. Set the following at [SYSTEM]>[Redundancy]>[Mirroring]:
Mirroring Settings On/Off: on *1 Role: "primary" or "secondary" according to the machine role Mirroring Request Pattern: ^REGISTER *2 Service IP Address: SERVICE_IP_ADDRESS Subnet Mask : set service network's subnet mask Gateway IP address : set service network's default gateway address *3 Interface Name : select the interface that Service IP address is attached. Add/Remove when started On/Off: on (If on, Brekeke SIP Server adds/removes the service IP to/from the interface when the BSS starts.) Add/Remove when failed On/Off: on (If on, Brekeke SIP Server adds/removes the service IP to/from the interface when the BSS is failed.) Ping before switching the route On/Off: on Peer IP Address: the other sever IP in the same IP range. On primary server set SECONDARY_ IP_ADDRESS. On secondary server, set PRIMARY_IP_ADDRESS. Heartbeat On/Off: On
*1. Mirroring function uses the SIP port with TCP (Default is TCP:5060). The connection between the primary server and the secondary server with this port needs to be allowed by a firewall.
*2. The setting of [Mirroring Request Pattern] cannot be changed. Only REGISTER SIP requests on the primary server can be mirrored on the bundled SIP server of the secondary server. This will make both primary and secondary server have the same registered clients.
*3. Setting the default gateway with the vale of the [Gateway IP address] field is available when Linux is used as server OS. For details, refer to the “Replace default gateway” section.
Example:
PRIMARY_IP_ADDRESS: 192.168.200.10 /255.255.255.0 and 172.16.0.10 / 255.255.0.0 SECONDARY_IP_ADDRESS: 192.168.200.20 / 255.255.255.0 SERVICE_IP_ADDRESS: primary IP, 172.16.0.10 / 255.255.0.0 Gateway IP address: 172.16.0.1/255.255.0.0
Set the following at primary server [SYSTEM]>[Redundancy]>[Mirroring]:
On/Off: on Role: primary Mirroring Request Pattern: ^REGISTER Service IP Address: 172.16.0.10 (SERVICE_IP_ADDRESS) Subnet Mask : 255.255.0.0 Gateway IP address: 172.16.0.1 Interface Name : eth1 (select the interface that Service IP address is attached.) Add/Remove when started On/Off: on Add/Remove when failed On/Off: on Ping before switching the route On/Off: on Peer IP Address: 192.168.200.20 (SECONDARY_IP_ADDRESS) Heartbeat On/Off: On
Set the following at secondary server [SYSTEM]>[Redundancy]>[Mirroring]:
On/Off: on Role: secondary Mirroring Request Pattern: ^REGISTER Service IP Address: 172.16.0.10 (SERVICE_IP_ADDRESS) Subnet Mask : 255.255.0.0 Gateway IP address: 172.16.0.1 Interface Name : eth1 (select the interface that Service IP address will be attached when taking over occurs.) Add/Remove when started On/Off: on Add/Remove when failed On/Off: on Ping before switching the route On/Off: on Peer IP Address: 192.168.200.10 (PRIMARY_IP_ADDRESS) Heartbeat On/Off: On
Press [Save and Update] button
2. Add the following dial plan rule on the secondary SIP server, and click [Apply Rules] button. *4
Rule: reject non-mirroring REGISTER
[Matching Patterns] $mirroring = false $primary = false $request = ^REGISTER [Deploy Patterns] $action = 200
*4. In Brekeke PBX version 3.8.x or later, if the default dial plan “$pbx.register” has already been used at the Deploy pattern, the above dial plan rule “reject non-mirroring REGISTER” is NOT needed.
3. If authentication for REGISTER is used, set the same realm at both bundled SIP servers
[SIP Server]>[Configuration]>[SIP]>[Authentication]>[Realm(ex. domain name)]
4. Restart primary server machine
5. Restart secondary server machine
Now, you should be able to confirm:
Primary Brekeke PBX [SYSTEM] > [Redundancy] > [Mirroring] >[Status]
[role]: Primary(1) [designated]: Primary(1) [service-address]:172.16.0.10 (assigned)
Secondary Brekeke PBX [SYSTEM] > [Redundancy] > [Mirroring] >[Status]
[role]: Secondary(2) [designated]: Secondary(2) [service-address]:172.16.0.10 (not assigned)
Test mirroring:
- Register UAs to service IP address or router’s global IP address, the registration record should appear on both primary and secondary servers.
- Delete any registered client record from the primary server, the change also should be updated on the secondary server.
- When there is a call, the session should only appear on the primary server. This is because [Mirroring Request Pattern] is only for REGISTER. No session is kept on the secondary server.