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
- After installation, the media server starts with the initial settings set at the installation stage.
- 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.
- 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.
- 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.
- 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
- A separate SIP UA is formed for each network interface.
- 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.
- Information about the announced network interface is transmitted to the REGISTER via the From field. Network interface parameters are passed through the following fields:
- P-Eltex-MSR-Iface-Name;
- P-Eltex-MSR-Iface-Addr;
- P-Eltex-MSR-Acc-Id;
- P-Eltex-MSR-CC-Addr (service only);
- P-Eltex-MSR-CC-Port (service only);
- P-Eltex-MSR-Name.
- Cc-status, Cc-id & Cc-address (Control channel status, Control channel id & Control channel address) are generated only for the service interface;
- 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).
- 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
- 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).
- Signal traffic from media servers is processed by a SIP server, which is embedded to the core and processed in the service VLAN-X.
- Registrar functionality:
- receiving registration requests from media servers service subscribers;
- authentication of the UA that sent the registration request (by the local table of subscribers);
- authorization of the UA that sent the registration request (according to the local restrictions table);
- installation and support of the specified settings of the registration expiration period;
- 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);
- receiving correct registration requests (correct RURI and authentication). Traffic maintenance on a registered resource begins if it is fully configured and not administratively blocked;
- 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;
- 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.
- SIP server functionality:
- installing SIP sessions with the selected account;
- support for installed SIP sessions (reINVITE mechanism);
- notification of the SIP session collapse facts on the initiative of the MSR (or in case of loss of communication with the MSR).
- Control channel management functionality:
- installation and support of control channels one to each media server
- collapse of the control channel in case of refusal to register the media server;
- 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.
- 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:
- /etc/ecss/ecss-media-server/conf.d for config.xml file;
- /etc/ecss/ecss-media-server/conf-without-video.d for config-without-video.xml file;
- 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 │ └─────────────┴───────┴────────────┴───────────┴──────┴────────┴───────────┴───────────┴───────────────────┴─────────┴──────────────┴────────┴─────────┴───────┴───────────────┴────────────┴─────────┘