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: 

  1. VitalPBX Server 
  1. 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. 

We create a folder, which we are going to share with the VitalPBX Server 

mkdir -p /nfs/recondings 

If 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 

At 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: 

In 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 nfs 

Client Installation 

On the client (VitalPBX Server) we will install nfs-common: 

Create the directory where the server shared folder will be mounted: 

Later we move all the contents of the folder /var/spool/asterisk/monitor to /nfs/recordings/ 

Since we no longer have the monitor folder where VitalPBX saved the recordings, we proceed to create a virtual link. 

Now we change the permissions so that Asterisk is happy. 

Next we are going to mount the shared directory: 

Permanently mount the shared directory: 

What are your feelings
Updated on December 4, 2023