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:

[Filters::OnCallStop]

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
alerting-time

Date/time when phone started ringing.

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

Where:

  • 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)

Example:

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

Date/time when call was answered.

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

disconnect-time

Date/time when the call was disconnected.

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

duration

Duration of voice part of a call in seconds.

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

Examples:

duration < 5
duration >= 30
total-duration

Total duration of a call in seconds.

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

Examples: 

total-duration < 5
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

Example:

call-state = 7

 

Example of post-recording filters

[Filters::OnCallStart]

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


[Filters::OnCallStop]

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:
    [Filters::OnCallStart]
    default_action = ignore
  • When calls are completed, audio files will be moved to directory D:\MyRecordings\. See:
    [Filters::OnCallStop]
    default_action = rename
    default_filename = D:\MyRecordings\%{filename}