Border Gate’s Media Gate (bgmg)
Description
Border media gateway that terminates media streams on external interfaces.
One side is always a port of the mg role controlled by the b2b role, and the other side is a subscriber device port (if the internal subscriber leg) or a provider port (external subscriber leg).
It can be reserved on one server in Active-Active mode with non-overlapping settings of several instances.
It starts and monitors the rtx_mg3 application process in the operating system, which actually performs media traffic processing.
Runs on the same server as the sg and/or esg role and under their control.
A border media gateway may be needed in several cases:
- If the system’s border outbound-proxy server (sg microservice) is located in several subnets, and there is a subnet from which subscribers connect and which is unreachable from other system servers running mg microservices.
- If the server serving connections to telephony providers (esg microservice) is located in several subnets such that a provider’s subnet is not propagated to other system servers.
- If a telephony provider requires subscriber addresses in SIP and SDP describing media sessions to match.
- If a telephony provider does not handle re-INVITEs (prohibits or ignores media session changes).
The border media gateway is used when interacting with a provider if:
- The provider account enables 'media' mode. Otherwise, the mode is not used even if other conditions are met.
- At least one bgmg microservice also runs on the server where the esg microservice serving this provider account runs. Otherwise, calls from/to providers with media enabled end with the server rejecting call processing. +
The border media gateway is used when interacting with internal subscribers if:
- at least one bgmg microservice runs on the server where the SG (outbound proxy) instance serving subscriber connections runs — this is a necessary condition;
- and also:
- either the 'bgmedia' mode in SG settings is set to "force" — a sufficient condition;
- or the 'bgmedia' mode in SG settings is set to "auto", the system is deployed on two or more servers, and proxying is performed between two different subnets (the subscriber device and the SIP server are in different subnets);
- or the 'bgmedia' mode in SG settings is set to "auto", the incoming call arrives at the main interface of the server that is marked in SIP-ALG settings as a gray address and is not proxied to another subnet.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Managed application |
|
Limitations
-
Must exist on all servers with several interfaces providing access to different subnets where sg and esg roles are present.
-
RTP port range settings must not overlap with other roles on the server.
-
Active use of the role reduces the potential throughput of SIP signaling traffic through the server.
-
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.
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). |
|
|
"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. |
|
|
|
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. |
|
|
|
Call recording storage flag. |
|
|
empty |
Alias of the server directory for placing call recordings. Default directory: "/var/lib/era/files/records" |
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": "bgmg1",
"roletype": "bgmg",
"roleid": 11301,
"separate": true,
"port": 2984,
"mgcgroup": 3,
"aliases": [
{
"key": "tgw1",
"value": "eth0"
}
],
"termportranges": [
{
"key": "tgw1",
"value": "30000:1000"
}
],
"codecs": ["PCMA", "PCMU"],
"logtrace": [
"error",
"warning",
"call",
"flag3",
"proto",
"media-flow",
"rtp-flow",
"rtp"
]
}