Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

Версия 1 Текущий »

The media server is designed for processing speech and video information over RTP, organizing conferences, recording conversations, playing media files and various combinations of these modes.

Media server resources are managed using the control channel mechanism (RFC 6230 Media Control Channel Framework, RFC 6231 IVR Control Package, RFC 6505 Mixer Control Package).

The functionality performed on the media server

  1. After installation, the media server starts with the initial settings set at the installation stage.
  2. During launch, a process starts on the media server that determines the list of network interfaces available in the system. Based on this list, a list of UA is generated for registration on the SIP server.
  3. According to the well-known list of UAs, these UAs are registered on the SIP server. SIP REGISTER messages are sent for each UA over the service VLAN-X.
  4. Periodic monitoring of interfaces availability. When changing the list of available interfaces, a command is sent to register the UA for a new interface, or to cancel registration if the interface is disabled or disappeared. It is necessary to make attempts to re-register after a long interval for UAs whose registration has not been confirmed by the SIP server.
  5. On the service interface, the media server opens the listening port 5700, through which a request is received from ECSS-10 to determine the control channel (control_channel) of media management via the mediactrl protocol.

An algorithm for generating UA parameters for registration on ECSS-10

  1. A separate SIP UA is formed for each network interface.
  2. One of the network interfaces is marked as a service interface (at the configuration stage). SIP traffic is transmitted through it. The UA for this interface is the only one that has a bind of signaling and media done on the same network interface. The UAs of the other interfaces use the transport of the service interface for SIP, and the binding of the receiver/transmitter of the media traffic is carried out to the network interface announced by the SIP UA.
  3. Information about the announced network interface is transmitted to the REGISTER via the From field. Network interface parameters are passed through the following fields:
    1. P-Eltex-MSR-Iface-Name;
    2. P-Eltex-MSR-Iface-Addr;
    3. P-Eltex-MSR-Acc-Id;
    4. P-Eltex-MSR-CC-Addr (service only);
    5. P-Eltex-MSR-CC-Port (service only);
    6. P-Eltex-MSR-Name.
  4. Cc-status, Cc-id & Cc-address (Control channel status, Control channel id & Control channel address) are generated only for the service interface;
  5. URI UA is formed according to the following format: {interface-name};{msr-contact-id}@{MSR-name}, where:
    • interface-name — name of the announced interface;
    • msr-contact-id — dynamic contact ID on MSR;
    • MSR-name — name of the media server (hostname or name specified during the installation).
  6. IFace (the announced interface) has the form: interface-name(MEDIA-IP-Address), where:
    • interface-name — name of the announced interface;
    • MEDIA-IP-Address — IP address of the announced interface to which the media resource is linked.

ECSS-10 functionality

  1. To register media servers, a separate service registrar is allocated, which is located on the core of the system (Core). The registrar works in the service VLAN-X (separate port, dedicated interface).
  2. Signal traffic from media servers is processed by a SIP server, which is embedded to the core and processed in the service VLAN-X.
  3. Registrar functionality:
    1. receiving registration requests from media servers service subscribers;
    2. authentication of the UA that sent the registration request (by the local table of subscribers);
    3. authorization of the UA that sent the registration request (according to the local restrictions table);
    4. installation and support of the specified settings of the registration expiration period;
    5. informing the SIP server about the appearance of new registrations, about the cancellation of registration of the UA (at the initiative of the UA), about the refusal of registration renewal by the UA, about the cancellation of registration at the initiative of the SIP server (at the command of the management system);
    6. receiving correct registration requests (correct RURI and authentication). Traffic maintenance on a registered resource begins if it is fully configured and not administratively blocked;
    7. transmission of the notification to the control channel establishment subsystem (control_channel) after successful registration of a new media server (service UA — msr-root). The notification specifies the SIP URI of the service UA of the media server;
    8. transmission of the notification to the subsystem for establishing the control channel (control_channel) in case of service UA registration loss (msr-root) media server, or in case of forced refusal of registration.
  4. SIP server functionality:
    1. installing SIP sessions with the selected account;
    2. support for installed SIP sessions (reINVITE mechanism);
    3. notification of the SIP session collapse facts on the initiative of the MSR (or in case of loss of communication with the MSR).
  5. Control channel management functionality:
    1. installation and support of control channels one to each media server
    2. collapse of the control channel in case of refusal to register the media server;
    3. transmission of mediactrl messages to the needed control channel, which is selected by the channel ID (equal to the service SIP URI of the media server).

Configuring the media server

To configure the media server, follow the steps described in this section.

Installing the media server

The software media server is installed from the ECSS-10 repository, the ecss-media-server package.

Before installation, it is recommended to remove the old versions of the media server along with the configuration, if they were installed earlier:

For example:

sudo apt purge ecss-media-server

To install in the Linux OS console, run the command:

sudo apt update
sudo apt install ecss-media-server

During the installation, it will be prompted to configure the parameters for the formation of the configuration file. The settings can be refused — the default configuration will be formed. In the future, it can be changed, the description is given below.

Customizing the MSR configuration file 

After media server installation, the XML configuration file is located under the path /etc/ecss/ecss-media-server/config.xml.

 Example of default file
<?xml version="1.0" encoding="utf-8"?>
<config date="10:48:15 21.02.2022">
  <general log-level="3" log-rotate="yes" max-calls="8192" max-in-group="512" load-sensor="media" load-delta="10" calls-delta="100" spool-dir-size="100M" log-name="msr.log" log-path="/var/log/ecss/media-server" use-srtp="disabled" suspicious-mode="no"/>
  <transport bind-addr="192.168.2.21" port="5040" transport="udp+tcp"/>
  <!-- By default configured public TURN-server -->
  <turn-server use-turn="no" host="numb.viagenie.ca" user="webrtc@live.com" password="muazkh"/>
  <media mixer-clock-rate="8000" use-vad="no" cng-level="0" jb-size="60" rtcp-timeout="0" rtp-timeout="350" udp-src-check="no" cn-multiplier="3" port-start="12000" port-range="2048" tias-in-sdp="no" thread-cnt="2" silence-threshold="-30" dtmf-flash-disable="no" video-dscp="0" other-dscp="0" dummy-video-src="/usr/share/ecss-media-server/video/dummy_video.yuv" video-enc-width="1280" video-enc-height="720" finalsilence="1000" rtcp-stat-dump="yes"/>
  <codec pcma="1" pcmu="2" ilbc="0" gsm="0" g722="3" g729="0" speex="0" l16="0" g7221="0" opus="0" h264="1" h263-1998="2" t38="1" tel-event-pt="0"/>
  <accounts>
    <!-- <dynamic msr_name="msr.name"
            realm="sip:127.0.0.1:5000"
            dtmf_mode="rfc+inband+info"
            auth_name="user"
            auth_password="password" /> -->
  </accounts>
  <pbyte>
    <mcc bind-addr="192.168.2.21" port="5700"/>
  </pbyte>
  <conf_dir path="/etc/ecss/ecss-media-server/conf.d"/>
  <rtp>
    <auto addr-v4=""/>
  </rtp>
</config>

where

  • general — general media server settings:
    • log-level — logs level. The higher the value the more information in the logs (default: "3");
    • log-rotate — log rotation (default: "no");
    • log-path — path to the logs directory;
    • log-name — logs file name;
    • spool-dir-size — size of the /var/spool/ecss/ecss-media-server directory intended for storing temporary fax files. If the specified value is exceeded, old files are deleted (by default — 100M). For more information, see Fine-tuning the system section;
    • max-calls — maximum number of calls simultaneously served by the media server (by default: "8192");
    • max-in-group — maximum number of subscribers in a group within the conference (by default: "512");

      If the Conference Call service is used with a large number of participants, then it is necessary to increase the value of this parameter. The maximum value is 4000.

    • load-delta — determines the relative change (comparison of the current load with the previous one) of the msr load (from 1 to 100), at which notifications about the current msr load are generated (no more than 1 time per second). The load factor is sent to each core via SIP PUBLISH with Event eltex-load-sensor, the Body contains the current msr load (by default — 10);
    • load-sensor — enabling the mechanism for informing the kernel about msr loading (by default — media);
    • use-srtp — using srtp ("disabled" rtp value is not used, "optional" — it will be possible to call with both rtp and srtp, "mandatory" only srtp will be used (rtp calls will not be accepted));
    • suspicious-mode — MSR will terminate when the Control channel connection is lost.
  • transport — transport settings:
    • bind-addr — IP address that the media server will use for SIP alarm (default: 127.0.0.1). This parameter must be configured according to the host network settings;
    • port — port number for SIP (default: 5040). If port 5040 is already occupied on the host where the media server is installed, then the value of this parameter must be changed;
    • transport — transport type (by default: udp+tcp), takes the values: udp, tcp, udp+tcp. This parameter does not require any changes.
  • media — параметры медиа:
    • imageattr-x — horizontal resolution of the video;
    • imageattr-y — vertical resolution of the video;
    • imageattr-q — video resolution preference.
    • mixer-clock-rate — frequency used by the media server internal mixer (default: 48000). This parameter is configured according to the network hardware capabilities. (For example, to support G.722 operation in HD mode, the parameter is set according to the sampling rate of this codec — 16000). The range of values is 8000-48000. If the value > 48000 is set, it will be set to 48000 (there will be a warning about this in syslog).

      • When installing ECSS-10 version 3.14, this parameter has a default value of 48000. This is done to support HD codecs, as well as confident speech recognition in services such as ivr, transcription, ASR.
      • Setting mixer-clock-rate = 48000 leads to an increase in CPU load, an increase in network traffic and the volume of recorded conversation files.
      • With a regular update, this parameter will not change by itself.
    • use-vad — enable Voice Activity Detection (default: "no"). This parameter does not require any changes;
    • udp-src-check — with the option enabled ("yes"), ECSS-10 will send media traffic to that IP:The port from which the transport call comes. Used for calls coming from behind NAT (default: "no");
    • cng-level — 0 — with the option enabled ("yes"), ECSS-10 will send media traffic to that IP:The port from which the transport call comes. Used for calls coming from behind NAT (default: "no");
    • cng-level — 0 — off, any other value will be substituted in the level field of the package. By default, "0" is specified in order to maintain backward compatibility.
    • jb-size — maximum delay in ms that will be introduced to maintain a continuous media stream;
    • echo-cancel-algo — algorithm used for echo compensation. Three algorithms are implemented: simple — simple echo barrier algorithm, the least preferred; speex — algorithm implemented in the speex codec slightly distorts the sound; webrtc — algorithm implemented in webrtc, used by default.
    • echo-cancel-aggr — parameter determines the aggressiveness of the echo compensation. (low — low; mid — medium; high — maximum (default));
    • echo-cancel-tail — length of the echo canceller buffer in milliseconds;
    • rtcp-timeout — if no RTCP media server arrives during this time period, then it can be assumed that the client is inactive (by default: "0" — not used). When using the control function, the control is activated only after receiving one RTCP packet from the opposite side;
    • rtcp-stat-dump — output of rtcp statistics to logs (by default: "yes" — used). It only works when the log level is higher than 2;
    • rtp-timeout — тайм-аут RTP-трафика, аналогично предыдущему параметру (по умолчанию: "0" — не используется);
    • cn-multiplier — multiplier to rtp-timeout, if the last received RTP packet was with comfort noise (default: "2");
    • port-start — start of the range of ports to be used for RTP streams (default: "12000");
    • port-range — range size (default: "1024");
    • tias-in-sdp — enabling/disabling the transfer of attribute b=TIAS/AS to offer SDP (default: "no");
    • thread-cnt — number of worker threads for processing media data (by default dtmf-to-total-energy: "2");
    • silence-threshold — Voicemail silence threshold level in dB (default: "-30" dB);
    • dummy-video-src — path to the video setup file (YUV420 format), which is displayed when there is no video stream (by default: "/usr/share/ecss-media-server/video/dummy_video.yuv");
    • video-enc-width и video-enc-height — all frames coming to the encoder with a width or height more than the data will be converted to this size. By default, they are set to 1280x720;
    • video-dscp — DCSP value for video (default is 0);
    • other-dscp — DCSP value for other media types (default is 0);
    • dtmf-hits-to-begin — (one hit is equal to 12.75 sec.) — number of consecutive detections of the same signal that is recognized in DTMF (by default — 2; possible values: 1..10);
    • dtmf-misses-to-end — (one miss is equal to 12.75 sec.) — number of consecutive detections of a NON-DTMF signal following the specified number of hits that recognized the DTMF signal (by default — 2; possible values: 1..10).
  • codec — codec priorities (1 — maximum, 255 — minimum, 0 — codec disabled). Supported codecs:
    • pcma
    • pcmu
    • ilbc
    • gsm 
    • g722
    • g722.1
    • g729
    • speex
    • l16
    • h264
    • h263-1998
    • t38
    • tel-event-pt
  • accounts — all accounts for media server registration. It can contain up to 32 acc elements;
  • dynamic — separate account with the following parameters:
    • msr_name — иMSR name displayed on ECSS;
    • realm — registration server in sip:domain format. The address of the SIP server for registering the media server is specified;
    • dtmf_mode — DTMF detection mode ("rfc", "inband", "info"). This parameter must be configured in accordance with the settings for sending DTMF on the subscriber device.
    • auth_name — user name used for authorization;
    • auth_password — password for authorization.
  • rtp — ip substitution mode in sdp:
    • auto  — automatic mode. Defines a common ip for all sdps, for example: <auto addr-v4="192.168.1.2" addr-v6="::1"/>;

    • manual — manual mode. Interface-ip pairs are set, for example: <manual name="bond1.2" addr-v4="192.168.1.2" addr-v6="::1">.
  • pbyte — configuring pbyte connections;
    • mcc — configuring media control channel control connection;
    • bind-addr — IP address where the connection will be expected;
    • port — port for incoming connections, (default: 5700).
  • conf_dir path — path to the folder where the MSR configurations will be stored. The configuration data will override the default config.xml configuration.
  • Do not use floating (keepalive) addresses for the media server.
  • Do not use 0.0.0.0 as a listen-ip.
  • If MSR was configured via a default config.xml file, then with the next update or configuration using dpkg-reconfigure, it will be completely overwritten with the default settings. Therefore, it is better to redefine the settings in a separate file, for example in /etc/ecss/ecss-media-server/conf.d/01-ecss-conf.xml.

Configuration file settings can be overrided in the following directories:

  1. /etc/ecss/ecss-media-server/conf.d for config.xml file;
  2. /etc/ecss/ecss-media-server/conf-without-video.d for config-without-video.xml file;
  3. In general — /etc/ecss/ecss-media-server/conf-<started_instance_name>.d for config-<started_instance_name>..xml file.

To do this, configuration files are created that are read in alphabetical order, for example:

<!-- 01-ecss-conf.xml -->
<?xml version="1.0" encoding="utf-8"?>
<config>
  <general log-level="666" />
  <accounts>
    <dynamic msr_name="some name" realm="sip:x.x.x.x:zzzz" 
        dtmf_mode="rfc+inband+info" auth_name="user1" auth_password="password123"/>
  </accounts>
</config>

<!-- 02-ecss-conf.xml -->
<?xml version="1.0" encoding="utf-8"?>
<config>
  <rtp>
    <auto name="1.1.1.1"/>
   </rtp>
</config>

As a result, the logging level should be redefined and an account will be added, and the ip substitution option in sdp is also enabled. When changing the configuration, it is necessary to restart the ecss-media-server service:

sudo systemctl restart ecss-media-server.service

Starting the media server

Starting media server as a service (by default)

To start, run:

sudo systemctl start ecss-media-server.service

To stop:

sudo systemctl stop ecss-media-server.service

To restart:

sudo systemctl restart ecss-media-server.service

Configuring ECSS-10 to work with the media server

Checking the control connection

The verification is carried out by the CoCon command

Command path:

/system/zmq/status

Syntax:

status [<ConnectionId>]

Parameters:

<connectionId> — ID of the control connection the status of which needs to be viewed.

Example:

ecss_zmq_transport connection status:
┌─────────────┬───────────┬─────────┬────────┐
│Connection ID│   Node    │ Status  │IsActive│
├─────────────┼───────────┼─────────┼────────┤
│c5b9d8       │core1@ecss1│connected│true    │
│             │core1@ecss2│connected│true    │
│22abcd       │core1@ecss1│connected│true    │
│             │core1@ecss2│connected│true    │
└─────────────┴───────────┴─────────┴────────┘

Configuring Registrar server parameters

The Registrar server is designed for registering dynamic media server accounts. By default, the registrar listens to requests on all network interfaces (0.0.0.0). It is recommended to choose a specific one.

Parameters are set by the CoCon command system/media/registrar/set. See description:

admin@ds1@ecss1:/$ system/media/registrar/set -h
Set common and private properties of registar.

  To set common properties, usage:

    set common <property> <value>

      <property> :: registration-timeout - integer, 60..86400, registration timeout;
      <value>    :: property value (format described above).

  To set private properties on node, usage:

    set private <node> <property> <value>

      <node>     :: string, name of node;
      <property> :: is-active   - true | false, registrar activity;
                    listen-ip   - string,       registrar listen ip;
                    listen-port - integer,      registrar listen port;
      <value>    :: property value (format described above, depended on <property>).

  Example:
    admin@[md1@IBM]:/$ system/media/registrar/set private core1@IBM listen-port 5000
    Private parameter listen-port set to 5000 at node core1@IBM.

Example:

admin@ds1@ecss1:/$ system/media/registrar/set private core1@ecss1 listen-ip 192.168.2.21
Private parameter listen-ip set to 192.168.2.21 at node core1@ecss1.

Adding media resources 

Media resources are declared by the /system/media/resource/declare command. See description:

admin@ds1@ecss1:/$ man /system/media/resource/declare
Declare resource on node.

  To declare resource by contact, usage:

    declare <node> contact <contact> <zone> <site> <is-active>

      <node>      :: string,       name of node;
                     *,            all available nodes;
      <contact>   :: string,       msr contact;
      <zone>      :: string,       resource zone;
      <site>      :: string,       resource site;
      <is-active> :: true | false, resource activity.

  To declare resource by iface, usage:

    declare <node> iface <msr> <iface> <zone> <site> <is-active>

      <node>      :: string,       name of node;
                     *,            all available nodes;
      <msr>       :: string,       name of msr;
      <iface>     :: string,       name of network interface;
      <zone>      :: string,       resource zone;
      <site>      :: string,       resource site;
      <is-active> :: true | false, resource activity.

Example:

admin@ds1@ecss1:/$ /system/media/resource/declare core1@ecss1 iface msr_1 bond1.3 default local true
  Declared media resources
┌─────────────┬───────────────┬────────┬─────────┬───────┐
│    Node     │    Contact    │ Active │   Zone  │  Site │
├─────────────┼───────────────┼────────┼─────────┼───────┤
│ core1@ecss1 │ bond1.3@msr_1 │ true   │ default │ local │
└─────────────┴───────────────┴────────┴─────────┴───────┘

The list of active media resources is output by the list command:

admin@ds1@ecss1:/$ /system/media/resource/list                                                      
  Active media resource selected list specific:
┌─────────────┬───────┬────────────┬───────────┬──────┬────────┬───────────┬───────────┬───────────────────┬─────────┬──────────────┬────────┬─────────┬───────┬───────────────┬────────────┬─────────┐
│    Node     │  MSR  │    MSR     │    MSR    │ MSR  │ Cc-id  │ Cc-status │ Cc-uptime │    Cc-address     │  Iface  │    Iface     │ Active │  Zone   │ Site  │    Contact    │   Status   │ Expired │
│             │       │  version   │ perf coef │ load │        │           │           │                   │  name   │     addr     │        │         │       │               │            │         │
├─────────────┼───────┼────────────┼───────────┼──────┼────────┼───────────┼───────────┼───────────────────┼─────────┼──────────────┼────────┼─────────┼───────┼───────────────┼────────────┼─────────┤
│ core1@ecss1 │       │            │       1.0 │    0 │        │           │           │                   │         │              │ true   │ default │ local │ bond1.2@msr_2 │            │         │
│             │ msr_1 │ 3.14.11.36 │       1.0 │    0 │ 22abcd │ connected │ 00:09:01  │ 192.168.2.21:5700 │ bond1.2 │ 192.168.2.21 │ true   │ default │ local │ bond1.2@msr_1 │ registered │      87 │
│             │       │            │           │      │        │           │           │                   │ bond1.3 │ 192.168.1.21 │ true   │ default │ local │ bond1.3@msr_1 │ registered │      89 │
└─────────────┴───────┴────────────┴───────────┴──────┴────────┴───────────┴───────────┴───────────────────┴─────────┴──────────────┴────────┴─────────┴───────┴───────────────┴────────────┴─────────┘
  • Нет меток