Internal SIP Gate (sg)
Description
SIP entry point to the cluster for internal devices identified by SIP user accounts.
Proxies requests in stateless mode to internal servers with b2b roles. It has an address through which phones of internal subscribers of the corresponding site are connected. Any request from the system to a user goes through the corresponding sg role instance.
It does not distinguish between request types; it passes everything through, adding itself to the "Via" headers of all requests and the "Record-Route" headers of INVITE requests.
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 sg role.
Made redundant and scaled in Active-Active mode.
On role startup, the certificate specified in the *certdir* parameter is checked. If validation fails, the role starts with an immutable certificate. The certificate can be overridden through domain settings.
Code |
|
Operation mode |
|
Redundancy mode |
|
Site types |
|
Layer |
|
Placement |
|
State preservation and recovery on restart |
|
Application |
|
Limitations
-
No more than 3000 SIP packets per role instance per second.
-
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 ( |
|||
|
required |
Local TCP port for SIP ( |
|||
|
empty |
Local TLS port for SIP ( For the TLS port, client certificate validation mode can be set with the tls_mode parameter. |
|||
|
empty |
Local WebSocketSecure port for SIP ( |
|||
|
empty |
TLS port operation mode.
The CA certificate that signed the certificates issued to devices is used for chain validation and can be placed in the :SYNC/common/cacerts folder in PEM format.
|
|||
|
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 callid of dialogs that passed through sg (without links between them) to the callid log. It is used to find the sg trn log when assembling trn and building a diagram after link retention in node memory expires. The line is written once per INVITE dialog: for the initial INVITE, or if the dialog is unknown to sg (for example, a replacement instance) for the first request within the dialog, except ACK and PRACK. |
|||
|
|
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 |
|||
|
empty |
Alias of the server directory for storing certificates ('server.crt' and 'server.key' files). This parameter and certificate are used only when the certificate specified in domain settings is not applied (settings.certificate_pem):
|
|||
|
empty |
Password for decrypting the certificate private key file specified in the 'certdir' field. 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). |
|||
|
|
Switch for using the media gateway by the b2b microservice for calls forwarded by the current sg role instance. |
|||
|
|
Switch for using the border media gateway by the current outbound-proxy server. A border media gateway may be needed (on the internal facade) if the outbound-proxy server 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. Possible values:
In automatic mode, the border media gateway is used on the internal facade (outbound-proxy) if at least one condition is met:
and is not used in other cases. In default configurations, media traffic is handled only by the mg media gateway under the control of the b2b microservice, and the border media gateway on the internal facade is not used. The border media gateway is added to the media traffic servicing chain; it does not replace the main media gateway. |
|||
|
|
List of audio codec names used to initiate a call (leg call). |
|||
|
empty |
List of video codec names used to initiate a call (leg call). |
|||
|
|
Video transcoding switch.
|
|||
|
|
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 softphone does not initialize the media connection upon receiving a preliminary 183 response with SDP. |
|||
|
|
Maximum UDP packet size sent by the system, in bytes. |
|||
|
|
Switch for sending NOTIFY requests to re-register a UA when the sg role instance serving the device fails. Useful when:
One active SG instance with the reregister option enabled monitors all other instances of the current site. If not all domains are available at the time of the registration search (for example, during server shutdown there is a simultaneous takeover of DB, mdc, reg), the operation is postponed for up to 2 minutes waiting for services to come up. |
|||
|
|
Switch for sending unsuccessful final SIP responses to REGISTER, SUBSCRIBE, and INVITE (new) requests during the server decommissioning mode. |
|||
|
|
List of roleid of other SG instances replacing the current instance during decommissioning. |
|||
|
|
Response code sent to subscribers in response to an incoming request while the node is in decommissioning mode. |
|||
|
|
Switch for automatic transliteration of DisplayName in requests forwarded from the system to connected devices. |
|||
|
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 |
Substitution of domains instead of IP addresses in the To and From headers of SIP packets. Format:
|
|||
|
|
Interval for checking SIP connections over WebSocket (ws/wss), in seconds. |
|||
|
|
Switch for logging events to the |
|||
|
empty |
Additional TLS cipher suites (OpenSSL names, e.g. |
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": "sg1",
"roletype": "sg",
"roleid": 11280,
"separate": true,
"tcp": 5060,
"udp": 5060,
"tls": 5061,
"wss": 5063,
"log_trn": true,
"log_sip": true,
"log_media": true,
"log_mgct": true,
"certdir": "alias://paths/default_certdir",
"keypass": "eb9c4458016d3f1e378d02004c4f4f50",
"max_udp_size": 10000,
"b2bmedia": true,
"reregister": false,
"translit": true,
"sip_alg": [
{"gray":"172.16.0.14","white":"62.84.126.3"},
{"gray":"172.16.0.15","white":"62.84.126.6"}
],
"substitute_domains": [
{
"addr": "172.16.0.15",
"domain": "pbx.incoplax.com"
}
]
}