When publishing a PBX on a public IP address, the task arises to protect the speaker from scanners, pests who are trying to pick up passwords to SIP PBX accounts. If a simple numeric password is set, it will be picked up very quickly, which will cause losses.
For basic protection against scanners, fail2ban must be enabled. Additionally, you can fine-tune the iptables rules.
Go to the "System file customization" section
Go to edit the /etc/firewall_additional file
Set the "Add to end of file" mode, insert the following code:
The added rule allows blocking all incoming requests over the UDP protocol that contain the substring "friendly-scanner"
A more complete example of a set of rules:
This will protect you from most scanners that I mention User-Agent when requesting.
PT1C_cdr is the table containing the call history from the telephony panel version 1 in FreePBX.
Let’s navigate to the FreePBX working directory.
Download the script to convert the MySQL table to SQLite3. If it’s not available, make sure to download it.
Run the conversion script:
The archive with the scripts is available via the provided link.
The file master.db, obtained in the previous step, must be transferred to MikoPBX in the directory: /storage/usbdisk1/mikopbx/freepbx-dmp.
Navigate to the MikoPBX working directory:
Prepare the list of files for uploading, specifying the date as "2020-02-07".
Uploading call recordings and converting them to MP3.
Perform a backup of the call history database.
Copy the call history database to the current directory.
Convert the call history to the MikoPBX format. The history in cdr.db will be CLEARED.
Clear the empty recordingfile fields in the database.
There are no call recordings before "2020-02-07". Let’s clear the recordingfile field.
After moving the database file.
Done! You can now check the call history in the web interface.
WARNING: All data on the disks will be erased.
Prepare a PC with two disks of the same size.
Boot the machine in LiveCD or LiveUSB mode.
Connect to the machine via SSH.
Run the following command in the console to display disk names:
The disk names will be displayed. In this example, the disk names are:
Clear the superblocks on the disks:
Clean the old metadata:
Create the RAID1 array:
When prompted with "Continue creating array?", confirm by entering "y".
You can now proceed with the installation as per the installation guide. When selecting the disk during installation, choose md0
.
TODO: You may need to modify the grub.cfg
file. Otherwise, there is no guarantee that the system will boot if one of the disks fails.
Perform a Backup of your current MikoPBX following this guide.
Install MikoPBX on the new server. Follow the steps in this guide.
Upload the previously created MikoPBX backup to the new server following this guide.
If the data size is large, it's practical to save the backup directly on the target machine. Here's the process:
Install MikoPBX on the new machine.
On the original MikoPBX, set up Scheduled Backups.
Ensure the connection is via SFTP.
Username and password should be those used for SSH connection.
Set the Path on the server to "/storage/usbdisk1/mikopbx/backup/".
Wait for the backup to complete.
Shut down the original machine.
On the target machine, perform a Restore from Backup.
Manual data migration script.
Go to "General Settings" -> "Delete all system settings"
In the input field, paste the text "delete everything", click "Save settings"
Open the MikoPBX console menu. Use the keyboard to enter 9 to go to the PBX console.
Enter two commands sequentially:
After executing these commands, MikoPBX will reboot. The login to the web interface takes place with the login (admin) and password (admin) by default.