Legacy: Post-Recording Filters

Please note: this is legacy documentation. Please check out https://docs.miarec.com/all/ for the most up-to-date documentation and user guides. 

MiaRec supports post-recording filters. In a contrast to regular recording filters, which are executed when the call is started, the port-recording filters are executed when a call is completed.

Post-recording filters allow you to do post-processing of a call. For example, delete automatically calls, which are shorter than 5 seconds. Or move completed calls to other locations (to a network drive).

Post-recording filters are configured inside section [Filters::OnCallStop] in MiaRec.ini configuration file.

Example of post-recording filters:


filter1_codition = duration < 5
filter1_action = delete

default_action = rename
default_filename = \\my-storage\Calls\%{filename}

In this example, short calls (shorter than 5 seconds) are removed automatically. Remaining calls are moved to network storage directory \\my-storage\Calls.

Syntax of port-recording filters is similar to regular recording filters (see Recording filters).

This page describes only the differences between regular filters and port-recording filters.

Action Of Post-Recording Filters

Post-recording filters support the following actions:

Action Description
rename Rename or move to another location the audio file after the call is completed.
delete Delete a call after it is completed.
record Store a call as normal. Do not do any modification of a call after it is completed.


Call Parameters

Post-recording filters support all call parameters, which are supported in regular recording filters (see Syntax of filter condition), plus additional parameters, listed in the following table:

Call parameter Description

Date/time when phone started ringing.

Format: YYYY-mm-DD HH:MM:SS


  • YYYY is a year
  • mm is a month (1-12)
  • DD is a day (1-31)
  • HH is an hour (0-23)
  • MM is a minute (0-59)
  • SS is a second (0-59)


alerging-time = 2007-06-10 13:45:51

Date/time when call was answered.

Format: YYYY-mm-DD HH:MM:SS


Date/time when the call was disconnected.

Format: YYYY-mm-DD HH:MM: SS


Duration of voice part of a call in seconds.

This is a difference between connect-time and disconnect-time.


duration < 5
duration >= 30

Total duration of a call in seconds.

This is a difference beween setup-time and disconnect-time.


total-duration < 5

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


call-state = 7


Example of post-recording filters


filter1_condition = caller-number = '123456' OR callee-number = '123456'
filter1_action = record
filter1_filename = C:\MyCalls\%{setup-time#%Y%m%d%H%M%S}.mp3

default_action = ignore


default_action = rename
default_filename = D:\MyRecordings\%{filename}

Above example demonstrates both regular recording filters (section [Filters::OnCallStart]) and post-recording filters (section [Filters::OnCallStop]):

  • Phone with number '123456' will be recorded. This is defined in the following lines:
    filter1_condition = caller-number = '123456' OR callee-number = '123456'
    filter1_action    = record
  • Audio files for this phone will be stored initially inside directory C:\MyCalls\. See:
    filter1_filename  = C:\MyCalls\%{setup-time#%Y%m%d%H%M%S}.mp3
  • All other calls will be ignored. See:
    default_action = ignore
  • When calls are completed, audio files will be moved to directory D:\MyRecordings\. See:
    default_action = rename
    default_filename = D:\MyRecordings\%{filename}