RBT - rosteleset/SmartYard-Server GitHub Wiki
A: Suppose RBT has internal 192.168.0.1 host and can reach FRS at 192.168.0.2 host. In this case you have to replace localhost with 192.168.0.2 in the FRS configuration file located in the /opt/frs directory:
;Частичный URL для скриншотов со слэшем на конце
http_server_screenshot_url=http://192.168.0.2:9051/static/screenshots/
;Частичный URL для скриншотов событий (вызов API метода bestQuality) со слэшем на конце
http_server_events_url=http://192.168.0.2:9051/static/events/
Restart FRS.
In RBT server configuration file (config.json):
- inside "api"->"internal" replace 127.0.0.1 with 192.168.0.1
- inside "frs" section replace 127.0.0.1 with 192.168.0.2
In nginx configuration file add permission for FRS and RBT's internal address to access internal.php like this:
location = /internal.php {
allow 127.0.0.1;
allow 192.168.0.1;
allow 192.168.0.2;
deny all;
root /opt/rbt/server;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
Reload nginx config.
A: Please follow these steps:
- If you haven't built the FALPRS project yet, please do so using these instructions.
- Use these instructions for importing data from the old FRS project.
- Update RBT server config in /opt/rbt/server/config.json file. In frs->servers section add api attribute with value frs and replace value of url attribute to like http://127.0.0.1:9051/frs/api/. For more information see instructions in /opt/rbt/server/config.sample.json5 file.
A: Suppose RBT has internal 192.168.0.1 host and can reach FALPRS at 192.168.0.2 host. In this case you have to replace localhost with 192.168.0.2 in the FALPRS configuration YAML file located in the /opt/falprs directory:
frs-workflow:
config:
screenshots-url-prefix: 'http://192.168.0.2:9051/frs/screenshots/' # Web URL prefix for faces screenshots
lprs-workflow:
config:
screenshots-url-prefix: 'http://192.168.0.2:9051/lprs/' # Web URL prefix for events' screenshots
Restart FALPRS.
In RBT server configuration file (config.json):
- inside "api"->"internal" replace 127.0.0.1 with 192.168.0.1
- inside "frs" section replace 127.0.0.1 with 192.168.0.2
In nginx configuration file add permission for FALPRS and RBT's internal address to access internal.php like this:
location = /internal.php {
allow 127.0.0.1;
allow 192.168.0.1;
allow 192.168.0.2;
deny all;
root /opt/rbt/server;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
Reload nginx config.
A: In RBT server configuration file (config.json) inside "frs"->"servers" section add new object and set attributes, for example:
{
"api": "lprs"
"title": "LPRS server",
"url": "http://127.0.0.1:9051/lprs/api/"
}
See the corresponding question/answer in the FALPRS section if you have RBT and FALPRS on different servers.
A: Supported cameras
Vendor | Model | Recommended FW |
---|---|---|
Brovotech |
IPC-MG7-5x60 IPC-MG7-3x60 |
Any stable |
A: Please follow the instructions below:
- Add a camera and set Model that RBT supports for license plate recognition, set Credentials, set Name. For the Recognition Server parameter, from the drop-down list, specify the one that contains "api"="lprs" in the RBT config. FRS mode has three options: Off, Recognition, Detection. Off means that recognition is disabled. Recognition means that only registered license plates can open the gate or barrier. Detection means that any recognized vehicle number can open a gate or barrier (for example, any vehicle is allowed to leave the territory).
- Click the Add button. The new camera should appear in the list.
- Set the area in which license plates will be recognized. Find your camera in the list and click Change button. Choose Recognition tab and set an area. For example:
- Click the Change button.
A: Go to the flat settings and select the Cars tab. Enter one license plate number on each line, using numbers and capital letters of the English alphabet without any punctuation marks or spaces. Currently, Russian registration plates of type 1 (ГОСТ Р 50577-93) and 1А (ГОСТ Р 50577-2018) are supported. Once you have finished entering, click the Change button. For example:
A: Find your intercom camera in the Cameras list and click Change button. Choose Detection tab and set the rectangular area at the bottom of the image. For example:
A: In Extended tab of the camera set:
{
"flag-process-special": true
}
A: It is known that Rubetek takes a long time to give a snapshot and it has a small resolution. You need to specify the parameters for the face recognition system in the advanced settings of the intercom camera. Find your intercom camera in the Cameras list and click Change button. Choose Extended tab and set:
{
"blur": 100,
"capture-timeout": 5,
"delay-between-frames": 0.001
}
More information about video stream parameters can be found in the API documentation.
Important
The intercom that you are adding to the system for the first time MUST be reset to factory settings!
API listens on port 85, so your URL will be http://<ip_address>:85
When using firmware older than version 2024.08, manual configuration of the discrete output logic is required (custom situation command -> Switch OFF). Do this before adding intercom to RBT!
- URL - Cloud API URL (usually https://api.sputnik.systems/query/). At the end, you need to add the device serial number (motherboard ID).
- Credentials - your JWT token.
Main tab
For city cameras, the Name field has the format: camera name/installation address. In the mobile application, it is shown on two lines.
Secondary tab
Geo coordinates: Latitude,longitude for positioning on the map
Common: enable camera in "City Cameras" on mobile app
Edit server config: server/config/config.json
"mobile": {
---
"city_cams": true,
---
},
Show "City Cameras" in mobile app
List of cameras on map
Live camera view with the ability to request recording
- Modify server config /opt/rbt/server/config/config.json
add stub url from your media server
"dvr": {
"backend": "internal",
"servers": [...],
"stub": {
"payment_require_url": "https://video.server.hostname:8443/stub_payment_require",
"service_url": "https://video.server.hostname:8443/stub_service",
"fallback_url": "https://video.server.hostname:8443/fallback"
}
}
- flat is blocked - replace stream to stub "payment_require_url".
- IP camera is disabled in the admin panel - replace stream to stub "service_url"
- DVR stream is specified incorrectly - replace stream to stub "fallback_url". User made a mistake when adding the url or this field is empty.
...
"dvr": {
"backend": "internal",
"servers": [
{
"title": "First server",
"type": "flussonic",
"url": "https://video.server.hostname:8443",
"token": "EexioRahKua9ohKeboox5Se4Beenieca",
"hlsMode": "mpegts"
}
],
"stub": {
"payment_require_url": "https://video.server.hostname:8443/stub_payment_require",
"service_url": "https://video.server.hostname:8443/stub_service",
"fallback_url": "https://video.server.hostname:8443/fail"
}
},
...
# Global settings:
http 8080;
https 8443;
nvidia_monitor false;
edit_auth username example_pass;
auth_backend rbt-auth {
allow token EexioRahKua9ohKeboox5Se4Beenieca;
}
# DVRs:
dvr raid0 {
root /mnt/raid0;
raid 0;
limits 95% 3h;
metadata idx;
disk disk0;
}
# Stream templates:
template t1 {
prefix rbt-demo;
on_play auth://rbt-auth;
meta comment "Example stream template, storage 3h and auth";
dvr @raid0 3h;
}
# Ingest streams:
stream rbt-demo-000001 {
template t1;
disabled false;
input rtsp://admin:[email protected]/av0_0;
title "Beward test camera";
meta comment "Beward test camera";
source_timeout 42;
}
- Get API key from https://dadata.ru
- Edit server config:
...
"geocoder": {
"backend": "dadata",
"token": "DADATA_API_KEY",
"locations": [
{"country_iso_code": "RU"},
{"country_iso_code": "BY"},
{"country_iso_code": "UZ"}
...
]
},
...
This section describes what minimal changes need to be made to the server and client configuration in order for issues to work through the mobile application.
In mobile section add:
"issues_version": "2"
In backends section add configuration parameters, replacing where required with your values (i.e mqtt, tt_url and later tt_token):
"tt": {
"backend": "mongo"
},
"tt_journal": {
"backend": "clickhouse"
},
"files": {
"backend": "mongo"
},
"cs": {
"backend": "internal"
},
"mqtt": {
"backend": "internal",
"agent": "http://127.0.0.1:8082/broadcast",
"ws": "wss://YOUR-RBT-SERVER/mqtt",
"mqtt": "mqtt://127.0.0.1:1883",
"username": "rbt",
"password": "YOUR-MQTT-PASSWORD"
}
"groups": {
"backend": "internal"
},
"issue_adapter": {
"backend": "teledom",
"tt_url": "https://example.com/frontend/tt",
"tt_token": "<!-- your app_user token --!>",
"anti_spam_interval": 86400,
"requestCallback" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Запрос обратного звонка",
"catalog": "Обратный звонок",
"assigned": "callcenter"
},
"requestFragment" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Запрос видео фрагмента",
"catalog": "Видео фрагмент",
"assigned": "cctv-managers"
},
"removeAddress" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Удаление адреса из приложения",
"catalog": "Работа с адресами",
"assigned": "callcenter"
},
"connectServicesNoCommon" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Подключение услуг (нет общедомовых)",
"catalog": "Услуги",
"assigned": "callcenter"
},
"connectServicesHasCommon" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Подключение услуг (есть общедомовые)",
"catalog": "Услуги",
"assigned": "callcenter"
},
"connectServicesNoNetwork" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Подключение услуг (нет присутствия)",
"catalog": "Услуги",
"assigned": "callcenter"
},
"requestQRCodeOffice" : {
"project": "APP",
"workflow": "Mobile",
"subject": "QR-код",
"catalog": "Услуги",
"assigned": "office",
"_cf_qr_delivery": "Самовывоз"
},
"requestQRCodeCourier" : {
"project": "APP",
"workflow": "Mobile",
"subject": "QR-код",
"catalog": "Услуги",
"assigned": "office",
"_cf_qr_delivery": "Курьер"
},
"requestCredentials" : {
"project": "APP",
"workflow": "Mobile",
"subject": "Напоминание логина/пароля",
"catalog": "Договор",
"assigned": "callcenter"
}
},
In client config these modules should be included:
"modules": [
"mqtt",
"tt",
"cs",
"map",
"users",
"groups",
"permissions",
"about",
"geocoder",
"addresses"
],
In command line run:
php /opt/rbt/server/cli.php --init-tt-mobile-template
In the web interface of RBT find persistent token of the app_user and set it's value as tt_token parameter in server config.
Example clent config
{
"defaultServer": "https://smart-yard-server.com/frontend",
"defaultLanguage": "ru",
"languages": {
"ru": "Русский",
"en": "English"
},
"modules": [
"asterisk",
"addresses",
"about"
],
"asterisk": {
"ws": "wss://smart-yard-server.com/wss",
"ice": [
{
"urls": [ "stun:stun.l.google.com:19302" ]
}
],
"sipDomain": "smart-yard-server.com:5066"
},
"map": {
"tile": "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
"crs": "EPSG3857",
"default": {
"lat": 51.505,
"lon": -0.09,
"zoom": 13
},
"min": 4,
"max": 18
},
"regExp": {
"phone": "^(7 \\(\\d{3}\\) \\d{3}-\\d{2}-\\d{2}|7\\d{10})$",
"rfid": "^[0-9A-F]{14}$" // RFID serial number regexp "00000000ABCDEF"
},
"defaultRoute": "#about",
"logo": "rbt",
"phonePattern": "7 (###) ###-##-##",
"printServer": "https://smart-yard-server.com/print"
}
- Create intercom
- Create IP camera
- Add address
-
Make entrances use previously created entities (intercom and camera)
-
Add flats
example 12 floors, 4 apartments per floor
add single flat:
set entrances for this flat
- Add mobile subscribers for flat
- Add RFID keys
Example for https://talk-me.ru
Edit server config:
server/config/config.json
"mobile": {
"web_server_base_path": "https://rbt-demo.lanta.me",
"payments": true,
"payments_url": "https://rbt-demo.lanta.me/example/domofon/index.html",
"city_cams": true,
"support_phone": "88002220374,
"chat": true,
"chat_url": "https://chat.integracio.ru/EXAMPLE_SECURE_TOKEN/rbt-demo.lanta.me/ru",
"phonePattern": "7 (###) ###-##-##",
"tt_project": "TDM",
"tt_workflow": "mobile",
"tt_user": "mobile",
"time_zone": "Europe/Moscow",
"guest_access": "turnOnOnly",
"issues_version": "2"
},
Example for talkMe https://talk-me.ru/
Edit server config:
server/config/config.json
"mobile": {
"web_server_base_path": "https://rbt-demo.lanta.me",
"payments": true,
"payments_url": "https://rbt-demo.lanta.me/example/domofon/index.html",
"city_cams": true,
"support_phone": "88002220374,
"chat": true,
"talk_me_id": "EXAMPLE_TALKME_CHAT_ID",
"talk_me_domain": "rbt-demo.lanta.me",
"talk_me_token": "EXAMPLE_TALKME_TOKEN",
"phonePattern": "7 (###) ###-##-##",
"tt_project": "TDM",
"tt_workflow": "mobile",
"tt_user": "mobile",
"time_zone": "Europe/Moscow",
"guest_access": "turnOnOnly",
"issues_version": "2"
},
Enable logs, edit file and restart asterisk service /etc/asterisk/logger.conf
[logfiles]
fail2ban.log => notice
full.log => debug,error,notice,verbose,warning
Reload logger after modify config:
asterisk -x "logger reload"
Enable PBX logs, edit file /etc/asterisk/config.lua
set log.outfile
realm = "rbt"
dm_server = "http://127.0.0.1/asterisk/extensions"
redis_server_host = "127.0.0.1"
redis_server_port = 6379
redis_server_auth = "qqq"
log.outfile = "/var/log/asterisk/pbx_lua.log"
trunk = "first"
lang = "ru"
Reload module after modify config:
asterisk -x "module reload pbx_lua"
edit flat, set "door opening code" to 00000
for hide this feature in mobile app
- Install fail2ban
- Configure asterisk logs
- Edit jail: /etc/fail2ban/jail.local
[DEFAULT]
maxretry = 4
findtime = 10
bantime = 720
action = firewallcmd-ipset
ignoreip = 127.0.0.1/8
[asterisk]
enabled = true
filter = asterisk
action = iptables-allports[name=asterisk, protocol=all]
logpath = /var/log/asterisk/fail2ban.log
- Restart fail2ban
systemctl restart fail2ban.service
- Show status fail2ban
fail2ban-client status asterisk
- Show banned IP address
iptables -L -v -n