Now, let’s take a look into additional configurations and processes you can do to troubleshoot your high-availability environment using DRBD.
Let’s look into a custom context that will allow us to monitor the current state of the high-availability environment from any registered extension.
First, we will create a new context using nano. Run the following command from the Primary Server.
root@debian:~# nano /etc/asterisk/vitalpbx/extensions__61-ha-test.conf
Add the following content.
[cos-all](+)
exten => *777,1,NoOp(Say Asterisk IP Address)
same => n,Answer()
same => n,Set(ASTERISK_IP=${SHELL(/usr/bin/hostname -I | awk -F " " '{print $1}')})
same => n,NoOp(IP Address: ${ASTERISK_IP})
same => n,SayDigits(${CUT(ASTERISK_IP,.,1)})
same => n,Playback(letters/dot)
same => n,SayDigits(${CUT(ASTERISK_IP,.,2)})
same => n,Playback(letters/dot)
same => n,SayDigits(${CUT(ASTERISK_IP,.,3)})
same => n,Playback(letters/dot)
same => n,SayDigits(${CUT(ASTERISK_IP,.,4)})
same => n,PlayBack(silence/1&vm-goodbye)
same => n,Hangup()
Instead of *777, you can use any other code of your liking that doesn’t interfere with your numbering plan.
For us to be able to use this context, we must restart the Asterisk Dial Plan. Run the following command from the Primary Server.
root@debian:~# asterisk -rx"dialplan reload”
To test the custom context, dial *777 or your code of choosing from any registered extension.
Note: as a Warning, if you must turn off the servers for any reason, when turning them back on always try to start with the Primary Server. Wait for the Primary Server to fully start, and then turn on the Secondary Server.
Let’s look into updating VitalPBX or any Add-On. The steps for updating VitalPBX or any add-on are as follows.
- Go to the Floating IP Address on your browser, and log in as the administrator.
- Update VitalPBX from the Web UI. Under the user menu in the upper right-hand corner, click on Check for Updates.
- Run the bascul command on the Primary Server. This will turn the Secondary Server into the Master.
- Go back to the Floating IP Address on your browser, and log in as the administrator.
- Update VitalPBX from the Web UI.
- Run the bascul command again to normalize the server cluster where the Primary Server is the Master.
With this, you will have updated both servers. Basically, you update the Primary Server first, then switch to the Secondary Server and update it next. Then, you normalize the cluster.