Skip to main content
 
  • Home
  • |
  • Login
  • |
  • Register
  • Products
    • Overview
    • Features
    • How it works
    • Download
    • Price
    • On-line demo
  • Solutions
    • Businesses
    • Call centers
    • Financial institutions
    • Voip service providers
  • Compatibility
    • Asterisk
    • Avaya
    • Broadsoft
    • Cisco
    • Dialexia
    • Grandstream
    • Polycom
    • Siemens
    • TalkSwitch
    • Other vendors ...
  • Documentation
    • Before purchase
    • Recommended hardware
    • Installation
    • Configuration
    • Administration
    • User guide
    • Issues and questions
    • Developer guide
  • Support
    • Ask Question
    • Report Issue
    • Purchase Support
  • Our clients
    • Businesses
    • Call centers
    • Financial institutions
    • Governmental organizations
    • Voip service providers
  • Company
    • About Us
    • Contacts
    • News and events
 
Home › Documentation › Configuration ›
 

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.

File name format is configured via MiaRec.ini configuration file inside option FileNameFormat of section section [Recording].

Example:

[Recording]
FileNameFormat=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.

Note: The location of audio files can be specified also inside recording filters.

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.

%{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)
%{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)
%{filename-full}Full path to the file, including directory (for example, C:\Recordings\20110410104600.mp3)
%{filename-dir}Directory path to the file, excluding drive letter (for example, \Recordings\)

%{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}

Example 1

FileNameFormat=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

FileNameFormat=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

FileNameFormat=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

FileNameFormat=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:
  • Time formatting
  • Before purchase
  • Recommended hardware
  • Installation
  • Configuration
    • Port mirroring configuration
    • Firewall configuration
    • MiaRec.ini configuration file
    • Recording filters
    • Post-recording filters
    • Location for audio files
    • File name format
      • Time formatting
    • MiaRec with Avaya Communication Manager
  • Administration
  • User guide
  • Issues and questions
  • Developer guide
MiaRec LLC © 2012. All Rights Reserved. | Terms of Use | Privacy Statement