VICIfast
Operations

How to set how long you keep recordings

VICIdial does not auto-expire recordings. Learn how to set a retention policy using cron scripts, archive tiers, and database cleanup to stay compliant without filling your disk.

VICIfast Support
··3 min read
How to set how long you keep recordings

VICIdial stores every Call recording as a flat file on the server's local filesystem. The system does not automatically delete or expire those files. Left unmanaged, the recording directory fills up and new recordings silently fail to write. Setting a clear Recording retention policy before that happens is one of the simplest things you can do to keep a Campaign running without surprises.

What VICIdial actually stores

Each recording lands in the server's recording directory (typically /var/spool/asterisk/monitor/) as a WAV or GSM file depending on the Campaign Rec extension you chose (8309 for WAV, 8310 for GSM). The filename is built from the Campaign Rec Filename template — for example FULLDATE_AGENT produces something like 20240315-141022_6666. Alongside the file, VICIdial writes a row to the vicidial_recordings table that holds the filename, duration, agent, lead ID, and Asterisk uniqueid. The database row and the file must stay in sync — if you delete one without the other, the Recordings search in Admin will show dead links.

Choosing a retention period

The right window depends on your regulatory environment. Most contact centers in regulated industries keep recordings between 30 days and seven years. A practical starting point is 90 days on local disk, then move to cold storage for whatever longer obligation applies. What matters most is writing the policy down and automating it — manual purges get skipped.

  • 30 days — minimum for most quality-assurance review cycles
  • 90 days — common for sales compliance and dispute resolution
  • 1–7 years — required by GDPR, HIPAA, or financial services rules depending on region

The two-tier approach: hot disk plus cold archive

Local disk (hot tier) is fast to search but expensive. Object storage or a NAS archive (cold tier) is cheap but slower to retrieve. The standard VICIdial pattern is to offload recordings older than N days via a cron script that rsync-copies files to the archive, then deletes the originals from local disk. The database rows stay intact so the Admin Recordings search still shows the entry — you just need a retrieval step to pull the file back when someone clicks play.

**Heads up:** Deleting the local file without updating the vicidial_recordings row leaves broken play links in the UI. Your archival script should either update a custom location field or leave the row intact and handle retrieval at the application layer.

Automating the purge with cron

A basic retention cron entry runs nightly and deletes files older than your hot-tier window. The Asterisk spool directory is the right place to target. A sample pattern: find all .wav and .gsm files under /var/spool/asterisk/monitor/ that are older than 90 days and remove them. Pair that with a matching MySQL DELETE on vicidial_recordings for rows whose recording_date is older than the same window.

flowchart TD
  A[Recording written to disk] --> B[Hot tier: local disk]
  B --> C{Age check nightly cron}
  C -->|Under 90 days| B
  C -->|Over 90 days| D[rsync to cold archive]
  D --> E[Delete local file]
  E --> F[Row kept in vicidial_recordings]
  C -->|Over retention limit| G[Delete archive file and DB row]

Database-side cleanup

Once files are permanently gone, prune the matching rows. A simple DELETE FROM vicidial_recordings WHERE recording_date < DATE_SUB(NOW(), INTERVAL 90 DAY) run after the file purge keeps the table lean. On large centers the recordings table can grow to millions of rows; monthly pruning keeps queries fast.

Stereo recordings count double

If your campaigns use Stereo recording (the Stereo Call Recordings campaign setting set to BOTH_CHANNELS or CUSTOMER_ONLY), each call produces two files — the standard recording and the stereo file named with the Stereo Rec Filename template (default S_FULLDATE_CUSTPHONE). Make sure your retention cron targets both filename patterns, or the stereo files will accumulate unnoticed.

For full recording setup background, read our VICIdial call recording explained guide. For disk sizing before you set your retention window, see VICIdial recording disk management. Ready to run a managed system where retention offloads are handled for you? See VICIfast pricing.

About VICIfast LLC

VICIfast LLC operates a managed VICIdial hosting + BYOI service for outbound and inbound call centers. We run the dialers, the carriers, the recordings pipeline, and the compliance plumbing so operators don’t have to.

Citing this article

VICIfast Engineering. “How to set how long you keep recordings”. VICIfast LLC, June 24, 2026. Retrieved from https://vicifast.com/blog/how-to-set-recording-retention-vicidial

Have questions?

Related posts

You might be interested in

VICIfast newsletter

Liked this? Get the next one in your inbox.

We ship the kind of stuff you just read — concrete, numbers-first, no drip. One email when a new post goes live. Unsubscribe in one click.

Comments

Comments are reviewed before they appear. We never publish your email.

No comments yet — be the first.