How to connect an external drive (NAS or Storage Server) in VitalPBX to store the recordings?
There are several ways to add more disk capacity to our VitalPBX server, next we will show how to create and connect a remote storage unit.
Scenery
We have two servers:
-
VitalPBX Server
-
Storage Server
Server installation
Let’s assume that our Storage Server also has Debian 11
Next, we are going to prepare our storage server, for which we install the following software.
apt install nfs-kernel-serverWe create a folder, which we are going to share with the VitalPBX Server
mkdir -p /nfs/recondingsIf we want all clients to have access to the directory, the permission restrictions must be removed:
chown nobody:nogroup /nfs/recordings/chmod 777 /nfs/recordings/Now it is necessary to grant access permissions to the machine that serves as the server, for this we must modify the /etc/exports file
nano /etc/exportsAt the end of the file we will add the access instruction for a client:
/nfs/recordings VPBX_IP(rw,sync,no_subtree_check)Apply the changes and restart the service:
exportfs -asystemctl restart nfs-kernel-serverIn the event that the server’s firewall is configured, it will be necessary to allow access to the clients:
ufw allow from VPBX_IP to any port nfsClient Installation
On the client (VitalPBX Server) we will install nfs-common:
apt install nfs-commonCreate the directory where the server shared folder will be mounted:
mkdir –p /nfs/recordings/Later we move all the contents of the folder /var/spool/asterisk/monitor to /nfs/recordings/
mv /var/spool/asterisk/monitor/ /nfs/recordings/Since we no longer have the monitor folder where VitalPBX saved the recordings, we proceed to create a virtual link.
cd /var/spool/asterisk/ln -s /nfs/recordings/ monitorNow we change the permissions so that Asterisk is happy.
chown -R asterisk:asterisk monitorNext we are going to mount the shared directory:
mount STORAGE_IP:/nfs/recordings /nfs/recordingsPermanently mount the shared directory:
nano /etc/fstabSTORAGE_IP:/nfs/recordings /nfs/recordings nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0Was this article helpful?
Your feedback helps us improve the documentation.
Thank you for helping us improve!
