File name format

MiaRec supports flexible naming of audio files. It is possible to include date/time, ip-address, phone number and other call parameters into file name.

Example:

C:\Recordings\%{setup-time#%Y%m%d}\%{setup-time#%Y-%m-%d-%H%M%S}.mp3

In above example audio files are stored inside directory C:\Recordings\.

For each day a new sub-directory is created (for example, C:\Recordings\20110203\ for 3rd of February 2011). This is done with the help of parametrized string %{setup-time#%Y%m%d}, which is converted to date (read details about parametrized strings below).

The file name consists of a date and time of when a call is started, for example, 20110203104522.mp3.

If two or more calls are started at the same time, then MiaRec appends a unique number at the end of file name, for example, 20110203104522_2.mp3, 20110203104522_3.mp3 etc.

Parameters have the following format:

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

where:

  • parameter-name is a name of call parameter (see Table 1)
  • #format-string is an optional format of call parameter (see Time formatting).

Examples:

  • %{caller-number}
  • %{setup-time#%Y%m%d}

Table 1. Supported parameters inside file path

ParameterDescription
%{call-id}Unique id of a call, which is assigned to each recorded call by MiaRec
%{parent-call-id}Id of a call, which is a parent to the current call. The meaning of this parameter depends on particular voip protocol. For example, for Avaya H.323 protocol, when call is put on hold and then retrieved from hold, the new audio file will be created. In this case %{parent-call-id} points to the very first call part.
%{protocol-call-id}

Id of a call, which is assigned by IP PBX.

This value is valid only for supported voip protocol (SIP, Skinny, H.323 and MGCP).

For example, for SIP protocol this value is retrieved from header "Call-ID" inside SIP INVITE message.

%{protocol-tracking-id}

Id of a call interaction assigned by IP PBX. Usually IP PBX assigned the same tracking id to related calls, like transferred from one agent to another. 

For Avaya Aura Communication Manager, it is UCID.

For Broadworks, it is extTrackingID.

Available since August 2018

%{call-state}

Phase (state) of the call. It is a numeric value, one of:

  • 0 - Idle
  • 1 - Initiated. The first phase of a call: the caller sent invitation to the callee
  • 2 - Accepted. The callee received invitation and confirmed this
  • 3 - Alerting. The callee started ringing
  • 4 - Connected. The call was answered
  • 5 - Disconnecting. The call was initiated for disconnecting by one of  parties
  • 6 - Disconnected. The call was completed (disconnected)
  • 7 - Hold. The call was put on Hold
  • 8 - Transferred. The call was transferred to the third party
  • 9 - Deleted. The call was deleted from disk (see Recording filters)
%{record-state}

State of the audio recording. It is a numeric value, one of:

  • 10 - Active. Call is active at the moment and recording is in progress
  • 20 - Partial recording. Recording of call was stopped because of not enough licenses
  • 30 - Finished. Call is finished. Audio was recorded in full
  • 40 - Ignored. Call is ignored by recording filters.
%{voip-protocol}

Voip protocol of the call. It is a numeric value, one of:

  • 0 – Unknown (not recognized protocol). Call is recorded from RTP packets
  • 1 - SIP
  • 2 - H.323
  • 4 - SCCP (Cisco Skinny)
  • 5 - MGCP
  • 6 - Avaya (H.323 protocol with proprietary extensions)
  • 7 - Nortel UNISTIM
  • 8 - TAPI 
  • 9 - MGCP PRI Backhaul (it is used between Cisco CCM and Voice Gateway)
  • 10 - Alcatel (proprietary protocol used by Alcatel OmniPCX)
  • 11 - Avaya RTP (passive recording w/o signaling)
  • 12 - Avaya TSAPI (TSAPI + port mirroring recording)
  • 13 - SIPREC
  • 14 - Cisco Built-in-Bridge
  • 15 - NEC SIP (SIP protocol with NEC proprietary extensions)
  • 16 - ED137
  • 17 - Cisco Built-in-Bridge passive
  • 18 - SIPREC passive
  • 19 - Avaya DMCC
%{protocol-call-direction}

Call direction reported by IP PBX, available for active recording interfaces only. It is a numeric value, one of:

  • 0 - Unknown
  • 1 - Outbound
  • 2 - Inbound

Available since August 2018

%{setup-time}
Time when call was established (when a called party received incoming call message). See Time formatting
%{alerting-time}
Time when phone started ringing on called party side. See Time formatting
%{connect-time}
Time when call was answered. See Time formatting
%{disconnect-time}
Time when call was disconnected. See Time formatting
%{duration}
Duration of voice part of a call in seconds. This is a difference beween %{connect-time} and %{disconnect-time}
%{total-duration}Total duration of a call in seconds. This is a difference beween %{setup-time} and %{disconnect-time}
%{filename}

Name of audio file without full path (for example, 20110410104600.mp3)

Caution! This value is available only to a recording engine when file is initially created. It is not available to post-processing jobs, like export, relocate, etc.

%{filename-full}

Full path to the file, including directory (for example, C:\Recordings\20110410104600.mp3)

Caution! This value is available only to a recording engine when file is initially created. It is not available to post-processing jobs, like export, relocate, etc.

%{filename-dir}

Directory path to the file, excluding drive letter (for example, \Recordings\)

Caution! This value is available only to a recording engine when file is initially created. It is not available to post-processing jobs, like export, relocate, etc.

%{caller-number} or

%{callee-number}

Phone number of caller/callee

%{caller-name} or

%{callee-name}

Name of caller/callee. This parameter is protocol-dependent. For example, for SIP protocol name is extracted from "From" and "To" sip headers

%{caller-id} or

%{callee-id}

Id of a caller/callee. This paramter is protocol-dependent. For example, for SIP protocol it is SIP URI

%{caller-ip} or

%{callee-ip}

Ip-address of caller/callee

%{caller-port} or

%{callee-port}

Port of caller/callee

%{caller-mac} or

%{callee-mac}

Mac-address of caller/callee

%{transfer-from-number}

%{transfer-from-name}

%{transfer-from-id}

Name, number and id of party, from which the call was transferred. This parameter is available only for Skinny protocol.

%{transfer-to-number}

%{transfer-to-name}

%{transfer-to-id}

Name, number and id of party, to which the call was transferred. This parameter is available only for Skinny protocol.
%{sip-header-invite}

Value of specific SIP header inside INVITE message. The name of header is specified after hash (#) symbol.

Examples:

  • %{sip-header-invite#User-Agent}
  • %{sip-header-invite#X-My-header}

Caution! This value is available only to a recording engine when file is initially created. It is not available to post-processing jobs, like export, relocate, etc.

%{BroadWorks-userID}

Broadworks User ID

%{BroadWorks-groupID}

Broadwors Group ID

%{BroadWorks-serviceProviderID}

Broadworks Service Provider ID

%{MetaSwitch-recorderParty}Metaswitch CFS User Extension
%{MetaSwitch-userName}Metaswitch CFS User Name
%{MetaSwitch-businessGroup}Metaswitch CFS Business Group Name
%{MetaSwitch-systemName}Metaswitch CFS System Name
%{agent-id}Avaya Agent ID
%{agent-name}Avaya Agent Name
%{orig-caller-number}Originally Caller Number (if different from caller-number)
%{orig-caller-name}Originally Caller Name (if different from caller-name)
%{orig-callee-number}Originally Dialed Number (if different from callee-number)
%{orig-callee-name}Originally Dialed Name (if different from callee-name)

%{user-id}

%{user-name}

ID, name of user, the call recording is assigned to. If the call is an internal (i.e. assigned to multiple users), then this value points to the first user only.

Note: this value is available in post-processing jobs only (Export/Replication/File relocation). It is not available for the initial filename creation by the recorder process (configured at menu Administration -> Storage -> File Location)

Available since May 2018.

%{group-id}

%{group-name}

ID, name of group, the call recording is assigned to. If the call is an internal (i.e. assigned to multiple users) or user belongs to multiple groups, then this value points to the first group only.

Note: this value is available in post-processing jobs only (Export/Replication/File relocation). It is not available for the initial filename creation by the recorder process (configured at menu Administration -> Storage -> File Location)

Available since May 2018.

%{tenant-id}

%{tenant-name}

ID, name of tenant, the call recording is assigned to.

Note: this value is available in post-processing jobs only (Export/Replication/File relocation). It is not available for the initial filename creation by the recorder process (configured at menu Administration -> Storage -> File Location)

Available since May 2018.

%{acd-number}

%{acd-name}

%{acd-id}

Number/name/id of ACD.

Broadworks and Avaya envorinments only.

Available since July 2018.

Example 1

C:\Recordings\%{setup-time#%Y%m%d%H%M%S}.mp3

%{setup-time#%Y%m%d%H%M%S} will be replaced with a date and time of when a call was started. For example, if a call was started on 1st of May 2007 at 10:56:34, it will be stored into directory ‘C:\Recordings’ with the filename ‘20070501105634.mp3’.

Note: If two or more calls were started at the same time, a unique decimal suffix will be added to every file name (expect the first one), like: ‘20070501105634_2.mp3’, ‘20070501105634_3.mp3’ etc.

Example 2

C:\Recordings\%{setup-time#%Y%m%d}\File.mp3

This example contains a parameterized string inside a directory path. This means that files will be stored into sub-directories with name %{setup-time#%Y%m%d} (which will be replaced by a date of a call, for example, ‘20070501’). If such directory doesn’t exist, it will be created automatically.

In this example calls will be grouped into directories by date, like:

Directories structure

For every new day a separate directory will be created (a directory is not created if no calls were recorded at that day).

Audio file names in this example will be File.mp3, File_2.mp3, File_3.mp3 and so on.

Example 3

C:\Recordings\%{caller-ip}\File.mp3


%{caller-ip} will be replaced with ip-address of a caller, for example 192.168.0.1.

Calls will be grouped into directories by caller ip-address, like:

Directories structure

Example 4

C:\Recordings\%{setup-time#%Y%m}\%{setup-time#%d}\%{caller-ip}\File.mp3

In this example multiple parameter replacements occur:

  • %{setup-time#%Y%m} will be replaced with a year and month of a call (YYYYMM). For 1st of May 2007 it will be 200705.
  • %{setup-time#%d} will be replaced with a day of a call (DD). For 1st of May 2007 it will be 01. 
  • %{caller-ip} will be replaced with an ip-address of a caller, for example 192.168.0.1.

Calls will be grouped into directories by months, then by days and then by callers' ip-addresses, like:

Directories structure

Read also: