Media Gate (mg)
Description
Media gateway that terminates media streams.
Controlled by the mgc role over the MEGACO protocol. Each media context is controlled by one of the roles: b2b, conf, ivr, esg.
Made redundant and scaled in Active-Active mode and additionally by distribution across mgc groups.
Starts and monitors the rtx_mg3 application process in the operating system, which actually performs media traffic processing.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Managed application |
|
Limitations
-
Must be present on all sites with b2b roles when media processing is used in the system (the "b2bmedia" option in the sg, esg, ivr, and conf roles).
-
Port settings must not overlap with other roles on the server.
-
For full cross-site system operation, all mg role instances must serve traffic on the network interfaces from which the corresponding addresses of all other mg and bgmg roles are reachable. Otherwise, cross-site calls may be impossible.
-
The throughput of network interfaces serving media traffic and connections to networks must match the possible peak load and codecs used. For example, 200 telephone conversations in PCMA (G.711 a-law) require at least 20 Mbit/s in each direction at the narrowest point. When serving more conversations and distributing them across different servers with media gateways, appropriate throughput must be ensured on the network devices aggregating the traffic.
-
Traffic always takes the shortest route: device A - media gateway - device B (at the logical level, excluding all intermediate network devices). But in some cases, devices A and B can be other media gateways serving conference and IVR media contexts. In a special case, when different subnets are interconnected at the border sg and esg roles, devices A and B can be media gateways of the bgmg role.
-
Operation on several interfaces is possible.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
|
|
required |
Name. May consist of Latin letters and digits and must start with a letter. |
|
|
required |
Role type. Possible values: |
|
|
empty |
Additional role options. Contains a JSON object or list. |
|
|
empty |
Role activity flag. When set to false, the role does not participate in validation and is not started. |
|
|
empty |
Limit on the number of CPU logical cores used. Default: 0 - unlimited. |
|
|
empty |
Default logging level set specifically for the role instance (microservice type). More |
|
|
|
Flag allowing parameter differences in roles of the same group. Default: false - not allowed. |
|
|
required |
Role identifier. |
|
|
required |
Flag indicating whether the role is allocated to a separate node. |
|
|
|
MGC group to which the current mg belongs. |
|
|
empty |
List of codecs used. Limits the codecs offered externally. |
|
|
empty |
Alias of the server directory for storing certificates (server.crt and server.key files). |
|
|
empty |
Password for decrypting the certificate private key file. Secret: ciphertext when read; the plaintext value is not returned via API and is decrypted by the service when used; a plaintext value can be supplied on input (Encryption and keys). |
|
|
|
Flag for saving call recordings. |
|
|
empty |
Alias of the server directory for placing call recordings. By default, the directory "/var/lib/era/files/records" is used |
|
|
"10000:20000" |
Range of RTP ports that this role instance will use. |
|
|
empty |
Alias of the server directory for placing log files. |
|
|
|
Debug switch for logging RTP traffic receive and send operations. |
|
|
|
Switch for logging the MEGACO facade protocol. |
|
|
|
Logging level. The value must be a list with one element. Possible element values:
In previous versions, the list could contain flags: Possible values:
|
|
|
|
Maximum total size of log files per day in MB. When the limit is reached, logging stops until files are deleted, including automatic deletion by time. |
|
|
|
Maximum size of one log file in MB. |
|
|
|
Switch for logging statistics based on RTCP packets. |
|
|
|
Interval for flushing data from the cache to the source call recording file, in milliseconds. |
|
|
|
Playback cache switch. The application-layer cache optimizes playback of reusable IVR files in parallel scripts. Savings come from disk access and transcoding. |
|
|
|
Limit on the idle time of a file in the cache. This is the time interval in seconds during which the file was not used in any process. Default: 600 seconds. |
|
|
|
Limit on the total number of files in the cache. When exceeded, the newest files, that is, recently opened ones, are deleted. Default: 500. |
|
|
|
Timeout for establishing an SRTP media session. If the session is not established within the timeout, the dialog is terminated. This behavior excludes servicing a dialog in which subscribers cannot hear each other due to any failure in establishing the media session. |
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.
{
"name": "mg11",
"roletype": "mg",
"roleid": 11300,
"separate": true,
"mgcgroup": 3,
"codecs": ["PCMA", "PCMU"],
"logpartsize": 10,
"logtrace": [
"warning"
],
"mgrecordcalls": "alias://paths/b",
"recdumpinterval": 3000,
"rtcpmonitor": true,
"termportrange": "10000:2000"
}