Redirect SIP Service (redirect)

Description

Redirects SIP requests to one of the SIP gates of the current site. Provides the ability to use one IP address for devices connected to the site, increasing its throughput.

Made redundant and scaled in Active-Active mode.

Table 1. System characteristics

Code

redirect

Operation mode

Service

Redundancy mode

Active-Active

Site types

Any

Layer

Business logic

Placement

Border

State preservation and recovery on restart

No

Application

era_sip

Limitations

  • The role is available only in working domains

  • Is a border role and uses a TLS certificate for HTTPS and WSS connections.

Parameters

Table 2. Parameters
Name Type Default Description

name

str

required

Name. May consist of Latin letters and digits and must start with a letter.

roletype

str

required

Role type. Possible values: "redirect".

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.

limit_of_cores

int

empty

Limit on the number of CPU logical cores used. Default: 0 - unlimited.

logging_default_level

int

empty

Default logging level set specifically for the role instance (microservice type). More

allow_divergence

bool

false

Flag allowing parameter differences in roles of the same group. Default: false - not allowed.

roleid

int

required

Role identifier.
Unique across the entire system, regardless of site or server. Cannot be changed.
An integer from 1 to 9999.

separate

bool

required

Flag indicating whether the role is allocated to a separate node.

udp

int

required

Local UDP port for SIP. The same port also handles TCP.
For example: 5060.
Raises a UDP listener on the wildcard interface '0.0.0.0' or on the interfaces specified by the 'sip_ifaces' parameter.

tcp

int

required

Local TCP port for SIP. If a value different from UDP is specified, it is opened additionally.
For example: 5060.
Raises a TCP listener on the wildcard interface '0.0.0.0' or on the interfaces specified by the 'sip_ifaces' parameter.

tls

int

empty

Local TLS port for SIP (1 - 65535). Not opened by default.
For example: 5061.
Raises a TLS listener on the wildcard interface '0.0.0.0' or on the interfaces specified by the 'sip_ifaces' parameter.

wss

int

empty

Local WebSocketSecure port for SIP (1 - 65535). Not opened by default.
For example: 5063.
Raises a WSS listener on the wildcard interface '0.0.0.0' or on the interfaces specified by the 'sip_ifaces' parameter.

sip_internal_port

int

empty

Local port for SIP interaction with other system microservices (UDP/TCP).
For example: 6150.
Used for internal interaction with other system microservices over SIP.
Applied when a list of specific port listener interfaces ('sip_ifaces') is set for the microservice.
Listens only on the local interface of the node.
Must not be used by other microservices running on the same server.

sip_ifaces

array<str>

[]

List of server interfaces on which port listeners are raised.
Specified by server interface aliases.
If no interface is specified, the configured ports listen on all interfaces (0.0.0.0).

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.

virtual_ifaces

array<str>

[]

List of monitored virtual interfaces (Virtual IP).
Specified by server interface aliases marked with the 'virtual' flag.
If none is specified, the service starts normally on static addresses according to the sip_ifaces setting.

If some virtual interfaces are specified in the list, the microservice instance monitors their appearance before starting the target service.
The absence of at least one virtual address from the specified list among the server’s available interfaces causes the target service to be unloaded and wait for all addresses to appear.
Virtual interface availability is checked every 2 seconds.

The specified virtual interface is always used in the SIP service for its primary purpose.

The target use of a virtual interface assumes the following combination of settings:

  • creating a virtual address for the external subnet.

  • specifying the virtual interface in the sip_ifaces list;

  • having another server in the cluster for which the same address is similarly configured as virtual;

  • having another REDIRECT microservice instance bound to that server, for which the same interface is specified as virtual.

sipcode

int

305

Response code sent to the UA for redirection. Possible values: 3xx. Default: 305 Use Proxy.

multicontact

bool

false

Switch for the mode of providing the UA with a list of addresses.
true – provides the UA with a random list of addresses of all sg role instances on the current site (the choice is delegated to the UA).
false – provides the UA with a single randomly selected address from the list of addresses of all sg role instances on the current site.

gates

array<int>

empty

List of roleid of sg roles to which redirection will be performed.
By default, all instances on the current site.

expires

int

0

Lifetime substituted into the "Contact" field during redirection, in seconds.
It is assumed that the device will continue to use the received contact address as the primary proxy server for the specified time.

log_sip

bool

true

Switch for logging SIP traffic to the sip log.

log_trn

bool

true

Switch for logging SIP transactions to the trn log.

log_cdr

bool

true

Switch for logging events to the cdr log.

log_closure

bool

true

Switch for logging Call-ID closures of legs/dialogs to the callid log.

log_media

bool

true

Switch for logging media functions to the media log.

log_mgct

bool

true

Switch for logging to the mgct log.

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.

Node example
{

  "name": "redirect1",
  "roletype": "redirect",

  "roleid": 11430,
  "separate": true,
  "tcp": 5060,
  "udp": 5060,
  "tls": 5061,
  "wss": 5063,

  "certdir": "/var/lib/era/certificates",
  "keypass": "eb9c4458016d3f1e378d02004c4f4f50",
  "expires": 180,
  "multicontact": false,
  "sipcode": 302
}

See also