Перейти к содержимому

Integration with Ministra (Stalker) Middleware

Это содержимое пока не доступно на вашем языке.

Ministra TV Platform (formerly Stalker Middleware) manages subscribers, set-top boxes and the channel list. Alta delivers the channels and the TV archive. Ministra talks to Alta the same way it talks to Flussonic: it adds a temporary token to every channel link, and Alta checks the token with Ministra before the playback starts.

This article shows how to connect Alta to Ministra step by step: live channels with temporary links, TV archive (catch-up) and timeshift.

Alta and Ministra interaction

  1. A subscriber opens a channel on the set-top box.
  2. Ministra creates a temporary token and returns the channel link with this token: http://alta.example.com:8102/demo/index.m3u8?token=41771f02a48d1fef09eebe9f0efdaeb8
  3. The box requests the playlist from Alta.
  4. Alta sends the token to Ministra: http://stalker.example.com/stalker_portal/server/api/chk_flussonic_tmp_link.php?token=...
  5. Ministra answers 200 OK if the token is valid, or 403 Forbidden otherwise.
  6. Alta returns the playlist and the stream to the box, or 403 Forbidden.

The token is checked once, when the playlist is requested. After that the box plays the stream within its Alta session. By default a live token lives 5 seconds: the box receives a new token every time it opens a channel. Tokens for the TV archive live 8 hours.

For the TV archive Ministra uses the Flussonic DVR link format. Alta supports it out of the box:

FeatureLink created by Ministra
Livehttp://<alta>:<port>/<path>/index.m3u8?token=...
Timeshift (from the start of the current hour)http://<alta>:<port>/<path>/index-<start>-now.m3u8?token=...
Catch-up (program from the EPG)http://<alta>:<port>/<path>/archive-<start>-<duration>.m3u8?token=...

Read more about these links in URL Format for HLS Access.

  • Set-top boxes can reach the Alta OTT server port (8102 in this example).
  • Alta can reach Ministra over HTTP (port 80 by default).
  • For the TV archive: a storage in Alta and an EPG for the channels in Ministra.

In this article:

Address
Alta OTT serverhttp://alta.example.com:8102
Ministrahttp://stalker.example.com/stalker_portal/
Channel path in Altademo

Go to Receivers → Create and add the source of the channel. Read more in Receivers.

Alta: create receiver

The storage is required for the TV archive and timeshift. Skip this step if you need live channels only.

Go to Settings → Storages → Create:

  • Name: archive
  • Duration: archive depth in hours, for example 24
  • Location: directory for the archive, for example /var/lib/alta/archive

Alta: create storage

Go to Settings → Authorizers → Create:

  • Name: stalker
  • Default: Deny
  • Backends → Add Backend: http://stalker.example.com/stalker_portal/server/api/chk_flussonic_tmp_link.php

Alta: create authorizer

Go to Channels → Create:

  • Enable: on
  • Path: demo. The channel is available at http://alta.example.com:8102/demo/index.m3u8
  • Name: Demo Channel
  • Variants → main: enable and select the receiver
  • Authorizer: stalker
  • Storage & Duration → Storage: archive (for the TV archive)

Alta: create channel

Check that the channel is protected. Without a token Alta answers 403 Forbidden:

Terminal window
curl -I http://alta.example.com:8102/demo/index.m3u8
HTTP/1.1 403 Forbidden

Skip this step if you need live channels only.

Go to Storage → Storage list → Add storage:

  • Title: alta
  • IP: address and OTT port of Alta, without http://: alta.example.com:8102
  • Apache port: 8102. The field is required, but it is not used for Flussonic DVR
  • Maximum of users: for example 1000. If the field is empty, set-top boxes get the error limit when they open the archive
  • Additional information → Allow TV recording: Flussonic DVR

Ministra: add storage

Go to IPTV channels → Channels → Add a channel.

Basic:

  • Channel number, Channel name, Genre
  • Basic channel: turn it on if you do not use tariff plans. Otherwise add the channel to a service package, or subscribers will not see it

Streaming links → Add link:

  • Channel URL: ffmpeg http://alta.example.com:8102/demo/index.m3u8
  • Temporary URL: Flussonic

Ministra: streaming link

Click Save in the link dialog. The link appears in the Streaming links table with Temporary HTTP-link On:

Ministra: channel basic settings

TV archive:

  • TV archive type: Flussonic DVR
  • Archive servers: alta
  • TV archive address: the channel address in Alta, without ffmpeg: http://alta.example.com:8102/demo/index.m3u8. Ministra builds the archive links from it
  • TV archive length: archive depth in hours, the same as the storage duration in Alta, for example 24

EPG:

  • XMLTV ID: channel ID in your XMLTV source. Catch-up works only for programs from the EPG

Ministra: TV archive

Click Save.

Add a subscriber with the MAC address of the set-top box in Users → Users list → Add user, or use your existing subscribers.

  1. Open the channel on a set-top box. The channel plays.
  2. In Alta open Sessions: the session of the box is in the list.
  3. Open the TV archive on the box and play a program from the past.

To check the connection between Alta and Ministra, run this command on the Alta server:

Terminal window
curl -I "http://stalker.example.com/stalker_portal/server/api/chk_flussonic_tmp_link.php?token=test"

403 Forbidden means Ministra is reachable and rejects the unknown token, as expected.

  • Check the backend address in the Alta authorizer with the curl command above.
  • Check that Temporary URL of the channel link in Ministra is Flussonic. Without it Ministra does not add the token.
  • The token lives 5 seconds. A player that opens the same link later gets 403. The time is set with the tv_tmp_link_ttl option in the Ministra custom.ini.

Alta writes denied requests to the log:

Terminal window
journalctl -u alta | grep "Authorization denied"

The channel list on the set-top box is empty

Section titled “The channel list on the set-top box is empty”

Turn on Basic channel for the channel or add it to a service package of the subscriber tariff plan.

Set Maximum of users of the archive server in Ministra.

Ministra uses the PHP time zone (default_timezone in custom.ini) and the MySQL time zone to calculate program times. If they differ, the archive links point to a wrong time range. Set the same time zone for PHP and MySQL.