Border Gate’s Media Gate (bgmg)

Description

An edge media gateway that closes media streams to external interfaces.
One side is always the port of the role mg managed by the role b2b, and the other side is the subscriber device port (if an internal subscriber arm) or the provider port (external subscriber arm).
Can be reserved on a single server in Active-Active mode with non-overlapping multiple instance settings.
Organizes the startup and monitoring of the rtx_mg3 application process in the operating system that actually handles media traffic.

Runs on the same server with and under the management of sg and/or esg.
An edge media gateway may be needed in several cases:
- If an outbound-proxy server of the system (sg microservice) is located in several subnets, and there is such a subnet where subscribers connect from, and access to which is not available on other servers of the system where microservices are executing mg.
- If a server serving connections to telephony providers (esg microservice) is placed on multiple subnets such that the subnet of any provider does not extend to other servers in the system.
- If any telephony provider requires matching subscriber addresses in SIP and SDP describing media sessions.
- If any telephony provider does not process reinvites (denies or ignores media session changes).

An edge media gateway is used when communicating with an ISP if:
- The provider account activates the media mode. Otherwise, the mode is not used even if other conditions are met.
- At least one bgmg microservice is also executed on the server where the esg microservice serving this provider account is executed. Otherwise, calls from/to media enabled providers are terminated by the server refusing to process the call. +

An edge media gateway is used when communicating with internal subscribers if:
- The system is deployed on more than 1 server. Otherwise, the mode is not used even if other conditions are met.
- At least one bgmg microservice is executed on the server where the sg microservice serving subscriber connections is executed. Otherwise, the mode is not used even if other conditions are met.
- In the configuration parameters of the sg microservice serving subscriber connections, the bgmedia mode is enabled. Otherwise, the mode is not used even if other conditions are met.

Table 1. System Characteristics

Code

bgmg

Mode of operation

Service

Backup mode

Active-Active

Types of sites

Any

Layer

Business logic

Placement

Frontier

Saving and restoring state on reboot

No

appendix

era_mg

Managed application

rtx_mg3

Limitations

  • Must exist on all servers with multiple interfaces with access to different subnets where roles sg and esg.

  • RTP port range settings must not overlap with other roles on the server.

  • Active use of a role lowers the potential throughput of SIP signaling traffic through the server.

  • The bandwidth of network interfaces serving media traffic and network connections must be matched to the possible peak load and the codecs used. For example, 200 telephone conversations in PCMA codec (G.711 a-law) require a bandwidth of at least 20 Mbit/s each way at the narrowest point. When serving more conversations and distributing them to different servers with media gateways, it is necessary to provide adequate bandwidth on the network devices that aggregate the traffic.

Parameters

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and numbers, must begin with a letter.

roletype

str

required

Role Type. Possible values: "bgmg".

iface

str

required

The alias of the server network interface on which the roles will interact internally with each other.

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.

roleid

int

required

Role ID.
Unique for the entire system, regardless of the site or server. Cannot be changed.
Integer from 1 to 9999.

separate

bool

required

An indication that the role has been allocated to a separate node.

port

int

2944

Local port TCP MEGACO.
Standard Port: 2944.

mgcgroup

int

0

The mgc group to which the current one belongs mg.
Matches the group parameter in roles with type mgc.

codecs

array<str>

empty

List of codecs in use. Restricts the use of externally issued codecs.
Possible values: "GSM", "PCMA", "PCMU", "G722", "G729", "G726-16", "G726-24", "G726-32", "G726-40", "opus", "speex", "G729a", "VP8", "VP9", "H264", "H263", "H263-1998", "H263-2000". Default: not set, all supported codecs are used.

certdir

str

empty

Alias of the directory on the server for storing certificates (server.crt and server.key).
If the path is not specified, the certificates are searched in the directory "/usr/lib/era/era_sip/priv/ssl"

keypass

str

empty

Password for decrypting the certificate’s secret key file.

domgrecordcalls

bool

true

An indication that call recordings have been saved.

mgrecordcalls

str

/var/lib/era/files/records

A directory alias on the server to host conversation recordings.

termportrange

str

"10000:20000"

The range of RTP ports that this role instance will use.
Format: "PortFrom:PortCnt", where PortFrom is the initial port value, PortCnt is the number of ports.
If not specified, the range is used "10000:20000".

logrootpath

str

empty

Directory alias of a directory on the server to host log files.
Default: "/var/lib/era/_workdir/<NODE_NAME>/log/mg".

logtrace

array<str>

["warning"]

Logging Level.

Possible values:
timer, call, events, proto, error, warning, trans, async, stream, fax, net, media-flow, rtp-flow, rtp, session, stat, flag1, flag2, flag3, flag4, flag5, flag6, flag7, flag8.

Not recommended for continuous use due to the high performance requirements of hard disks.

logmaxsize

int

2000

Maximum total size of log files for one day, in MB. When the limit is reached, logging stops pending deletion, including automatic time-based deletion.

logpartsize

int

200

Maximum size of a single log file, in MB.

rtcpmonitor

bool

false

Packet-based statistics logging switch RTCP.

recdumpinterval

int

5000

Interval for dumping data from the cache to the original call recording file, in milliseconds.
Minimum value: 500.

Configuration example

The configuration is managed in an application available to master domain administrators. The application hides the full content of the configuration, but it is nevertheless accessible via the API.

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

Example node
{
  "name": "bgmg1",
  "roletype": "bgmg",
  "iface": "eth0",

  "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"
  ]
}

See also