External SIP Gate (esg)
Description
SIP access point to the cluster for external devices: telephony providers, gateways, and upstream and peer PBXs located in an external number plan not managed by the system. All work is based on SIP provider accounts. CallerId and CalledId transformation rules (provider_callerid) are used to interconnect the internal number plan with peer and upstream PBXs and providers.
Processes requests in user-agent mode. One leg is always an external subscriber; the other leg is always an internal server with the b2bua role.
The media gateway is used when the call is associated with a provider account that has the "media" option enabled.
Is a border role for the SIP interface.
Protects the cluster from unwanted external requests using border filters based on static rules and dynamic lists of temporarily banned addresses.
Can use the bgmg role to interconnect different networks. The media gateway through the bgmg role is used automatically when multiple network interfaces are detected and when proxying a request from one subnet to another.
For this mode to work correctly, one or more bgmg role instances with non-overlapping port settings must be present on the server with the esg role.
Made redundant and scaled in Active-Active mode.
Each provider account is bound to a specific esg role instance running on one of the sites where the domain is served.
Read more about working with telephony providers.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Limitations
-
REFER and INVITE+Replaces requests are always processed mirrored, that is, within the direction from which the request was received.
-
Is a border role and uses a TLS certificate for HTTPS and WSS connections.
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. |
||
|
required |
Local UDP port for SIP. The same port also handles TCP. |
|||
|
required |
Local TCP port for SIP. If a value different from UDP is specified, it is opened additionally. |
|||
|
empty |
Local port for TLS connections. Not opened by default. |
|||
|
empty |
Local port for SIP interaction with other system microservices (UDP/TCP). |
|||
|
|
List of server interfaces on which port listeners are raised. For sg, esg, and redirect roles running on the same server, the same values can be specified as external ports (udp, tcp, tls, wss) if their listen interface lists do not overlap. The original interface of the current node is always added to the listen interface list (except when a virtual address exists in the same subnet). The listener is raised on the 'sip_internal_port', which must not be used by other microservices on the same server.
|
|||
|
|
List of monitored virtual interfaces (Virtual IP). If some virtual interfaces are specified in the list, the SIP gateway instance monitors their appearance before starting the target service.
Virtual addresses may have static equivalents. For example, static address 192.168.0.101 and virtual 192.168.0.100.
This leads to the conclusion: if there are no virtual addresses in the internal cluster subnet, or the primary static addresses in the subnet are used alongside the virtual SIP gateway, then conversation recovery will necessarily require replacement (INVITE+Replaces). In other cases, seamless recovery options are possible. This applies only to calls without bgmg on multi-server systems where all other microservices remain operational. The target use of a virtual interface assumes the following combination of settings:
|
|||
|
|
Switch for logging events to the |
|||
|
|
Switch for logging Call-ID closures of different legs/dialogs to build sequence diagrams. When this log is enabled, the retention time of links in node memory (sip_stat_timeout_closure) can be reduced to save memory: volume estimate. |
|||
|
|
Switch for logging media functions to the |
|||
|
|
Switch for logging the MGC controller interaction protocol to the |
|||
|
|
Switch for logging the dialog state machine trace to the |
|||
|
|
Switch for logging SIP traffic to the |
|||
|
|
By default, when initiating calls to addresses connected over TLS, an SDP offer for unencrypted media (RTP) is sent. This parameter can enable an SDP offer with an encrypted media stream for TLS addresses. |
|||
|
|
Switch for monitoring TLS connection establishment. Changing the default settings may be required, for example, if the remote side does not initialize the media connection upon receiving a preliminary 183 response with SDP. |
|||
|
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). |
|||
|
|
List of audio codec names used to initiate a call (leg call). The value is a list of audio codec names in
Codecs are offered in list order. The base The parameter is overridden by a non-empty value of the provider.opts.payloads_audio option for calls whose leg is the corresponding provider account with media mode enabled. |
|||
|
empty |
List of video codec names used to initiate a call (leg call). The value is a list of video codec names in
|
|||
|
|
Video transcoding switch.
|
|||
|
|
Maximum UDP packet size sent by the system, in bytes. |
|||
|
|
Switch for using the media gateway by the b2b role for calls initiated by the current esg role instance. |
|||
|
empty |
List of IP addresses of the current server. |
|||
|
empty |
List of external STUN servers for determining the server’s external IP address when operating behind NAT. |
|||
|
empty |
White address substitution. Format:
The list must contain the addresses of all servers where media gateways are located, as well as the local interfaces of the current machine from which routing to all external addresses is performed. |
|||
|
empty |
Group codes of the full-text SIP message modification rules applied by this instance (sipmodrules). |
|||
|
empty |
Header forwarding. Format:
Empty by default. |
|||
|
true |
Forced spam filter switch for the microservice instance. By default, the spam filter is not blocked but is inactive because master domain settings do not set the limit density. |
|||
|
empty |
Additional TLS cipher suites (OpenSSL names, e.g. |
|||
|
empty |
Local WebSocketSecure port for SIP ( |
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": "esg12",
"roletype": "esg",
"roleid": 11260,
"separate": true,
"tcp": 5080,
"udp": 5080,
"tls": 5081,
"log_cdr": true,
"log_trn": true,
"log_sip": true,
"log_media": true,
"log_mgct": true,
"certdir": "/var/lib/era/certificates",
"keypass": "eb9c4458016d3f1e378d02004c4f4f50",
"max_udp_size": 10000,
"stunserver": ["sip:stun.sipnet.ru:5060", "sip:demo.era.ru:5060"],
"sip_alg": [
{"gray":"172.16.0.14","white":"62.84.126.3"},
{"gray":"172.16.0.15","white":"62.84.126.6"}
],
"fwd_headers": [
"X-Header-1",
"X-Header-2"
]
}