Mixer (mix)

Description

Prepares, packages, joins, and places call recording files based on system events. Placement is performed in a common storage (Local paths - recstore), from where recordings are then distributed to domain storages by the recmover role.

Made redundant and scaled in Active-Active mode.

Starts and monitors the rtx_mixer application process in the operating system, which actually performs media data processing.

Initiates the process of moving the recording to domain storages.

Requires the Message Broker to be configured.

Table 1. System characteristics

Code

mix

Operation mode

Service

Redundancy mode

Active-Active

Site types

Any

Layer

Business logic

Placement

Internal

State preservation and recovery on restart

No

Application

era_mix

Managed application

rtx_mixer

Limitations

  • Creates a heavy CPU load during mixing. When sharing a server with other roles, the number of threads available to the role should be seriously limited; otherwise there is a risk of 100% CPU load on the server.

  • To avoid a negative impact on main processes, mixing is performed at reduced priority (nice=12).

  • The site must provide enough computing power for the role so that, on average during the day, all role instances have time to package all conversations held on the site.

  • If the mixer cannot place a task in storage (incorrectly configured folder or unavailable NFS server), the mixing process waits for it to appear, and tasks accumulate in the working directories of the nodes running mixer instances. The limit is the disk space in the partition with the /var/lib directory (of the container).

Parameters

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and digits and must start with a letter.

roletype

str

required

Role type. Possible values: "mix".

ext

json

empty

Additional role options. Contains a JSON object or list.

enabled

bool

empty

Role activity flag. When set to false, the role does not participate in validation and is not started.

limit_of_cores

int

empty

Limit on the number of CPU logical cores used. Default: 0 - unlimited.

logging_default_level

int

empty

Default logging level set specifically for the role instance (microservice type). More

allow_divergence

bool

false

Flag allowing parameter differences in roles of the same group. Default: false - not allowed.

roleid

int

required

Role identifier. Unique across the entire system, regardless of site or server.
Cannot be changed after assignment. An integer from 1 to 9999

separate

bool

required

Flag indicating whether the role is allocated to a separate node.

recstorageid

str

required

Configuration code of the call recording storage on the server (server.recstorepaths.key), which in turn contains an alias of the server directory for storing call recordings without division by domains.
If the directory does not exist, it is created.
When the recmover role operates, recordings from this common storage are moved to domain storages. By default, the domain recording storage is a subdirectory of the common recording storage directory.
Depending on whether recordings are moved to domain storages outside the cluster (for example, to S3 storage), placement in the directory may be short-term or long-term with accumulation.

The key, alias, and path may differ from the target destination used in recmover. In addition, recmover can place recordings in domain storages based on domain settings (storages and recording rules).

cachefolder

str

empty

Alias of the server directory for placing mixer service files.
If the directory does not exist, it is created.
Default: "/var/lib/era/_workdir/<NODE_NAME>"

channels

int

2

Number of channels in the file after mixing.
Available for modification only for mp3 and pcm formats.
Possible values:

  • 1 – mono, * 2 – stereo.

encoding

str

"mp3"

Format into which the audio recording file is packaged after mixing.
Possible values: "mp3", "pcm", "pcma", "pcmu", "gsm".

maxevents

int

8

Maximum number of events the role can receive from all queues in one iteration.
By default, the value equals the number of available logical processors, but if an error occurs during determination, the default is: 8.

samplerate

int

8000

Audio stream sampling rate.
Can be changed only for mp3 and pcm formats.
Possible values for mp3 and pcm: 8000, 16000, 32000.

bitrate

int

24000

Audio stream bitrate.
Can be changed only for mp3 format.
Possible values for mp3: 8000, 16000, 24000, 32000, 48000, 64000.

The value must be a multiple of the 'samplerate' parameter. Otherwise, the nearest multiple is used.

deletesource

bool

true

Debug flag. Allows disabling deletion of source per-channel RTP recordings from the media gateway immediately after mixing completes.
In this case, deletion is performed automatically after 4-6 hours.

Configuration example

Configuration management is performed in an application available to master domain administrators. The application hides the full configuration content, but it is still available through the API.

The configuration contains a section describing all instances of all roles. Parameters are defined for each specific role instance.

Node example
{
  "name": "mix1",
  "roletype": "mix",

  "roleid": 11200,
  "separate": false,

  "recstorageid": "main4",

  "channels": "2",
  "encoding": "mp3",
  "samplerate": "8000"
}

See also