Skip to content

Files location

The Files Location settings tell the recorder where to write captured audio files and how to name them. The file name format is a parameterized template — with it you control the whole directory layout: group files by date, by tenant-relevant attributes, by IP address, and so on.

Where: Administration › Storage › Files Location. The page shows:

  • Audio files directory — the root directory for recorded audio, with a free-space gauge for the disk it lives on.
  • Audio file name format — the parameterized file name template (reference below). Default: %{setup-time#%Y%m%d}/%{setup-time#%Y%m%d%H%M%S}-%{caller-number}-%{callee-number}-%{call-id}.mp3
  • File creation mode — Unix file permissions for the recorded files (Linux only), 000666, default 664.

Click Edit Configuration to change them. The settings are stored as base recorder settings shared by all recorders; per-recorder overrides are possible under Recorder servers.

File name format reference

The template mixes literal text with parameters:

%{parameter-name}
%{parameter-name#format-string}

Parameters inside a directory segment create directories (auto-created as needed). If two calls produce the same file name, a unique numeric suffix is appended (file_2.mp3, file_3.mp3, …).

Example — one sub-directory per day, one file per call:

%{setup-time#%Y%m%d}/%{setup-time#%Y-%m-%d-%H%M%S}.mp3

Call parameters

Parameter Description
%{call-id} Unique call ID assigned by MiaRec
%{parent-call-id} ID of the parent call segment (for example, the pre-hold segment on platforms that split held calls)
%{protocol-call-id} Call ID assigned by the phone system (for SIP, the Call-ID header)
%{protocol-tracking-id} Interaction/tracking ID assigned by the phone system (Avaya UCID, BroadWorks extTrackingID)
%{protocol-call-direction} Call direction reported by the phone system: 0 unknown, 1 outbound, 2 inbound
%{call-state} / %{record-state} Numeric call phase / recording state codes
%{voip-protocol} Numeric code of the capture protocol (SIP, SIPREC, Cisco Built-in-Bridge, …)
%{setup-time} Time the call was established (accepts a #format — see time codes below)
%{alerting-time} / %{connect-time} / %{disconnect-time} Ring / answer / hang-up times (accept #format)
%{duration} / %{total-duration} Voice duration (connect→disconnect) / total duration (setup→disconnect), seconds
%{caller-number} / %{callee-number} Phone numbers of the parties
%{caller-name} / %{callee-name} Party names (protocol-dependent; for SIP, from the From/To headers)
%{caller-id} / %{callee-id} Party IDs (protocol-dependent; for SIP, the SIP URI)
%{caller-ip} / %{callee-ip}, %{caller-port} / %{callee-port}, %{caller-mac} / %{callee-mac} IP address, port, and MAC address of the parties
%{orig-caller-number} / %{orig-caller-name} / %{orig-callee-number} / %{orig-callee-name} Original caller / originally dialed party, when different after redirects

Platform-specific parameters

Parameter Description
%{sip-header-invite#Header-Name} Value of a SIP header from the INVITE, e.g. %{sip-header-invite#User-Agent} (initial file creation only)
%{BroadWorks-userID} / %{BroadWorks-groupID} / %{BroadWorks-serviceProviderID} BroadWorks user / group / service provider IDs
%{MetaSwitch-recorderParty} / %{MetaSwitch-userName} / %{MetaSwitch-businessGroup} / %{MetaSwitch-systemName} Metaswitch CFS attributes
%{agent-id} / %{agent-name} Avaya agent ID / name
%{acd-number} / %{acd-name} / %{acd-id} ACD attributes (BroadWorks and Avaya environments)
%{transfer-from-*} / %{transfer-to-*} (number/name/id) Transfer parties (Cisco Skinny protocol only)

Post-processing-only parameters

These are resolved only by post-processing jobs (export, relocate, replication) — they are not available to the recorder when the file is first created, because the user/tenant association happens after capture:

Parameter Description
%{user-id} / %{user-name} User the recording is assigned to (first user for internal calls)
%{group-id} / %{group-name} The user's group (first group)
%{tenant-id} / %{tenant-name} Tenant the recording is assigned to

Conversely, %{filename}, %{filename-full}, %{filename-dir}, and %{sip-header-invite#…} are available only at initial file creation, not to post-processing jobs.

Time format codes

Date/time parameters accept a format string after #, e.g. %{setup-time#%Y-%m}2011-02:

Code Meaning Code Meaning
%Y / %y Year with / without century %H / %I Hour, 24-hour / 12-hour
%m Month number (01–12) %M Minute (00–59)
%b / %B Abbreviated / full month name %S Second (00–59)
%d Day of month (01–31) %u Microseconds
%j Day of year (001–366) %p A.M./P.M. indicator
%a / %A Abbreviated / full weekday name %U / %W Week of year (Sunday / Monday first)
%w Weekday number (0–6, Sunday = 0) %% Literal percent sign

File path rewrite rules

Administration › Storage › File Path Rewrite Rules maintains prefix-rewrite rules applied whenever the platform opens a stored file: if a file's stored URL starts with a rule's Original File Path, that prefix is replaced with the Rewrite To value. Use rewrite rules when recordings were moved outside MiaRec — a changed mount point, a renamed directory, a migrated server — so existing database records still resolve to the files' new location, without touching the database.

To physically move files (and update their records), use the relocate job instead — see File maintenance jobs.