14.12.0 14.11.0 14.10.0 14.9.0 14.8.0 14.7 14.6 14.5 14.4 14.3
14.12.0 14.11.0 14.10.0 14.9.0 14.8.0 14.7 14.6 14.5 14.4 14.3

Archival Process Configuration for EFCX

Overview:

The Voice Recording Solution (VRS) includes an archival process designed to manage and maintain the storage of call recordings. The process archives recordings based on a configurable retention period and transfers them to SFTP or, from VRS 14.12.0, an S3-compatible destination (S3 / MinIO / Wasabi) for long-term storage. This ensures optimal use of storage resources and helps in compliance with data retention policies.

  • Archival Process Workflow

  1. Retention Period Configuration:

The environment variable NO_OF_DAYS specifies the retention period in days.

Recordings older than the specified number of days are marked for archival.

  • Archiving Recordings:

The recordings are moved from the primary storage directory to the configured archive destination (SFTP or S3-compatible cloud).

The archival service runs periodically to ensure all eligible recordings are archived.

  • Directory in the SFTP Server.
    The Directory where the recording will be save is VRSArchivedFiles. Make sure the directory name is the same as VRSArchivedFiles.
    To create a directory, run the following commands

mkdir -p /VRSArchivedFiles
chmod 777 /VRSArchivedFiles

  • Database Updates:

After archiving, the database table (v_xml_cdr) is updated: is_archived is set to 1, and from 14.12.0 the service also stamps archive_storage and archive_path so playback knows which store holds the file.

Automatic Service Activation:

If the archival service is added in the VRS deployment docker compose file, it automatically performs its tasks as per the schedule or configuration.

Dual archival schema on fusionpbx (14.12.0+)

EFCX only. Cisco dual archival columns ship in the recording-solution skeleton (data/scripts/postgres.sql / sqlserver.sql on database vrs). EFCX does not use those scripts for archival schema — operators must run the following on the Media Server database fusionpbx.

During a new deploy, run this step in the Installation Guide (EFCX-gated step before install-efcx.sh). For upgrades from 14.11.0, see VRS Upgrade Guide from 14.11.0 to 14.12.0.

  1. On the Media Server, note the database password:

cat /etc/fusionpbx/config.conf | grep database.0.password

  1. Connect to fusionpbx (enter the password when prompted; use your DB host if it is not local):

psql -h 127.0.0.1 -p 5432 -U fusionpbx -d fusionpbx

  1. Run the following query in the database:

SQL
-- EFCX / fusionpbx — dual archival settings + CDR stamps

ALTER TABLE archival_setting
  ADD COLUMN IF NOT EXISTS storage_type VARCHAR(20) NOT NULL DEFAULT 'sftp';

ALTER TABLE archival_setting
  ADD COLUMN IF NOT EXISTS sftp_server_ip   VARCHAR(255),
  ADD COLUMN IF NOT EXISTS sftp_username    VARCHAR(255),
  ADD COLUMN IF NOT EXISTS sftp_password    VARCHAR(255),
  ADD COLUMN IF NOT EXISTS sftp_folder_path VARCHAR(512),
  ADD COLUMN IF NOT EXISTS s3_endpoint      VARCHAR(255),
  ADD COLUMN IF NOT EXISTS s3_access_key    VARCHAR(255),
  ADD COLUMN IF NOT EXISTS s3_secret_key    VARCHAR(255),
  ADD COLUMN IF NOT EXISTS s3_folder_path   VARCHAR(512);

UPDATE archival_setting
SET
  sftp_server_ip   = CASE WHEN COALESCE(storage_type, 'sftp') NOT IN ('s3','minio','wasabi')
                          THEN external_server_ip ELSE sftp_server_ip END,
  sftp_username    = CASE WHEN COALESCE(storage_type, 'sftp') NOT IN ('s3','minio','wasabi')
                          THEN username ELSE sftp_username END,
  sftp_password    = CASE WHEN COALESCE(storage_type, 'sftp') NOT IN ('s3','minio','wasabi')
                          THEN password ELSE sftp_password END,
  sftp_folder_path = CASE WHEN COALESCE(storage_type, 'sftp') NOT IN ('s3','minio','wasabi')
                          THEN folder_path ELSE sftp_folder_path END,
  s3_endpoint      = CASE WHEN COALESCE(storage_type, 'sftp') IN ('s3','minio','wasabi')
                          THEN external_server_ip ELSE s3_endpoint END,
  s3_access_key    = CASE WHEN COALESCE(storage_type, 'sftp') IN ('s3','minio','wasabi')
                          THEN username ELSE s3_access_key END,
  s3_secret_key    = CASE WHEN COALESCE(storage_type, 'sftp') IN ('s3','minio','wasabi')
                          THEN password ELSE s3_secret_key END,
  s3_folder_path   = CASE WHEN COALESCE(storage_type, 'sftp') IN ('s3','minio','wasabi')
                          THEN folder_path ELSE s3_folder_path END
WHERE sftp_server_ip IS NULL
   OR sftp_folder_path IS NULL
   OR (storage_type IN ('s3','minio','wasabi') AND s3_endpoint IS NULL);

ALTER TABLE v_xml_cdr
  ADD COLUMN IF NOT EXISTS archive_storage VARCHAR(16) NULL;

ALTER TABLE v_xml_cdr
  ADD COLUMN IF NOT EXISTS archive_path VARCHAR NULL;

Environment Variables

The archival process relies on several environment variables for configuration. These variables are defined in the Docker Compose file and loaded from the specified environment file.

General Variables

ENV

Name

NO_OF_DAYS

Number of days to retain recordings before archiving them. 30

DEPLOYMENT_PROFILE

Deployment profile to distinguish between environments e.g, EFCX

Database Configuration

DB_DRIVER

JDBC driver class for database connectivity (org.postgresql.Driver)

DB_ENGINE

Database engine used by the application. postgres

DB_HOST

Hostname or IP address of the database server. 192.168.1.173

DB_NAME

Name of the database storing call records. fusionpbx

DB_USER

Database user with read/write permissions. fusionpbx

DB_PASSWORD

Password for the database user. (from /etc/fusionpbx/config.conf)

  • Archival Service Configuration in Docker Compose

Below is the Docker Compose configuration snippet for the archival process:

archival-process:
   container_name: archival-process
   image: gitlab.expertflow.com:9242/voice-recording-solution/archival-process:TAG
   volumes:
     - /var/lib/freeswitch/recordings:/var/lib/freeswitch/recordings
   env_file:
     - ${PWD}/docker/config.env
   restart: always