5. Smarty integration with external systems and services

5.1. API для разработчиков

Актуальная документация по API-методам в базе знаний продукта на сайте: https://microimpuls.com/docs/smarty/extra/api

5.1.1. Примеры кода

Note

See also other additional tools:

5.2. Интеграция с биллинговой системой

Актуальная документация о возможностях интеграции с внешним биллингом оператора в базе знаний продукта на сайте https://microimpuls.com/docs/smarty/external-billing-integration

5.3. Embedding modules in the website

Актуальная документация по интеграции виджетов на сайт: https://microimpuls.com/docs/smarty/extra-services-integration/site-widgets

5.4. Integration with popular video-servers

5.4.1. Integration with Astra

To integrate the authentication mechanism of video streams (streaming) with Astra is a mechanism for generating one-time tokens for the links to the stream on the server side Smarty. Astra at the time of parsing HTTP Request from the subscriber device selects a token and checks it on the server, the Smarty validity.

Для генерации токена необходимо в маске URL стриминг-сервиса в Smarty добавить переменную $token в маску URL, например:

http://streamer.example.com:8080/mychannel/?token=$token

5.4.2. Интеграция с Flussonic

Для интеграции механизма авторизации видеопотоков (стриминг-сервисов) с Flussonic используется механизм генерации одноразовых токенов для ссылок на поток на стороне сервера Smarty. Flussonic в момент разбора HTTP Request от абонентского устройства выделяет токен и проверяет его на сервере Smarty на валидность.

Для генерации токена необходимо в маске URL стриминг-сервиса в Smarty добавить переменную $token в маску URL, например:

http://streamer.example.com:8080/mychannel/?token=$token

На стороне Flussonic необходимо настроить авторизационный бекенд, указав адрес API-метода StreamServiceTokenCheck на стороне Smarty:

auth_backend main {
    backend https://smarty.example.com/tvmiddleware/api/streamservice/token/check/;
}

и в свойствах канала прописать параметр auth:

stream example {
    url hls://example.com/channel/index.m3u8;
    title "Channel Name";
    auth auth://main;
}

5.4.2.1. Настройка маски URL для архивных записей

Для корректной работы функционала постановки Live-трансляций на паузу и перемотки назад из Live необходимо использовать следующий шаблон URL:

http://<host>/$cid/video-$flpbt-$flpdur.m3u8?token=$token

5.5. Integration with online cinemas

5.5.1. Integration with MEGOGO

Smarty contains a module for integration with online cinema MEGOGO <http://megogo.net>`_, which includes the following functionality:

  • Sync movies MEGOGO with built-in video library Smarty (title, description, genre, cover, etc.)
  • The subscription model (SVOD)
  • The model of purchasing individual movies and series (TVOD)
  • All the standard functions built-in video library Smarty (search, filtering, sorting, grouping by genre, etc.)
  • Transparent integration in standard applications Microimpuls on different devices - a single interface for viewing live TV and VOD and other services familiar to the subscriber

5.5.1.1. Configuration of the module megogo

To connect integration MEGOGO need to do the following steps:

  • Connect module megogo Smarty configuration in the section of INSTALLED_APPS, restart Smarty and migrate data.
  • Create a hidden tariff package that will be used for the access of subscribers to the catalog and purchase TVOD or SVOD subscription. This subscription package will automatically be enabled for all imported films in order to be visible in the directory.
  • To create a tariff package that will be used for subscription movies. When buying SVOD-subscription this package will connect to the subscriber in Smarty, and if you disable the package will be unsubscribing from the SVOD package.
  • In the admin panel under “General settings” -> “API Integration with external systems” to create a new external system:
    • specify the name (for example, MEGOGO)
    • choose from the drop down list class API megogo_api_client
    • choose the tariff package that you created in the second step. Subscribers who have connected to this tariff package will see the videos and be able to buy them (on a subscription or transactional, depending on the settings of the film in MEGOGO)
  • To specify additional attributes of the external system:
    • mobile_private_key - the private key for mobile devices (available MEGOGO)
    • mobile_public_key - the public key for mobile devices (available MEGOGO)
    • smart_tv_private_key - the private key for Smart TV (available MEGOGO)
    • smart_tv_public_key - the public key for Smart TV (available MEGOGO)
    • stb_private_key - the private key for STB (available MEGOGO)
    • stb_public_key - the public key for STB (available MEGOGO)
    • partner_id - the partner ID (provided MEGOGO)
    • salt - the key used to generate authorization request to billing (available MEGOGO)
    • svod_service_id - the identifiers of the SVOD service, which is used for processing of the service user (provided MEGOGO)
    • available_tvod_collection_id - the ID of the collection to get available TVOD-objects (available MEGOGO)
    • tariff_id - the identifier of the tariff package that you created in step 3 which will be connected to the subscriber when activating the subscription. The connectivity of this package means you subscribe to a corresponding package of SVOD in MEGOGO. If you disable this package, the subscriber/account is in Smarty, the method will be called automatically unsubscribe from SVOD in MEGOGO.
    • additional_tariffs_ids - IDs mixed tariff packages (unifying channels and subscription MEGOGO), separated by commas. When you connect one of these rates will be added to the subscription MEGOGO as well as for tariff_id. If you disable all of these packages will be unsubscribing from MEGOGO as well as for tariff_id.
    • ignore_customer_balance_check - при значении 1 при покупке контента не будет проверяться баланс абонента. Необходимо при интеграции покупок с внешней биллинговой системой оператора.
    • typhoid_comment_category_id - идентификатор жанра-категории, присваиваемый фильму, если он является фильмом с тифлокомментариями. Если данный атрибут указан и фильм имеет тифлокомментарии, то другие категории для него указаны не будут.
    • sign_language_category_id - идентификатор жанра-категории, присваиваемый фильму, если он является фильмом с сурдопереводом. Если данный атрибут указан и фильм имеет сурдоперевод, то другие категории для него указаны не будут.

After completing all the steps required to synchronize mirrored via miracast ™ with the help of management team:

python manage.py megogo_sync_content --settings=settings.<settings filename>

Первая синхронизация может занять около получаса в связи со скачиванием обложек, последующие синхронизации проходят быстрее. Для регулярной синхронизации фильмов необходимо добавить вызов команды в crontab. Помимо синхронизации фильмов эта команда также создает подборки контента из базы MEGOGO для импортированных фильмов.

Для команды megogo_sync_content можно указать флаг --load_actor_info для загрузки данных об актёрах со стороны сервиса MEGOGO, однако это потребует больше времени для синхронизации.

After the first synchronization will be created go to the movies MEGOGO. Then you can follow final steps:

During a subsequent synchronization of the films will be binding genres.

Note

For buying movies available in TVOD, each key must be connected to the service side MEGOGO.

5.5.2. Интеграция с tvzavr (deprecated)

Note

Кинотеатр tvzavr более недоступен в рамках Smarty по причине его официального закрытия.

Smarty contains a module for integration with online cinema tvzavr <http://tvzavr.ru>`_, which includes the following functionality:

  • Sync movies and TV series tvzavr.ru with built-in video library Smarty (title, description, genre, cover, etc.)
  • The subscription model (SVOD)
  • All the standard functions built-in video library Smarty (search, filtering, sorting, grouping by genre, etc.)
  • Transparent integration in standard applications Microimpuls on different devices - a single interface for viewing live TV and VOD and other services familiar to the subscriber

5.5.2.1. Configuration of the module tvzavr

To connect integration tvzavr need to do the following steps:

  • Connect module tvzavr Smarty configuration in the section of INSTALLED_APPS, restart Smarty and migrate data.
  • Create a hidden tariff package that will be used for the access of subscribers to the SVOD catalogue. This subscription package will automatically be enabled for all imported films in order to be visible in the directory.
  • To create a tariff package that will be used for subscription movies. When buying SVOD-subscription this package will connect to the subscriber in Smarty, and if you disable the package will be unsubscribing from the SVOD package.
  • In the admin panel under “General settings” -> “API Integration with external systems” to create a new external system:
    • specify the name (for example, tvzavr)
    • choose from the drop down list class API tvzavr_api_client
    • choose the tariff package that you created in the second step. Subscribers who have connected to this tariff package will see the videos and be able to purchase them.
  • To specify additional attributes of the external system:
    • tvzavr_tariff_id - the value of this parameter gives tvzavr
    • plf - the value of this parameter gives tvzavr
    • secret - the value of this parameter gives tvzavr
    • subscription_tariff_id - the identifier of the tariff package that you created in step 3 which will be connected to the subscriber when activating the subscription. The connectivity of this package means you subscribe to a corresponding package of SVOD in tvzavr. If you disable this package, the subscriber/account is in Smarty, the method will be called automatically unsubscribe from SVOD in tvzavr.

After completing all the steps required to synchronize mirrored via miracast ™ with the help of management team:

python manage.py tvzavr_sync_content --settings=settings.<settings filename>

The first synchronization can take up to an hour in connection with the download of the skins, subsequent syncs are faster. For regular sync of movies, you must add the command to crontab.

After the first synchronization will be created go to the movies tvzavr. Then you can follow final steps:

During a subsequent synchronization of the films will be binding genres.

Note

For to order the subscription was renewed on the server side, tvzavr, you must also schedule a select team check_accounts.

5.5.3. Интеграция со Start

Актуальная документация: https://micro.im/docs/smarty/external-vod-integration/start

5.5.3. Интеграция со PREMIER

Актуальная документация: https://micro.im/docs/smarty/external-vod-integration/premier

5.6. Integration with CAS CMS

Smarty supports integration with certain systems CAS model unified management system subscriptions with portal applications and customers for set-top boxes and other devices support operation with any CAS that are supported by a specific device.

5.6.1. Integration with Irdeto

Integration settings are specified in the configuration file Smarty:

IRDETO_NATIONALITY str
Default value: ‘ENG’
IRDETO_REGION_TAG str
Default value: ‘MO’
IRDETO_HOST str
Server address Irdeto with the SOAP API, by default ‘http://127.0.0.1:80

5.7 Интеграция с платежными системами

Актуальная документация: https://microimpuls.com/docs/smarty/payments-integration

5.7.1. Интеграция с Payture

Актуальная документация: https://microimpuls.com/docs/smarty/payments-integration/payture

5.8. Дополнительные инструменты

The script is smarty data migration between databases on client_id
https://github.com/microimpuls/admin-tools/tree/master/smarty_migrate_tool
The migration script with the OFT Middleware Middleware Microimpuls
https://github.com/microimpuls/admin-tools/tree/master/oft_db_migrate_tool
The migration script accounts and MAC addresses with Billing in the Hydra Middleware Microimpuls
https://github.com/microimpuls/admin-tools/tree/master/hydra_migrate
Script to bulk create accounts through the Billing API
https://github.com/microimpuls/admin-tools/tree/master/mass_customer_creator

Note

Other useful scripts and utilities, see Microimpuls repository on Github: https://github.com/microimpuls/admin-tools