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:
Examples:
Table 1. Supported parameters inside file path
| Parameter | Description |
|---|---|
| %{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:
|
| %{record-state} | State of the audio recording. It is a numeric value, one of:
|
| %{voip-protocol} | Voip protocol of the call. It is a numeric value, one of:
|
| %{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:
|
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.
FileNameFormat=C:\Recordings\%{setup-time#%Y%m%d}\File.mp3This 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:

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.
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:

FileNameFormat=C:\Recordings\%{setup-time#%Y%m}\%{setup-time#%d}\%{caller-ip}\File.mp3In this example multiple parameter replacements occur:
Calls will be grouped into directories by months, then by days and then by callers' ip-addresses, like:
