From b63310c3cf9f7d03afcbc35a4cea3a5e997aebad Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 10:52:38 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=8B=89=E8=B5=B7=E6=9C=AA=E6=8E=A8=E6=B5=81=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E5=88=B6=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- pom.xml | 2 +- sql/clean.sql | 13 + sql/mysql.sql | 426 +++++++++--------- sql/update.sql | 14 +- .../iot/vmp/gb28181/bean/ParentPlatform.java | 13 + .../request/impl/InviteRequestProcessor.java | 4 + .../storager/dao/ParentPlatformMapper.java | 5 +- .../src/components/dialog/platformEdit.vue | 3 + 9 files changed, 264 insertions(+), 220 deletions(-) create mode 100644 sql/clean.sql diff --git a/README.md b/README.md index 69645b01..aec9555c 100644 --- a/README.md +++ b/README.md @@ -134,10 +134,10 @@ QQ私信一般不回, 精力有限.欢迎大家在群里讨论.觉得项目对 感谢作者[dexter langhuihui](https://github.com/langhuihui) 开源这么好用的WEB播放器。 感谢作者[Kyle](https://gitee.com/kkkkk5G) 开源了好用的前端页面 感谢各位大佬的赞助以及对项目的指正与帮助。包括但不限于代码贡献、问题反馈、资金捐赠等各种方式的支持!以下排名不分先后: -[lawrencehj](https://github.com/lawrencehj) @陆丰-创奇科技 [swwhaha](https://github.com/swwheihei) +[lawrencehj](https://github.com/lawrencehj) [Smallwhitepig](https://github.com/Smallwhitepig) [swwhaha](https://github.com/swwheihei) [hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen) [chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb) -[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) +[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb) [Albertzhu666](https://github.com/Albertzhu666) ps: 刚增加了这个名单,肯定遗漏了一些大佬,欢迎大佬联系我添加。 diff --git a/pom.xml b/pom.xml index 7ad53db9..befb74f0 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ com.genersoft wvp-pro - 2.0.2 + 2.1.1 web video platform 国标28181视频平台 diff --git a/sql/clean.sql b/sql/clean.sql new file mode 100644 index 00000000..b8343912 --- /dev/null +++ b/sql/clean.sql @@ -0,0 +1,13 @@ +delete from device; +delete from device_alarm; +delete from device_channel; +delete from device_mobile_position; +delete from gb_stream; +delete from log; +delete from media_server; +delete from parent_platform; +delete from platform_catalog; +delete from platform_gb_channel; +delete from platform_gb_stream; +delete from stream_proxy; +delete from stream_push; \ No newline at end of file diff --git a/sql/mysql.sql b/sql/mysql.sql index d1706b31..cffaa690 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -1,13 +1,13 @@ --- MySQL dump 10.13 Distrib 8.0.28, for Linux (x86_64) +-- MariaDB dump 10.19 Distrib 10.7.3-MariaDB, for Linux (x86_64) -- --- Host: 127.0.0.1 Database: wvp +-- Host: 127.0.0.1 Database: wvp3 -- ------------------------------------------------------ --- Server version 8.0.28-0ubuntu0.20.04.3 +-- Server version 8.0.0-dmr /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!50503 SET NAMES utf8mb4 */; +/*!40101 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; @@ -21,33 +21,34 @@ DROP TABLE IF EXISTS `device`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `device` ( - `id` int NOT NULL AUTO_INCREMENT, - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `manufacturer` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `model` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `firmware` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `transport` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `streamMode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `online` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `registerTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `keepaliveTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `ip` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `port` int NOT NULL, - `expires` int NOT NULL, - `subscribeCycleForCatalog` int NOT NULL, - `subscribeCycleForMobilePosition` int NOT NULL, - `mobilePositionSubmissionInterval` int DEFAULT 5 NOT NULL, - `subscribeCycleForAlarm` int NOT NULL, - `hostAddress` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `charset` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `deviceId` varchar(50) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `manufacturer` varchar(255) DEFAULT NULL, + `model` varchar(255) DEFAULT NULL, + `firmware` varchar(255) DEFAULT NULL, + `transport` varchar(50) DEFAULT NULL, + `streamMode` varchar(50) DEFAULT NULL, + `online` varchar(50) DEFAULT NULL, + `registerTime` varchar(50) DEFAULT NULL, + `keepaliveTime` varchar(50) DEFAULT NULL, + `ip` varchar(50) NOT NULL, + `createTime` varchar(50) NOT NULL, + `updateTime` varchar(50) NOT NULL, + `port` int(11) NOT NULL, + `expires` int(11) NOT NULL, + `subscribeCycleForCatalog` int(11) NOT NULL, + `subscribeCycleForMobilePosition` int(11) NOT NULL, + `mobilePositionSubmissionInterval` int(11) NOT NULL DEFAULT '5', + `subscribeCycleForAlarm` int(11) NOT NULL, + `hostAddress` varchar(50) NOT NULL, + `charset` varchar(50) NOT NULL, + `ssrcCheck` int(11) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `device_deviceId_uindex` (`deviceId`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -65,20 +66,20 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `device_alarm`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `device_alarm` ( - `id` int NOT NULL AUTO_INCREMENT, - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `deviceId` varchar(50) NOT NULL, + `channelId` varchar(50) NOT NULL, + `alarmPriority` varchar(50) NOT NULL, + `alarmMethod` varchar(50) DEFAULT NULL, + `alarmTime` varchar(50) NOT NULL, + `alarmDescription` varchar(255) DEFAULT NULL, `longitude` double DEFAULT NULL, `latitude` double DEFAULT NULL, - `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `alarmType` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -96,43 +97,43 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `device_channel`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `device_channel` ( - `id` int NOT NULL AUTO_INCREMENT, - `channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `manufacture` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `model` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `owner` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `civilCode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `block` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `address` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `parentId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `safetyWay` int DEFAULT NULL, - `registerWay` int DEFAULT NULL, - `certNum` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `certifiable` int DEFAULT NULL, - `errCode` int DEFAULT NULL, - `endTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `secrecy` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `ipAddress` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `port` int DEFAULT NULL, - `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `PTZType` int DEFAULT NULL, - `status` int DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `channelId` varchar(50) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `manufacture` varchar(50) DEFAULT NULL, + `model` varchar(50) DEFAULT NULL, + `owner` varchar(50) DEFAULT NULL, + `civilCode` varchar(50) DEFAULT NULL, + `block` varchar(50) DEFAULT NULL, + `address` varchar(50) DEFAULT NULL, + `parentId` varchar(50) DEFAULT NULL, + `safetyWay` int(11) DEFAULT NULL, + `registerWay` int(11) DEFAULT NULL, + `certNum` varchar(50) DEFAULT NULL, + `certifiable` int(11) DEFAULT NULL, + `errCode` int(11) DEFAULT NULL, + `endTime` varchar(50) DEFAULT NULL, + `secrecy` varchar(50) DEFAULT NULL, + `ipAddress` varchar(50) DEFAULT NULL, + `port` int(11) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `PTZType` int(11) DEFAULT NULL, + `status` int(11) DEFAULT NULL, `longitude` double DEFAULT NULL, `latitude` double DEFAULT NULL, - `streamId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `parental` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, + `streamId` varchar(50) DEFAULT NULL, + `deviceId` varchar(50) NOT NULL, + `parental` varchar(50) DEFAULT NULL, `hasAudio` bit(1) DEFAULT NULL, - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `updateTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `subCount` int DEFAULT '0', + `createTime` varchar(50) NOT NULL, + `updateTime` varchar(50) NOT NULL, + `subCount` int(11) DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `device_channel_id_uindex` (`id`), UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) -) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=81657 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -150,24 +151,24 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `device_mobile_position`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `device_mobile_position` ( - `id` int NOT NULL AUTO_INCREMENT, - `deviceId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `channelId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `deviceName` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `time` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `deviceId` varchar(50) NOT NULL, + `channelId` varchar(50) NOT NULL, + `deviceName` varchar(255) DEFAULT NULL, + `time` varchar(50) NOT NULL, `longitude` double NOT NULL, `latitude` double NOT NULL, `altitude` double DEFAULT NULL, `speed` double DEFAULT NULL, `direction` double DEFAULT NULL, - `reportSource` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `geodeticSystem` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `cnLng` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `cnLat` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, + `reportSource` varchar(50) DEFAULT NULL, + `geodeticSystem` varchar(50) DEFAULT NULL, + `cnLng` varchar(50) DEFAULT NULL, + `cnLat` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=6108 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -185,23 +186,23 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `gb_stream`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `gb_stream` ( - `gbStreamId` int NOT NULL AUTO_INCREMENT, - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `gbStreamId` int(11) NOT NULL AUTO_INCREMENT, + `app` varchar(255) NOT NULL, + `stream` varchar(255) NOT NULL, + `gbId` varchar(50) NOT NULL, + `name` varchar(255) DEFAULT NULL, `longitude` double DEFAULT NULL, `latitude` double DEFAULT NULL, - `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `status` int DEFAULT NULL, - `createStamp` bigint DEFAULT NULL, + `streamType` varchar(50) DEFAULT NULL, + `mediaServerId` varchar(50) DEFAULT NULL, + `status` int(11) DEFAULT NULL, + `createStamp` bigint(20) DEFAULT NULL, PRIMARY KEY (`gbStreamId`) USING BTREE, UNIQUE KEY `app` (`app`,`stream`) USING BTREE, UNIQUE KEY `gbId` (`gbId`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=300766 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=300769 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -219,19 +220,19 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `log`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `log` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `timing` bigint NOT NULL, - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `type` varchar(50) NOT NULL, + `uri` varchar(200) NOT NULL, + `address` varchar(50) NOT NULL, + `result` varchar(50) NOT NULL, + `timing` bigint(20) NOT NULL, + `username` varchar(50) NOT NULL, + `createTime` varchar(50) NOT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=962 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=1552 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -249,34 +250,34 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `media_server`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `media_server` ( - `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `httpPort` int NOT NULL, - `httpSSlPort` int NOT NULL, - `rtmpPort` int NOT NULL, - `rtmpSSlPort` int NOT NULL, - `rtpProxyPort` int NOT NULL, - `rtspPort` int NOT NULL, - `rtspSSLPort` int NOT NULL, - `autoConfig` int NOT NULL, - `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `streamNoneReaderDelayMS` int NOT NULL, - `rtpEnable` int NOT NULL, - `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `recordAssistPort` int NOT NULL, - `defaultServer` int NOT NULL, - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `hookAliveInterval` int NOT NULL, + `id` varchar(255) NOT NULL, + `ip` varchar(50) NOT NULL, + `hookIp` varchar(50) NOT NULL, + `sdpIp` varchar(50) NOT NULL, + `streamIp` varchar(50) NOT NULL, + `httpPort` int(11) NOT NULL, + `httpSSlPort` int(11) NOT NULL, + `rtmpPort` int(11) NOT NULL, + `rtmpSSlPort` int(11) NOT NULL, + `rtpProxyPort` int(11) NOT NULL, + `rtspPort` int(11) NOT NULL, + `rtspSSLPort` int(11) NOT NULL, + `autoConfig` int(11) NOT NULL, + `secret` varchar(50) NOT NULL, + `streamNoneReaderDelayMS` int(11) NOT NULL, + `rtpEnable` int(11) NOT NULL, + `rtpPortRange` varchar(50) NOT NULL, + `sendRtpPortRange` varchar(50) NOT NULL, + `recordAssistPort` int(11) NOT NULL, + `defaultServer` int(11) NOT NULL, + `createTime` varchar(50) NOT NULL, + `updateTime` varchar(50) NOT NULL, + `hookAliveInterval` int(11) NOT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -294,33 +295,36 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `parent_platform`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `parent_platform` ( - `id` int NOT NULL AUTO_INCREMENT, - `enable` int DEFAULT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `serverPort` int DEFAULT NULL, - `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `ptz` int DEFAULT NULL, - `rtcp` int DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `enable` int(11) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `serverGBId` varchar(50) NOT NULL, + `serverGBDomain` varchar(50) DEFAULT NULL, + `serverIP` varchar(50) DEFAULT NULL, + `serverPort` int(11) DEFAULT NULL, + `deviceGBId` varchar(50) NOT NULL, + `deviceIp` varchar(50) DEFAULT NULL, + `devicePort` varchar(50) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `password` varchar(50) DEFAULT NULL, + `expires` varchar(50) DEFAULT NULL, + `keepTimeout` varchar(50) DEFAULT NULL, + `transport` varchar(50) DEFAULT NULL, + `characterSet` varchar(50) DEFAULT NULL, + `catalogId` varchar(50) NOT NULL, + `ptz` int(11) DEFAULT NULL, + `rtcp` int(11) DEFAULT NULL, `status` bit(1) DEFAULT NULL, - `shareAllLiveStream` int DEFAULT NULL, + `shareAllLiveStream` int(11) DEFAULT NULL, + `startOfflinePush` int(11) DEFAULT '0', + `administrativeDivision` varchar(50) NOT NULL, + `catalogGroup` int(11) DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `parent_platform_id_uindex` (`id`), UNIQUE KEY `parent_platform_pk` (`serverGBId`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -338,14 +342,14 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `platform_catalog`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `platform_catalog` ( - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `id` varchar(50) NOT NULL, + `platformId` varchar(50) NOT NULL, + `name` varchar(255) NOT NULL, + `parentId` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -363,14 +367,14 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `platform_gb_channel`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `platform_gb_channel` ( - `id` int NOT NULL AUTO_INCREMENT, - `platformId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `catalogId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `deviceChannelId` int NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `platformId` varchar(50) NOT NULL, + `catalogId` varchar(50) NOT NULL, + `deviceChannelId` int(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=47 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=250 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -388,15 +392,15 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `platform_gb_stream`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `platform_gb_stream` ( - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `gbStreamId` int NOT NULL, - `id` int NOT NULL AUTO_INCREMENT, + `platformId` varchar(50) NOT NULL, + `catalogId` varchar(50) NOT NULL, + `gbStreamId` int(11) NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`), UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) -) ENGINE=InnoDB AUTO_INCREMENT=301207 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=301210 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -414,29 +418,29 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `stream_proxy`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `stream_proxy` ( - `id` int NOT NULL AUTO_INCREMENT, - `type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, - `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, - `url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `src_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `dst_url` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `timeout_ms` int DEFAULT NULL, - `ffmpeg_cmd_key` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, - `rtp_type` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` varchar(50) NOT NULL, + `app` varchar(255) NOT NULL, + `stream` varchar(255) NOT NULL, + `url` varchar(255) DEFAULT NULL, + `src_url` varchar(255) DEFAULT NULL, + `dst_url` varchar(255) DEFAULT NULL, + `timeout_ms` int(11) DEFAULT NULL, + `ffmpeg_cmd_key` varchar(255) DEFAULT NULL, + `rtp_type` varchar(50) DEFAULT NULL, + `mediaServerId` varchar(50) DEFAULT NULL, `enable_hls` bit(1) DEFAULT NULL, `enable_mp4` bit(1) DEFAULT NULL, `enable` bit(1) NOT NULL, `status` bit(1) NOT NULL, `enable_remove_none_reader` bit(1) NOT NULL, - `createTime` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, - `name` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL, + `createTime` varchar(50) NOT NULL, + `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -454,20 +458,20 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `stream_push`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `stream_push` ( - `id` int NOT NULL AUTO_INCREMENT, - `app` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, - `stream` varchar(255) COLLATE utf8mb4_general_ci NOT NULL, - `totalReaderCount` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `originType` int DEFAULT NULL, - `originTypeStr` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, - `createStamp` bigint DEFAULT NULL, - `aliveSecond` int DEFAULT NULL, - `mediaServerId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `app` varchar(255) NOT NULL, + `stream` varchar(255) NOT NULL, + `totalReaderCount` varchar(50) DEFAULT NULL, + `originType` int(11) DEFAULT NULL, + `originTypeStr` varchar(50) DEFAULT NULL, + `createStamp` bigint(20) DEFAULT NULL, + `aliveSecond` int(11) DEFAULT NULL, + `mediaServerId` varchar(50) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `stream_push_pk` (`app`,`stream`) -) ENGINE=InnoDB AUTO_INCREMENT=300799 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=300838 DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -485,17 +489,17 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `user`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `user` ( - `id` int NOT NULL AUTO_INCREMENT, - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `roleId` int NOT NULL, - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `username` varchar(255) NOT NULL, + `password` varchar(255) NOT NULL, + `roleId` int(11) NOT NULL, + `createTime` varchar(50) NOT NULL, + `updateTime` varchar(50) NOT NULL, PRIMARY KEY (`id`) USING BTREE, UNIQUE KEY `user_username_uindex` (`username`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -504,7 +508,8 @@ CREATE TABLE `user` ( LOCK TABLES `user` WRITE; /*!40000 ALTER TABLE `user` DISABLE KEYS */; -INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57'); +INSERT INTO `user` VALUES + (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57'); /*!40000 ALTER TABLE `user` ENABLE KEYS */; UNLOCK TABLES; @@ -514,15 +519,15 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `user_role`; /*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; +/*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_role` ( - `id` int NOT NULL AUTO_INCREMENT, - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(50) NOT NULL, + `authority` varchar(50) NOT NULL, + `createTime` varchar(50) NOT NULL, + `updateTime` varchar(50) NOT NULL, PRIMARY KEY (`id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -531,7 +536,8 @@ CREATE TABLE `user_role` ( LOCK TABLES `user_role` WRITE; /*!40000 ALTER TABLE `user_role` DISABLE KEYS */; -INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); +INSERT INTO `user_role` VALUES + (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); /*!40000 ALTER TABLE `user_role` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -544,4 +550,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-03-07 8:26:30 +-- Dump completed on 2022-04-18 10:50:27 diff --git a/sql/update.sql b/sql/update.sql index 58045180..9c18c26e 100644 --- a/sql/update.sql +++ b/sql/update.sql @@ -1,8 +1,12 @@ -alter table device - add subscribeCycleForMobilePosition int null; +alter table parent_platform + add startOfflinePush int default 0 null; + +alter table parent_platform + add administrativeDivision varchar(50) not null; + +alter table parent_platform + add catalogGroup int default 1 null; alter table device - add mobilePositionSubmissionInterval int default 5 null; + add ssrcCheck int default 0 null; -alter table device - add subscribeCycleForAlarm int null; \ No newline at end of file diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java index 8aa7b37a..7993163e 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java @@ -129,6 +129,11 @@ public class ParentPlatform { */ private boolean mobilePositionSubscribe; + /** + * 点播未推流的设备时是否使用redis通知拉起 + */ + private boolean startOfflinePush; + public Integer getId() { return id; } @@ -329,4 +334,12 @@ public class ParentPlatform { public void setMobilePositionSubscribe(boolean mobilePositionSubscribe) { this.mobilePositionSubscribe = mobilePositionSubscribe; } + + public boolean isStartOfflinePush() { + return startOfflinePush; + } + + public void setStartOfflinePush(boolean startOfflinePush) { + this.startOfflinePush = startOfflinePush; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index 6b6e377e..5d02bda6 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -397,6 +397,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements logger.info("[ app={}, stream={} ]通道离线,启用流后开始推流",gbStream.getApp(), gbStream.getStream()); responseAck(evt, Response.BAD_REQUEST, "channel [" + gbStream.getGbId() + "] offline"); }else if ("push".equals(gbStream.getStreamType())) { + if (!platform.isStartOfflinePush()) { + responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, "channel unavailable"); + return; + } // 发送redis消息以使设备上线 logger.info("[ app={}, stream={} ]通道离线,发送redis信息控制设备开始推流",gbStream.getApp(), gbStream.getStream()); MessageForPushChannel messageForPushChannel = new MessageForPushChannel(); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java index f74b6d4d..a4982b4b 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java @@ -16,10 +16,10 @@ public interface ParentPlatformMapper { @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " + " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + - " status, shareAllLiveStream, catalogId) " + + " status, shareAllLiveStream, startOfflinePush, catalogId) " + " VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + - " ${status}, ${shareAllLiveStream}, #{catalogId})") + " ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId})") int addParentPlatform(ParentPlatform parentPlatform); @Update("UPDATE parent_platform " + @@ -42,6 +42,7 @@ public interface ParentPlatformMapper { "rtcp=#{rtcp}, " + "status=#{status}, " + "shareAllLiveStream=#{shareAllLiveStream}, " + + "startOfflinePush=${startOfflinePush}, " + "catalogId=#{catalogId} " + "WHERE id=#{id}") int updateParentPlatform(ParentPlatform parentPlatform); diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 38a2aef7..1e51170a 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -77,6 +77,7 @@ + {{ @@ -138,6 +139,7 @@ export default { transport: "UDP", characterSet: "GB2312", shareAllLiveStream: false, + startOfflinePush: false, }, rules: { name: [{ required: true, message: "请输入平台名称", trigger: "blur" }], @@ -199,6 +201,7 @@ export default { this.platform.characterSet = platform.characterSet; this.platform.shareAllLiveStream = platform.shareAllLiveStream; this.platform.catalogId = platform.catalogId; + this.platform.startOfflinePush = platform.startOfflinePush; this.onSubmit_text = "保存"; this.saveUrl = "/api/platform/save"; } From ab98fd60d9160357fc13514260ac56c407ee491d Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 11:45:53 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=85=B3=E7=9A=84?= =?UTF-8?q?=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/dialog/platformEdit.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 1e51170a..3b32d669 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -269,6 +269,7 @@ export default { transport: "UDP", characterSet: "GB2312", shareAllLiveStream: false, + startOfflinePush: false, } }, deviceGBIdExit: async function (deviceGbId) { From 4e49266020c2613da5dcaddc180b54033b119c02 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 12:42:58 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=9A=E9=81=93=E7=BB=93=E6=9D=9F=E5=90=8E=E9=87=8A=E6=94=BE?= =?UTF-8?q?=E6=85=A2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java index c3de8a29..759b317d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java @@ -78,6 +78,7 @@ public class CatalogDataCatch { public SyncStatus getSyncStatus(String deviceId) { CatalogData catalogData = data.get(deviceId); if (catalogData == null) return null; + if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) return null; SyncStatus syncStatus = new SyncStatus(); syncStatus.setCurrent(catalogData.getChannelList().size()); syncStatus.setTotal(catalogData.getTotal()); From 15b36e7be6c2a6b9d3c4e8118dc0d59046f4e88a Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 12:45:19 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=9A=E9=81=93=E6=97=A5=E5=BF=97=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/response/cmd/CatalogResponseMessageHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index 2ec80476..75a22447 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -118,8 +118,8 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp channelList.add(deviceChannel); } int sn = Integer.parseInt(snElement.getText()); - logger.info("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(key) == null ? 0 :catalogDataCatch.get(key).size(), sumNum); catalogDataCatch.put(device.getDeviceId(), sn, sumNum, device, channelList); + logger.info("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(device.getDeviceId()) == null ? 0 :catalogDataCatch.get(device.getDeviceId()).size(), sumNum); if (catalogDataCatch.get(device.getDeviceId()).size() == sumNum) { // 数据已经完整接收 boolean resetChannelsResult = storager.resetChannels(device.getDeviceId(), catalogDataCatch.get(device.getDeviceId())); From 2d7a5718321fc7dea905d7efcafec9378dfbd968 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 12:55:54 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=80=9A=E9=81=93=E7=8A=B6=E6=80=81=E5=9B=9E=E5=A4=8D=E4=B8=8D?= =?UTF-8?q?=E5=87=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/session/CatalogDataCatch.java | 7 ++++++- .../response/cmd/CatalogResponseMessageHandler.java | 8 ++++++++ .../com/genersoft/iot/vmp/service/IDeviceService.java | 7 +++++++ .../genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 5 +++++ .../iot/vmp/vmanager/gb28181/device/DeviceQuery.java | 7 ++++--- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java index 759b317d..97360d28 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/CatalogDataCatch.java @@ -78,7 +78,6 @@ public class CatalogDataCatch { public SyncStatus getSyncStatus(String deviceId) { CatalogData catalogData = data.get(deviceId); if (catalogData == null) return null; - if (catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end)) return null; SyncStatus syncStatus = new SyncStatus(); syncStatus.setCurrent(catalogData.getChannelList().size()); syncStatus.setTotal(catalogData.getTotal()); @@ -86,6 +85,12 @@ public class CatalogDataCatch { return syncStatus; } + public boolean isSyncRunning(String deviceId) { + CatalogData catalogData = data.get(deviceId); + if (catalogData == null) return false; + return !catalogData.getStatus().equals(CatalogData.CatalogDataStatus.end); + } + @Scheduled(fixedRate = 5 * 1000) //每5秒执行一次, 发现数据5秒未更新则移除数据并认为数据接收超时 private void timerTask(){ Set keys = data.keySet(); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index 75a22447..92d0114d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -223,6 +223,14 @@ public class CatalogResponseMessageHandler extends SIPRequestProcessorParent imp } } + public boolean isSyncRunning(String deviceId) { + if (catalogDataCatch.get(deviceId) == null) { + return false; + }else { + return catalogDataCatch.isSyncRunning(deviceId); + } + } + public void setChannelSyncReady(Device device, int sn) { catalogDataCatch.addReady(device, sn); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java b/src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java index 08ccfffc..5621d2aa 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IDeviceService.java @@ -43,6 +43,13 @@ public interface IDeviceService { */ SyncStatus getChannelSyncStatus(String deviceId); + /** + * 查看是否仍在同步 + * @param deviceId 设备ID + * @return + */ + Boolean isSyncRunning(String deviceId); + /** * 通道同步 * @param device diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index f36b3aed..6f0d179f 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -99,6 +99,11 @@ public class DeviceServiceImpl implements IDeviceService { return catalogResponseMessageHandler.getChannelSyncProgress(deviceId); } + @Override + public Boolean isSyncRunning(String deviceId) { + return catalogResponseMessageHandler.isSyncRunning(deviceId); + } + @Override public void sync(Device device) { if (catalogResponseMessageHandler.getChannelSyncProgress(device.getDeviceId()) != null) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index cbcb4ff5..95d2843d 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java @@ -164,12 +164,13 @@ public class DeviceQuery { logger.debug("设备通道信息同步API调用,deviceId:" + deviceId); } Device device = storager.queryVideoDevice(deviceId); - SyncStatus syncStatus = deviceService.getChannelSyncStatus(deviceId); + boolean status = deviceService.isSyncRunning(deviceId); // 已存在则返回进度 - if (syncStatus != null && syncStatus.getErrorMsg() == null) { + if (status) { WVPResult wvpResult = new WVPResult<>(); wvpResult.setCode(0); - wvpResult.setData(syncStatus); + SyncStatus channelSyncStatus = deviceService.getChannelSyncStatus(deviceId); + wvpResult.setData(channelSyncStatus); return wvpResult; } deviceService.sync(device); From f83123f868b8ee12e93df7edb0735be99cf6b4a4 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Mon, 18 Apr 2022 15:04:22 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=91=84=E5=83=8F?= =?UTF-8?q?=E5=A4=B4=E6=B3=A8=E5=86=8C=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/RegisterRequestProcessor.java | 282 +++++++++--------- 1 file changed, 136 insertions(+), 146 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java index 54a52044..f6a3af95 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java @@ -3,7 +3,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; import com.genersoft.iot.vmp.common.VideoManagerConstants; import com.genersoft.iot.vmp.conf.SipConfig; import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; -import com.genersoft.iot.vmp.gb28181.auth.RegisterLogicHandler; import com.genersoft.iot.vmp.gb28181.bean.Device; import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; import com.genersoft.iot.vmp.gb28181.event.EventPublisher; @@ -42,166 +41,157 @@ import java.util.Locale; @Component public class RegisterRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor { - private Logger logger = LoggerFactory.getLogger(RegisterRequestProcessor.class); + private final Logger logger = LoggerFactory.getLogger(RegisterRequestProcessor.class); - public String method = "REGISTER"; + public String method = "REGISTER"; - @Autowired - private SipConfig sipConfig; + @Autowired + private SipConfig sipConfig; - @Autowired - private RegisterLogicHandler handler; + @Autowired + private IRedisCatchStorage redisCatchStorage; - @Autowired - private IRedisCatchStorage redisCatchStorage; + @Autowired + private IVideoManagerStorage storager; - @Autowired - private IVideoManagerStorage storager; + @Autowired + private EventPublisher publisher; - @Autowired - private EventPublisher publisher; + @Autowired + private SIPProcessorObserver sipProcessorObserver; - @Autowired - private SIPProcessorObserver sipProcessorObserver; + @Override + public void afterPropertiesSet() throws Exception { + // 添加消息处理的订阅 + sipProcessorObserver.addRequestProcessor(method, this); + } - @Override - public void afterPropertiesSet() throws Exception { - // 添加消息处理的订阅 - sipProcessorObserver.addRequestProcessor(method, this); - } + /** + * 收到注册请求 处理 + * + * @param evt + */ + @Override + public void process(RequestEvent evt) { + try { + RequestEventExt evtExt = (RequestEventExt) evt; + String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort(); + logger.info("[{}] 收到注册请求,开始处理", requestAddress); + Request request = evt.getRequest(); + ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME); + Response response = null; + boolean passwordCorrect = false; + // 注册标志 0:未携带授权头或者密码错误 1:注册成功 2:注销成功 + int registerFlag = 0; + FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME); + AddressImpl address = (AddressImpl) fromHeader.getAddress(); + SipUri uri = (SipUri) address.getURI(); + String deviceId = uri.getUser(); - /** - * 收到注册请求 处理 - * @param evt - */ - @Override - public void process(RequestEvent evt) { - try { - RequestEventExt evtExt = (RequestEventExt)evt; - String requestAddress = evtExt.getRemoteIpAddress() + ":" + evtExt.getRemotePort(); - logger.info("[{}] 收到注册请求,开始处理", requestAddress); - Request request = evt.getRequest(); - ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME); - Response response = null; - boolean passwordCorrect = false; - // 注册标志 0:未携带授权头或者密码错误 1:注册成功 2:注销成功 - int registerFlag = 0; - FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME); - AddressImpl address = (AddressImpl) fromHeader.getAddress(); - SipUri uri = (SipUri) address.getURI(); - String deviceId = uri.getUser(); - Device deviceInRedis = redisCatchStorage.getDevice(deviceId); - Device device = storager.queryVideoDevice(deviceId); - if (deviceInRedis != null && device == null) { - // redis 存在脏数据 - redisCatchStorage.clearCatchByDeviceId(deviceId); - } - AuthorizationHeader authorhead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); - // 校验密码是否正确 - if (authorhead != null) { - passwordCorrect = new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, - sipConfig.getPassword()); - } - if (StringUtils.isEmpty(sipConfig.getPassword())){ - passwordCorrect = true; - } + AuthorizationHeader authHead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); + if (authHead == null) { + logger.info("[{}] 未携带授权头 回复401", requestAddress); + response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request); + new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain()); + sendResponse(evt, response); + return; + } - // 未携带授权头或者密码错误 回复401 - if (authorhead == null ) { + // 校验密码是否正确 + passwordCorrect = StringUtils.isEmpty(sipConfig.getPassword()) || + new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, sipConfig.getPassword()); + // 未携带授权头或者密码错误 回复401 - logger.info("[{}] 未携带授权头 回复401", requestAddress); - response = getMessageFactory().createResponse(Response.UNAUTHORIZED, request); - new DigestServerAuthenticationHelper().generateChallenge(getHeaderFactory(), response, sipConfig.getDomain()); - }else { - if (!passwordCorrect){ - // 注册失败 - response = getMessageFactory().createResponse(Response.FORBIDDEN, request); - response.setReasonPhrase("wrong password"); - logger.info("[{}] 密码/SIP服务器ID错误, 回复403", requestAddress); - }else { - // 携带授权头并且密码正确 - response = getMessageFactory().createResponse(Response.OK, request); - // 添加date头 - SIPDateHeader dateHeader = new SIPDateHeader(); - // 使用自己修改的 - WvpSipDate wvpSipDate = new WvpSipDate(Calendar.getInstance(Locale.ENGLISH).getTimeInMillis()); - dateHeader.setDate(wvpSipDate); - response.addHeader(dateHeader); + if (!passwordCorrect) { + // 注册失败 + response = getMessageFactory().createResponse(Response.FORBIDDEN, request); + response.setReasonPhrase("wrong password"); + logger.info("[{}] 密码/SIP服务器ID错误, 回复403", requestAddress); + sendResponse(evt, response); + return; + } + Device deviceInRedis = redisCatchStorage.getDevice(deviceId); + Device device = storager.queryVideoDevice(deviceId); + if (deviceInRedis != null && device == null) { + // redis 存在脏数据 + redisCatchStorage.clearCatchByDeviceId(deviceId); + } + // 携带授权头并且密码正确 + response = getMessageFactory().createResponse(Response.OK, request); + // 添加date头 + SIPDateHeader dateHeader = new SIPDateHeader(); + // 使用自己修改的 + WvpSipDate wvpSipDate = new WvpSipDate(Calendar.getInstance(Locale.ENGLISH).getTimeInMillis()); + dateHeader.setDate(wvpSipDate); + response.addHeader(dateHeader); - if (expiresHeader == null) { - response = getMessageFactory().createResponse(Response.BAD_REQUEST, request); - ServerTransaction serverTransaction = getServerTransaction(evt); - serverTransaction.sendResponse(response); - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); - return; - } - // 添加Contact头 - response.addHeader(request.getHeader(ContactHeader.NAME)); - // 添加Expires头 - response.addHeader(request.getExpires()); + if (expiresHeader == null) { + response = getMessageFactory().createResponse(Response.BAD_REQUEST, request); + ServerTransaction serverTransaction = getServerTransaction(evt); + serverTransaction.sendResponse(response); + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + return; + } + // 添加Contact头 + response.addHeader(request.getHeader(ContactHeader.NAME)); + // 添加Expires头 + response.addHeader(request.getExpires()); - // 获取到通信地址等信息 - ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); - String received = viaHeader.getReceived(); - int rPort = viaHeader.getRPort(); - // 解析本地地址替代 - if (StringUtils.isEmpty(received) || rPort == -1) { - received = viaHeader.getHost(); - rPort = viaHeader.getPort(); - } - // + // 获取到通信地址等信息 + ViaHeader viaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); + String received = viaHeader.getReceived(); + int rPort = viaHeader.getRPort(); + // 解析本地地址替代 + if (StringUtils.isEmpty(received) || rPort == -1) { + received = viaHeader.getHost(); + rPort = viaHeader.getPort(); + } + if (device == null) { + device = new Device(); + device.setStreamMode("UDP"); + device.setCharset("GB2312"); + device.setDeviceId(deviceId); + device.setFirsRegister(true); + } else { + device.setFirsRegister(device.getOnline() == 0); + } + device.setIp(received); + device.setPort(rPort); + device.setHostAddress(received.concat(":").concat(String.valueOf(rPort))); + if (expiresHeader.getExpires() == 0) { + // 注销成功 + registerFlag = 2; + } else { + // 注册成功 + device.setExpires(expiresHeader.getExpires()); + registerFlag = 1; + // 判断TCP还是UDP + ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); + String transport = reqViaHeader.getTransport(); + device.setTransport("TCP".equals(transport) ? "TCP" : "UDP"); + } - if (device == null) { - device = new Device(); - device.setStreamMode("UDP"); - device.setCharset("GB2312"); - device.setDeviceId(deviceId); - device.setFirsRegister(true); - }else { - if (device.getOnline() == 0) { - device.setFirsRegister(true); - } - } - device.setIp(received); - device.setPort(rPort); - device.setHostAddress(received.concat(":").concat(String.valueOf(rPort))); - // 注销成功 - if (expiresHeader.getExpires() == 0) { - registerFlag = 2; - } - // 注册成功 - else { - device.setExpires(expiresHeader.getExpires()); - registerFlag = 1; - // 判断TCP还是UDP - boolean isTcp = false; - ViaHeader reqViaHeader = (ViaHeader) request.getHeader(ViaHeader.NAME); - String transport = reqViaHeader.getTransport(); - if (transport.equals("TCP")) { - isTcp = true; - } - device.setTransport(isTcp ? "TCP" : "UDP"); - } - } - } + sendResponse(evt, response); + // 注册成功 + // 保存到redis + if (registerFlag == 1) { + logger.info("[{}] 注册成功! deviceId:" + deviceId, requestAddress); + publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_REGISTER, expiresHeader.getExpires()); + } else if (registerFlag == 2) { + logger.info("[{}] 注销成功! deviceId:" + deviceId, requestAddress); + publisher.outlineEventPublish(deviceId, VideoManagerConstants.EVENT_OUTLINE_UNREGISTER); + } + } catch (SipException | InvalidArgumentException | NoSuchAlgorithmException | ParseException e) { + e.printStackTrace(); + } - ServerTransaction serverTransaction = getServerTransaction(evt); - serverTransaction.sendResponse(response); - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); - // 注册成功 - // 保存到redis - if (registerFlag == 1 ) { - logger.info("[{}] 注册成功! deviceId:" + device.getDeviceId(), requestAddress); - publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_REGISTER, expiresHeader.getExpires()); - } else if (registerFlag == 2) { - logger.info("[{}] 注销成功! deviceId:" + device.getDeviceId(), requestAddress); - publisher.outlineEventPublish(device.getDeviceId(), VideoManagerConstants.EVENT_OUTLINE_UNREGISTER); - } - } catch (SipException | InvalidArgumentException | NoSuchAlgorithmException | ParseException e) { - e.printStackTrace(); - } - - } + } + + private void sendResponse(RequestEvent evt, Response response) throws InvalidArgumentException, SipException { + ServerTransaction serverTransaction = getServerTransaction(evt); + serverTransaction.sendResponse(response); + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + } } From 4f2c6c9fc1a4b93bee788b1b21a4617965b41789 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Mon, 18 Apr 2022 16:16:49 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E7=9B=AE=E5=BD=95=E5=88=86=E7=BB=84=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=8A=A0=E5=BF=AB=E9=80=9A=E9=81=93=E4=BC=A0=E8=BE=93?= =?UTF-8?q?=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/bean/ParentPlatform.java | 26 +++ .../task/impl/CatalogSubscribeTask.java | 21 ++- .../cmd/impl/SIPCommanderFroPlatform.java | 169 +++++++++++------- .../vmp/service/impl/DeviceServiceImpl.java | 10 +- .../storager/dao/ParentPlatformMapper.java | 6 +- .../impl/VideoManagerStorageImpl.java | 7 + .../src/components/dialog/platformEdit.vue | 15 ++ 7 files changed, 176 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java index 7993163e..7c23a2f8 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/ParentPlatform.java @@ -134,6 +134,16 @@ public class ParentPlatform { */ private boolean startOfflinePush; + /** + * 目录分组-每次向上级发送通道信息时单个包携带的通道数量,取值1,2,4,8 + */ + private int catalogGroup; + + /** + * 行政区划 + */ + private String administrativeDivision; + public Integer getId() { return id; } @@ -342,4 +352,20 @@ public class ParentPlatform { public void setStartOfflinePush(boolean startOfflinePush) { this.startOfflinePush = startOfflinePush; } + + public int getCatalogGroup() { + return catalogGroup; + } + + public void setCatalogGroup(int catalogGroup) { + this.catalogGroup = catalogGroup; + } + + public String getAdministrativeDivision() { + return administrativeDivision; + } + + public void setAdministrativeDivision(String administrativeDivision) { + this.administrativeDivision = administrativeDivision; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java index bee5fba6..59b927f3 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/CatalogSubscribeTask.java @@ -10,6 +10,8 @@ import org.springframework.scheduling.annotation.Async; import javax.sip.Dialog; import javax.sip.DialogState; import javax.sip.ResponseEvent; +import java.util.Timer; +import java.util.TimerTask; /** * 目录订阅任务 @@ -20,6 +22,8 @@ public class CatalogSubscribeTask implements ISubscribeTask { private final ISIPCommander sipCommander; private Dialog dialog; + private Timer timer ; + public CatalogSubscribeTask(Device device, ISIPCommander sipCommander) { this.device = device; this.sipCommander = sipCommander; @@ -27,6 +31,10 @@ public class CatalogSubscribeTask implements ISubscribeTask { @Override public void run() { + if (timer != null ) { + timer.cancel(); + timer = null; + } sipCommander.catalogSubscribe(device, dialog, eventResult -> { if (eventResult.dialog != null || eventResult.dialog.getState().equals(DialogState.CONFIRMED)) { dialog = eventResult.dialog; @@ -43,6 +51,13 @@ public class CatalogSubscribeTask implements ISubscribeTask { dialog = null; // 失败 logger.warn("[目录订阅]失败,信令发送失败: {}-{} ", device.getDeviceId(), eventResult.msg); + timer = new Timer(); + timer.schedule(new TimerTask() { + @Override + public void run() { + CatalogSubscribeTask.this.run(); + } + }, 2000); }); } @@ -56,9 +71,13 @@ public class CatalogSubscribeTask implements ISubscribeTask { * TERMINATED-> Terminated Dialog状态-终止 */ logger.info("取消目录订阅时dialog状态为{}", DialogState.CONFIRMED); + if (timer != null ) { + timer.cancel(); + timer = null; + } if (dialog != null && dialog.getState().equals(DialogState.CONFIRMED)) { device.setSubscribeCycleForCatalog(0); - sipCommander.mobilePositionSubscribe(device, dialog, eventResult -> { + sipCommander.catalogSubscribe(device, dialog, eventResult -> { ResponseEvent event = (ResponseEvent) eventResult.event; if (event.getResponse().getRawContent() != null) { // 成功 diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index c5cdae00..14f729d9 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -32,6 +32,7 @@ import javax.sip.header.*; import javax.sip.message.Request; import java.lang.reflect.Field; import java.text.ParseException; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.UUID; @@ -215,7 +216,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return false; } try { - String catalogXml = getCatalogXml(channel, sn, parentPlatform, size); + List channels = new ArrayList<>(); + if (channel != null) { + channels.add(channel); + } + String catalogXml = getCatalogXml(channels, sn, parentPlatform, size); // callid CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() @@ -239,7 +244,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { sendCatalogResponse(channels, parentPlatform, sn, fromTag, 0); return true; } - private String getCatalogXml(DeviceChannel channel, String sn, ParentPlatform parentPlatform, int size) { + private String getCatalogXml(List channels, String sn, ParentPlatform parentPlatform, int size) { String characterSet = parentPlatform.getCharacterSet(); StringBuffer catalogXml = new StringBuffer(600); catalogXml.append("\r\n"); @@ -248,34 +253,35 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" +sn + "\r\n"); catalogXml.append("" + parentPlatform.getDeviceGBId() + "\r\n"); catalogXml.append("" + size + "\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("\r\n"); - if (channel != null) { - catalogXml.append("" + channel.getChannelId() + "\r\n"); - catalogXml.append("" + channel.getName() + "\r\n"); - catalogXml.append("" + channel.getManufacture() + "\r\n"); - catalogXml.append("" + channel.getModel() + "\r\n"); - catalogXml.append("" + channel.getOwner() + "\r\n"); - catalogXml.append("" + channel.getCivilCode() + "\r\n"); - catalogXml.append("
" + channel.getAddress() + "
\r\n"); - catalogXml.append("" + channel.getParental() + "\r\n"); - if (channel.getParentId() != null) { - catalogXml.append("" + channel.getParentId() + "\r\n"); + catalogXml.append("\r\n"); + if (channels.size() > 0) { + for (DeviceChannel channel : channels) { + catalogXml.append("\r\n"); + catalogXml.append("" + channel.getChannelId() + "\r\n"); + catalogXml.append("" + channel.getName() + "\r\n"); + catalogXml.append("" + channel.getManufacture() + "\r\n"); + catalogXml.append("" + channel.getModel() + "\r\n"); + catalogXml.append("" + channel.getOwner() + "\r\n"); + catalogXml.append("" + channel.getCivilCode() + "\r\n"); + catalogXml.append("
" + channel.getAddress() + "
\r\n"); + catalogXml.append("" + channel.getParental() + "\r\n"); + if (channel.getParentId() != null) { + catalogXml.append("" + channel.getParentId() + "\r\n"); + } + catalogXml.append("" + channel.getSecrecy() + "\r\n"); + catalogXml.append("" + channel.getRegisterWay() + "\r\n"); + catalogXml.append("" + (channel.getStatus() == 0?"OFF":"ON") + "\r\n"); + catalogXml.append("" + channel.getLongitude() + "\r\n"); + catalogXml.append("" + channel.getLatitude() + "\r\n"); + catalogXml.append("" + channel.getIpAddress() + "\r\n"); + catalogXml.append("" + channel.getPort() + "\r\n"); + catalogXml.append("\r\n"); + catalogXml.append("" + channel.getPTZType() + "\r\n"); + catalogXml.append("\r\n"); + catalogXml.append("
\r\n"); } - catalogXml.append("" + channel.getSecrecy() + "\r\n"); - catalogXml.append("" + channel.getRegisterWay() + "\r\n"); - catalogXml.append("" + (channel.getStatus() == 0?"OFF":"ON") + "\r\n"); - catalogXml.append("" + channel.getLongitude() + "\r\n"); - catalogXml.append("" + channel.getLatitude() + "\r\n"); - catalogXml.append("" + channel.getIpAddress() + "\r\n"); - catalogXml.append("" + channel.getPort() + "\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("" + channel.getPTZType() + "\r\n"); - catalogXml.append("\r\n"); } - - catalogXml.append("
\r\n"); catalogXml.append("
\r\n"); catalogXml.append("\r\n"); return catalogXml.toString(); @@ -286,15 +292,21 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return; } try { - DeviceChannel deviceChannel = channels.get(index); - String catalogXml = getCatalogXml(deviceChannel, sn, parentPlatform, channels.size()); + List deviceChannels; + if (index + parentPlatform.getCatalogGroup() < channels.size() - 1) { + deviceChannels = channels.subList(index, index + parentPlatform.getCatalogGroup()); + }else { + deviceChannels = channels.subList(index, channels.size()); + } + + String catalogXml = getCatalogXml(deviceChannels, sn, parentPlatform, channels.size()); // callid CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() : udpSipProvider.getNewCallId(); Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml, fromTag, callIdHeader); transmitRequest(parentPlatform, request, null, eventResult -> { - int indexNext = index + 1; + int indexNext = index + parentPlatform.getCatalogGroup(); sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext); }); } catch (SipException | ParseException | InvalidArgumentException e) { @@ -432,13 +444,21 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { if (index >= deviceChannels.size()) { return true; } + List channels; + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { + channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); + }else { + channels = deviceChannels.subList(index, deviceChannels.size()); + } try { Integer finalIndex = index; - String catalogXmlContent = getCatalogXmlContentForCatalogAddOrUpdate(parentPlatform, deviceChannels.get(index ), deviceChannels.size(), type, subscribeInfo); + String catalogXmlContent = getCatalogXmlContentForCatalogAddOrUpdate(parentPlatform, channels, + deviceChannels.size(), type, subscribeInfo); sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg); }, (eventResult -> { - sendNotifyForCatalogAddOrUpdate(type, parentPlatform, deviceChannels, subscribeInfo, finalIndex + 1); + sendNotifyForCatalogAddOrUpdate(type, parentPlatform, deviceChannels, subscribeInfo, + finalIndex + parentPlatform.getCatalogGroup()); })); } catch (SipException | ParseException e) { e.printStackTrace(); @@ -500,11 +520,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } - private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, DeviceChannel channel, int sumNum, String type, SubscribeInfo subscribeInfo) { + private String getCatalogXmlContentForCatalogAddOrUpdate(ParentPlatform parentPlatform, List channels, int sumNum, String type, SubscribeInfo subscribeInfo) { StringBuffer catalogXml = new StringBuffer(600); - if (parentPlatform.getServerGBId().equals(channel.getParentId())) { - channel.setParentId(parentPlatform.getDeviceGBId()); - } + String characterSet = parentPlatform.getCharacterSet(); catalogXml.append("\r\n"); catalogXml.append("\r\n"); @@ -512,26 +530,33 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" + (int) ((Math.random() * 9 + 1) * 100000) + "\r\n"); catalogXml.append("" + parentPlatform.getDeviceGBId() + "\r\n"); catalogXml.append("1\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("" + channel.getChannelId() + "\r\n"); - catalogXml.append("" + channel.getName() + "\r\n"); - catalogXml.append("" + channel.getManufacture() + "\r\n"); - catalogXml.append("" + channel.getModel() + "\r\n"); - catalogXml.append("0\r\n"); - catalogXml.append("CivilCode\r\n"); - catalogXml.append("
" + channel.getAddress() + "
\r\n"); - catalogXml.append("" + channel.getParental() + "\r\n"); - if (channel.getParentId() != null) { - catalogXml.append("" + channel.getParentId() + "\r\n"); + catalogXml.append("\r\n"); + if (channels.size() > 0) { + for (DeviceChannel channel : channels) { + if (parentPlatform.getServerGBId().equals(channel.getParentId())) { + channel.setParentId(parentPlatform.getDeviceGBId()); + } + catalogXml.append("\r\n"); + catalogXml.append("" + channel.getChannelId() + "\r\n"); + catalogXml.append("" + channel.getName() + "\r\n"); + catalogXml.append("" + channel.getManufacture() + "\r\n"); + catalogXml.append("" + channel.getModel() + "\r\n"); + catalogXml.append("0\r\n"); + catalogXml.append("CivilCode\r\n"); + catalogXml.append("
" + channel.getAddress() + "
\r\n"); + catalogXml.append("" + channel.getParental() + "\r\n"); + if (channel.getParentId() != null) { + catalogXml.append("" + channel.getParentId() + "\r\n"); + } + catalogXml.append("" + channel.getSecrecy() + "\r\n"); + catalogXml.append("" + channel.getRegisterWay() + "\r\n"); + catalogXml.append("" + (channel.getStatus() == 0 ? "OFF" : "ON") + "\r\n"); + if (!"presence".equals(subscribeInfo.getEventType())) { + catalogXml.append("" + type + "\r\n"); + } + catalogXml.append("
\r\n"); + } } - catalogXml.append("" + channel.getSecrecy() + "\r\n"); - catalogXml.append("" + channel.getRegisterWay() + "\r\n"); - catalogXml.append("" + (channel.getStatus() == 0 ? "OFF" : "ON") + "\r\n"); - if (!"presence".equals(subscribeInfo.getEventType())) { - catalogXml.append("" + type + "\r\n"); - } - catalogXml.append("
\r\n"); catalogXml.append("
\r\n"); catalogXml.append("
\r\n"); return catalogXml.toString(); @@ -553,13 +578,20 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { if (index >= deviceChannels.size()) { return true; } + List channels; + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { + channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); + }else { + channels = deviceChannels.subList(index, deviceChannels.size()); + } try { Integer finalIndex = index; - String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, deviceChannels.get(index), type); + String catalogXmlContent = getCatalogXmlContentForCatalogOther(parentPlatform, channels, type); sendNotify(parentPlatform, catalogXmlContent, subscribeInfo, eventResult -> { logger.error("发送NOTIFY通知消息失败。错误:{} {}", eventResult.statusCode, eventResult.msg); }, (eventResult -> { - sendNotifyForCatalogOther(type, parentPlatform, deviceChannels, subscribeInfo, finalIndex + 1); + sendNotifyForCatalogOther(type, parentPlatform, deviceChannels, subscribeInfo, + finalIndex + parentPlatform.getCatalogGroup()); })); } catch (SipException e) { e.printStackTrace(); @@ -574,10 +606,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return true; } - private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, DeviceChannel channel, String type) { - if (parentPlatform.getServerGBId().equals(channel.getParentId())) { - channel.setParentId(parentPlatform.getDeviceGBId()); - } + private String getCatalogXmlContentForCatalogOther(ParentPlatform parentPlatform, List channels, String type) { + String characterSet = parentPlatform.getCharacterSet(); StringBuffer catalogXml = new StringBuffer(600); catalogXml.append("\r\n"); @@ -586,11 +616,18 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" + (int) ((Math.random() * 9 + 1) * 100000) + "\r\n"); catalogXml.append("" + parentPlatform.getDeviceGBId() + "\r\n"); catalogXml.append("1\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("" + channel.getChannelId() + "\r\n"); - catalogXml.append("" + type + "\r\n"); - catalogXml.append("\r\n"); + catalogXml.append("\r\n"); + if (channels.size() > 0) { + for (DeviceChannel channel : channels) { + if (parentPlatform.getServerGBId().equals(channel.getParentId())) { + channel.setParentId(parentPlatform.getDeviceGBId()); + } + catalogXml.append("\r\n"); + catalogXml.append("" + channel.getChannelId() + "\r\n"); + catalogXml.append("" + type + "\r\n"); + catalogXml.append("\r\n"); + } + } catalogXml.append("\r\n"); catalogXml.append("\r\n"); return catalogXml.toString(); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index 6f0d179f..f287c5e3 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -41,10 +41,6 @@ public class DeviceServiceImpl implements IDeviceService { if (device == null || device.getSubscribeCycleForCatalog() < 0) { return false; } - CatalogSubscribeTask task = (CatalogSubscribeTask)dynamicTask.get(device.getDeviceId() + "catalog"); - if (task != null && task.getDialogState() != null && task.getDialogState().equals(DialogState.CONFIRMED)) { // 已存在不需要再次添加 - return true; - } logger.info("[添加目录订阅] 设备{}", device.getDeviceId()); // 添加目录订阅 CatalogSubscribeTask catalogSubscribeTask = new CatalogSubscribeTask(device, sipCommander); @@ -71,10 +67,6 @@ public class DeviceServiceImpl implements IDeviceService { return false; } logger.info("[添加移动位置订阅] 设备{}", device.getDeviceId()); - MobilePositionSubscribeTask task = (MobilePositionSubscribeTask)dynamicTask.get(device.getDeviceId() + "mobile_position"); - if (task != null && task.getDialogState() != null && task.getDialogState().equals(DialogState.CONFIRMED)) { // 已存在不需要再次添加 - return true; - } // 添加目录订阅 MobilePositionSubscribeTask mobilePositionSubscribeTask = new MobilePositionSubscribeTask(device, sipCommander); // 提前开始刷新订阅 @@ -106,7 +98,7 @@ public class DeviceServiceImpl implements IDeviceService { @Override public void sync(Device device) { - if (catalogResponseMessageHandler.getChannelSyncProgress(device.getDeviceId()) != null) { + if (catalogResponseMessageHandler.isSyncRunning(device.getDeviceId())) { logger.info("开启同步时发现同步已经存在"); return; } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java index a4982b4b..2cbb426d 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/ParentPlatformMapper.java @@ -16,10 +16,10 @@ public interface ParentPlatformMapper { @Insert("INSERT INTO parent_platform (enable, name, serverGBId, serverGBDomain, serverIP, serverPort, deviceGBId, deviceIp, " + " devicePort, username, password, expires, keepTimeout, transport, characterSet, ptz, rtcp, " + - " status, shareAllLiveStream, startOfflinePush, catalogId) " + + " status, shareAllLiveStream, startOfflinePush, catalogId, administrativeDivision, catalogGroup) " + " VALUES (${enable}, '${name}', '${serverGBId}', '${serverGBDomain}', '${serverIP}', ${serverPort}, '${deviceGBId}', '${deviceIp}', " + " '${devicePort}', '${username}', '${password}', '${expires}', '${keepTimeout}', '${transport}', '${characterSet}', ${ptz}, ${rtcp}, " + - " ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId})") + " ${status}, ${shareAllLiveStream}, ${startOfflinePush}, #{catalogId}, #{administrativeDivision}, #{catalogGroup})") int addParentPlatform(ParentPlatform parentPlatform); @Update("UPDATE parent_platform " + @@ -43,6 +43,8 @@ public interface ParentPlatformMapper { "status=#{status}, " + "shareAllLiveStream=#{shareAllLiveStream}, " + "startOfflinePush=${startOfflinePush}, " + + "catalogGroup=#{catalogGroup}, " + + "administrativeDivision=#{administrativeDivision}, " + "catalogId=#{catalogId} " + "WHERE id=#{id}") int updateParentPlatform(ParentPlatform parentPlatform); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index a3c5c6cf..6d680bc1 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -520,6 +520,12 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @Override public boolean updateParentPlatform(ParentPlatform parentPlatform) { int result = 0; + if (parentPlatform.getCatalogGroup() == 0) { + parentPlatform.setCatalogGroup(1); + } + if (parentPlatform.getAdministrativeDivision() == null) { + parentPlatform.setAdministrativeDivision(parentPlatform.getDeviceGBId().substring(0,6)); + } ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); if (parentPlatform.getId() == null ) { if (parentPlatform.getCatalogId() == null) { @@ -539,6 +545,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { parentPlatformCatch.setId(parentPlatform.getServerGBId()); redisCatchStorage.delPlatformCatchInfo(parentPlatById.getServerGBId()); } + result = platformMapper.updateParentPlatform(parentPlatform); } // 更新缓存 diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 3b32d669..b7df7e32 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -63,6 +63,18 @@
+ + + + + + + + Date: Mon, 18 Apr 2022 17:38:49 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=8C=E6=94=BF?= =?UTF-8?q?=E5=8C=BA=E5=88=92=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=8F=91=E9=80=81=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/impl/MobilePositionSubscribeHandlerTask.java | 1 - .../transmit/cmd/impl/SIPCommanderFroPlatform.java | 7 +++---- .../notify/cmd/CatalogNotifyMessageHandler.java | 4 ++-- .../message/query/cmd/CatalogQueryMessageHandler.java | 4 ++-- .../iot/vmp/service/impl/StreamPushServiceImpl.java | 3 --- .../vmp/storager/impl/VideoManagerStorageImpl.java | 4 ++-- web_src/src/components/dialog/platformEdit.vue | 11 +++++++++++ 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java index 034f9de4..c495403f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeHandlerTask.java @@ -29,7 +29,6 @@ public class MobilePositionSubscribeHandlerTask implements ISubscribeTask { private String key; public MobilePositionSubscribeHandlerTask(IRedisCatchStorage redisCatchStorage, ISIPCommanderForPlatform sipCommanderForPlatform, IVideoManagerStorage storager, String platformId, String sn, String key, SubscribeHolder subscribeInfo) { - System.out.println("MobilePositionSubscribeHandlerTask 初始化"); this.redisCatchStorage = redisCatchStorage; this.storager = storager; this.platform = storager.queryParentPlatByServerGBId(platformId); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 14f729d9..37053119 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -293,12 +293,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { } try { List deviceChannels; - if (index + parentPlatform.getCatalogGroup() < channels.size() - 1) { + if (index + parentPlatform.getCatalogGroup() < channels.size()) { deviceChannels = channels.subList(index, index + parentPlatform.getCatalogGroup()); }else { deviceChannels = channels.subList(index, channels.size()); } - String catalogXml = getCatalogXml(deviceChannels, sn, parentPlatform, channels.size()); // callid CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() @@ -445,7 +444,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return true; } List channels; - if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) { channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); }else { channels = deviceChannels.subList(index, deviceChannels.size()); @@ -579,7 +578,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { return true; } List channels; - if (index + parentPlatform.getCatalogGroup() < deviceChannels.size() - 1) { + if (index + parentPlatform.getCatalogGroup() < deviceChannels.size()) { channels = deviceChannels.subList(index, index + parentPlatform.getCatalogGroup()); }else { channels = deviceChannels.subList(index, deviceChannels.size()); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java index 419a5c26..d17920dc 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java @@ -79,7 +79,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple deviceChannel.setParental(1); deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setRegisterWay(1); - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); deviceChannel.setModel("live"); deviceChannel.setOwner("wvp-pro"); deviceChannel.setSecrecy("0"); @@ -116,7 +116,7 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple deviceChannel.setStatus(1); deviceChannel.setParentId(gbStream.getCatalogId()); deviceChannel.setRegisterWay(1); - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); deviceChannel.setModel("live"); deviceChannel.setOwner("wvp-pro"); deviceChannel.setParental(0); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java index 6a33da45..9844315a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java @@ -93,7 +93,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem deviceChannel.setParental(1); deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setRegisterWay(1); - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); deviceChannel.setModel("live"); deviceChannel.setOwner("wvp-pro"); deviceChannel.setSecrecy("0"); @@ -130,7 +130,7 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem deviceChannel.setStatus(1); deviceChannel.setParentId(gbStream.getCatalogId()); deviceChannel.setRegisterWay(1); - deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); + deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); deviceChannel.setModel("live"); deviceChannel.setOwner("wvp-pro"); deviceChannel.setParental(0); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index 3aaa7353..79b9b294 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -420,9 +420,6 @@ public class StreamPushServiceImpl implements IStreamPushService { continue; } streamPushItemForPlatform.setPlatformId(platFormInfoArray[0]); - if (platFormInfoArray[0].equals("34020000002110000001")) { - System.out.println(111); - } List gbStreamList = platformForEvent.get(platFormInfoArray[0]); if (gbStreamList == null) { gbStreamList = new ArrayList<>(); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 6d680bc1..fbb6e38d 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -524,7 +524,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { parentPlatform.setCatalogGroup(1); } if (parentPlatform.getAdministrativeDivision() == null) { - parentPlatform.setAdministrativeDivision(parentPlatform.getDeviceGBId().substring(0,6)); + parentPlatform.setAdministrativeDivision(parentPlatform.getAdministrativeDivision()); } ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(parentPlatform.getServerGBId()); // .getDeviceGBId()); if (parentPlatform.getId() == null ) { @@ -1081,7 +1081,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setRegisterWay(1); // 行政区划应该是Domain的前八位 - deviceChannel.setCivilCode(parentPlatByServerGBId.getDeviceGBId().substring(0,6)); + deviceChannel.setCivilCode(parentPlatByServerGBId.getAdministrativeDivision()); deviceChannel.setModel("live"); deviceChannel.setOwner("wvp-pro"); deviceChannel.setSecrecy("0"); diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index b7df7e32..0caec322 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -44,6 +44,9 @@ + + + @@ -153,6 +156,7 @@ export default { shareAllLiveStream: false, startOfflinePush: false, catalogGroup: 1, + administrativeDivision: null, }, rules: { name: [{ required: true, message: "请输入平台名称", trigger: "blur" }], @@ -190,6 +194,7 @@ export default { that.platform.devicePort = res.data.devicePort; that.platform.username = res.data.username; that.platform.password = res.data.password; + that.platform.administrativeDivision = res.data.username.substr(0, 6); }).catch(function (error) { console.log(error); }); @@ -216,6 +221,7 @@ export default { this.platform.catalogId = platform.catalogId; this.platform.startOfflinePush = platform.startOfflinePush; this.platform.catalogGroup = platform.catalogGroup; + this.platform.administrativeDivision = platform.administrativeDivision; this.onSubmit_text = "保存"; this.saveUrl = "/api/platform/save"; } @@ -230,6 +236,10 @@ export default { deviceGBIdChange: function () { this.platform.username = this.platform.deviceGBId ; + if (this.platform.administrativeDivision == null) { + this.platform.administrativeDivision = this.platform.deviceGBId.substr(0, 6); + } + }, onSubmit: function () { var that = this; @@ -270,6 +280,7 @@ export default { rtcp: false, name: null, serverGBId: null, + administrativeDivision: null, serverGBDomain: null, serverIP: null, serverPort: null, From fbd693faa5a0ee72f75d2ba4f3fe6c4e9cbb29b8 Mon Sep 17 00:00:00 2001 From: 648540858 <456panlinlin> Date: Tue, 19 Apr 2022 11:52:03 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E7=BA=A7=E8=81=94=E7=9B=AE=E5=BD=95=E6=8E=A8=E9=80=81=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81zlm=E6=96=B0=E7=89=B9=E6=80=A7ssrc=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/bean/Device.java | 13 +++++++ .../iot/vmp/gb28181/bean/DeviceChannel.java | 13 +++++++ .../cmd/impl/SIPCommanderFroPlatform.java | 37 +++++++++++-------- .../query/cmd/CatalogQueryMessageHandler.java | 11 +++--- .../vmp/media/zlm/ZLMRTPServerFactory.java | 3 +- .../iot/vmp/service/IMediaServerService.java | 4 +- .../service/impl/MediaServerServiceImpl.java | 8 ++-- .../iot/vmp/service/impl/PlayServiceImpl.java | 4 +- .../iot/vmp/storager/dao/DeviceMapper.java | 3 ++ web_src/src/components/dialog/catalogEdit.vue | 15 +++++++- web_src/src/components/dialog/deviceEdit.vue | 3 ++ 11 files changed, 83 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java index d50ffb77..81b96662 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/Device.java @@ -129,6 +129,11 @@ public class Device { */ private int subscribeCycleForAlarm; + /** + * 是否开启ssrc校验,默认关闭,开启可以防止串流 + */ + private boolean ssrcCheck; + public String getDeviceId() { return deviceId; @@ -321,4 +326,12 @@ public class Device { public void setSubscribeCycleForAlarm(int subscribeCycleForAlarm) { this.subscribeCycleForAlarm = subscribeCycleForAlarm; } + + public boolean isSsrcCheck() { + return ssrcCheck; + } + + public void setSsrcCheck(boolean ssrcCheck) { + this.ssrcCheck = ssrcCheck; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java index 36337895..1e6ef773 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/bean/DeviceChannel.java @@ -169,6 +169,11 @@ public class DeviceChannel { */ private boolean hasAudio; + /** + * 标记通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划 + */ + private int channelType; + public int getId() { return id; } @@ -441,4 +446,12 @@ public class DeviceChannel { public void setUpdateTime(String updateTime) { this.updateTime = updateTime; } + + public int getChannelType() { + return channelType; + } + + public void setChannelType(int channelType) { + this.channelType = channelType; + } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 37053119..0fd8cc50 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -260,24 +260,27 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" + channel.getChannelId() + "\r\n"); catalogXml.append("" + channel.getName() + "\r\n"); catalogXml.append("" + channel.getManufacture() + "\r\n"); - catalogXml.append("" + channel.getModel() + "\r\n"); - catalogXml.append("" + channel.getOwner() + "\r\n"); - catalogXml.append("" + channel.getCivilCode() + "\r\n"); - catalogXml.append("
" + channel.getAddress() + "
\r\n"); catalogXml.append("" + channel.getParental() + "\r\n"); if (channel.getParentId() != null) { catalogXml.append("" + channel.getParentId() + "\r\n"); } - catalogXml.append("" + channel.getSecrecy() + "\r\n"); catalogXml.append("" + channel.getRegisterWay() + "\r\n"); catalogXml.append("" + (channel.getStatus() == 0?"OFF":"ON") + "\r\n"); - catalogXml.append("" + channel.getLongitude() + "\r\n"); - catalogXml.append("" + channel.getLatitude() + "\r\n"); - catalogXml.append("" + channel.getIpAddress() + "\r\n"); - catalogXml.append("" + channel.getPort() + "\r\n"); - catalogXml.append("\r\n"); - catalogXml.append("" + channel.getPTZType() + "\r\n"); - catalogXml.append("\r\n"); + catalogXml.append("" + channel.getSecrecy() + "\r\n"); + if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下字段 + catalogXml.append("" + channel.getModel() + "\r\n"); + catalogXml.append("" + channel.getOwner() + "\r\n"); + catalogXml.append("" + channel.getCivilCode() + "\r\n"); + catalogXml.append("
" + channel.getAddress() + "
\r\n"); + catalogXml.append("" + channel.getLongitude() + "\r\n"); + catalogXml.append("" + channel.getLatitude() + "\r\n"); + catalogXml.append("" + channel.getIpAddress() + "\r\n"); + catalogXml.append("" + channel.getPort() + "\r\n"); + catalogXml.append("\r\n"); + catalogXml.append("" + channel.getPTZType() + "\r\n"); + catalogXml.append("\r\n"); + } + catalogXml.append("\r\n"); } } @@ -539,10 +542,6 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" + channel.getChannelId() + "\r\n"); catalogXml.append("" + channel.getName() + "\r\n"); catalogXml.append("" + channel.getManufacture() + "\r\n"); - catalogXml.append("" + channel.getModel() + "\r\n"); - catalogXml.append("0\r\n"); - catalogXml.append("CivilCode\r\n"); - catalogXml.append("
" + channel.getAddress() + "
\r\n"); catalogXml.append("" + channel.getParental() + "\r\n"); if (channel.getParentId() != null) { catalogXml.append("" + channel.getParentId() + "\r\n"); @@ -550,6 +549,12 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { catalogXml.append("" + channel.getSecrecy() + "\r\n"); catalogXml.append("" + channel.getRegisterWay() + "\r\n"); catalogXml.append("" + (channel.getStatus() == 0 ? "OFF" : "ON") + "\r\n"); + if (channel.getChannelType() == 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 + catalogXml.append("" + channel.getModel() + "\r\n"); + catalogXml.append("0\r\n"); + catalogXml.append("CivilCode\r\n"); + catalogXml.append("
" + channel.getAddress() + "
\r\n"); + } if (!"presence".equals(subscribeInfo.getEventType())) { catalogXml.append("" + type + "\r\n"); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java index 9844315a..cefee3fc 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java @@ -83,10 +83,10 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem catalog.setParentId(parentPlatform.getDeviceGBId()); } DeviceChannel deviceChannel = new DeviceChannel(); + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划 + deviceChannel.setChannelType(2); deviceChannel.setChannelId(catalog.getId()); deviceChannel.setName(catalog.getName()); - deviceChannel.setLongitude(0.0); - deviceChannel.setLatitude(0.0); deviceChannel.setDeviceId(parentPlatform.getDeviceGBId()); deviceChannel.setManufacture("wvp-pro"); deviceChannel.setStatus(1); @@ -94,9 +94,6 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem deviceChannel.setParentId(catalog.getParentId()); deviceChannel.setRegisterWay(1); deviceChannel.setCivilCode(parentPlatform.getAdministrativeDivision()); - deviceChannel.setModel("live"); - deviceChannel.setOwner("wvp-pro"); - deviceChannel.setSecrecy("0"); allChannels.add(deviceChannel); } } @@ -107,6 +104,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem channel.setCatalogId(parentPlatform.getDeviceGBId()); } DeviceChannel deviceChannel = storage.queryChannel(channel.getDeviceId(), channel.getChannelId()); + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划 + deviceChannel.setChannelType(0); deviceChannel.setParental(0); deviceChannel.setParentId(channel.getCatalogId()); deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0, 6)); @@ -120,6 +119,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem gbStream.setCatalogId(null); } DeviceChannel deviceChannel = new DeviceChannel(); + // 通道的类型,0->国标通道 1->直播流通道 2->业务分组/虚拟组织/行政区划 + deviceChannel.setChannelType(1); deviceChannel.setChannelId(gbStream.getGbId()); deviceChannel.setName(gbStream.getName()); deviceChannel.setLongitude(gbStream.getLongitude()); diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index a36593e3..cf8e0069 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -81,7 +81,7 @@ public class ZLMRTPServerFactory { return result; } - public int createRTPServer(MediaServerItem mediaServerItem, String streamId) { + public int createRTPServer(MediaServerItem mediaServerItem, String streamId, int ssrc) { int result = -1; // 查询此rtp server 是否已经存在 JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaServerItem, streamId); @@ -94,6 +94,7 @@ public class ZLMRTPServerFactory { param.put("enable_tcp", 1); param.put("stream_id", streamId); param.put("port", 0); + param.put("ssrc", ssrc); JSONObject openRtpServerResultJson = zlmresTfulUtils.openRtpServer(mediaServerItem, param); if (openRtpServerResultJson != null) { diff --git a/src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java b/src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java index 00ec0dd5..2a99754f 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java @@ -44,9 +44,9 @@ public interface IMediaServerService { void updateVmServer(List mediaServerItemList); - SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId); + SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck); - SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean isPlayback); + SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck, boolean isPlayback); void closeRTPServer(String deviceId, String channelId, String ssrc); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java index a667bab5..e7b9e513 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java @@ -117,12 +117,12 @@ public class MediaServerServiceImpl implements IMediaServerService { } @Override - public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId) { - return openRTPServer(mediaServerItem, streamId, false); + public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck) { + return openRTPServer(mediaServerItem, streamId, ssrcCheck,false); } @Override - public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean isPlayback) { + public SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, boolean ssrcCheck, boolean isPlayback) { if (mediaServerItem == null || mediaServerItem.getId() == null) { return null; } @@ -146,7 +146,7 @@ public class MediaServerServiceImpl implements IMediaServerService { } int rtpServerPort = mediaServerItem.getRtpProxyPort(); if (mediaServerItem.isRtpEnable()) { - rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId); + rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck?Integer.parseInt(ssrc):0); } redisUtil.set(key, mediaServerItem); return new SSRCInfo(rtpServerPort, ssrc, streamId); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index 61c37a81..518b9d41 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -188,7 +188,7 @@ public class PlayServiceImpl implements IPlayService { if (mediaServerItem.isRtpEnable()) { streamId = String.format("%s_%s", device.getDeviceId(), channelId); } - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId); + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, device.isSsrcCheck()); play(mediaServerItem, ssrcInfo, device, channelId, (mediaServerItemInUse, response)->{ if (hookEvent != null) { hookEvent.response(mediaServerItem, response); @@ -232,7 +232,7 @@ public class PlayServiceImpl implements IPlayService { streamId = String.format("%s_%s", device.getDeviceId(), channelId); } if (ssrcInfo == null) { - ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId); + ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, device.isSsrcCheck()); } // 超时处理 diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java index aab8d773..97cf2ccf 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java @@ -37,6 +37,7 @@ public interface DeviceMapper { "subscribeCycleForMobilePosition," + "mobilePositionSubmissionInterval," + "subscribeCycleForAlarm," + + "ssrcCheck," + "online" + ") VALUES (" + "#{deviceId}," + @@ -59,6 +60,7 @@ public interface DeviceMapper { "#{subscribeCycleForMobilePosition}," + "#{mobilePositionSubmissionInterval}," + "#{subscribeCycleForAlarm}," + + "#{ssrcCheck}," + "#{online}" + ")") int add(Device device); @@ -84,6 +86,7 @@ public interface DeviceMapper { ", subscribeCycleForMobilePosition=${subscribeCycleForMobilePosition}" + ", mobilePositionSubmissionInterval=${mobilePositionSubmissionInterval}" + ", subscribeCycleForAlarm=${subscribeCycleForAlarm}" + + ", ssrcCheck=${ssrcCheck}" + "WHERE deviceId='${deviceId}'"+ " "}) int update(Device device); diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue index 20b21684..93d8f8dd 100644 --- a/web_src/src/components/dialog/catalogEdit.vue +++ b/web_src/src/components/dialog/catalogEdit.vue @@ -13,11 +13,24 @@
- + +
+ 建议的类型: +
+   行政区划(可选2位/4位/6位/8位/10位数字,例如:130432,表示河北省邯郸市广平县) +
+   业务分组(第11、12、13位215,例如:34020000002150000001) +
+   虚拟组织(第11、12、13位216,例如:34020000002160000001) +
+ +
+ +
确认 diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue index 1b1aba02..b4dd2855 100644 --- a/web_src/src/components/dialog/deviceEdit.vue +++ b/web_src/src/components/dialog/deviceEdit.vue @@ -45,6 +45,9 @@ + + +
确认 From 0ee1eb427465fd1b29411a37f3485a8bbbcb5401 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Wed, 20 Apr 2022 13:56:30 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=9A=E5=AE=9E=E6=B5=8B=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8E=82=E5=AE=B6=EF=BC=88TP-Link=20IPC43AW=EF=BC=89=E5=BD=95?= =?UTF-8?q?=E5=83=8F=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84xml=E6=8A=A5=E6=96=87=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=AD=E6=9C=89=E5=A4=9A=E4=BD=99=E7=9A=84=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E8=A7=A3=E6=9E=90String=E4=B8=BAInt?= =?UTF-8?q?eger=E5=A4=B1=E8=B4=A5=EF=BC=8C=E5=A2=9E=E5=8A=A0trim=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=BF=99=E4=B8=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/utils/XmlUtil.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java index ba6eed5f..09e7a04f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java @@ -20,8 +20,8 @@ import java.util.*; /** * 基于dom4j的工具包 - * - * + * + * */ public class XmlUtil { /** @@ -31,9 +31,9 @@ public class XmlUtil { /** * 解析XML为Document对象 - * + * * @param xml 被解析的XMl - * + * * @return Document */ public static Element parseXml(String xml) { @@ -51,7 +51,7 @@ public class XmlUtil { /** * 获取element对象的text的值 - * + * * @param em 节点的对象 * @param tag 节点的tag * @return 节点 @@ -62,12 +62,12 @@ public class XmlUtil { } Element e = em.element(tag); // - return null == e ? null : e.getText(); + return null == e ? null : e.getText().trim(); } /** * 递归解析xml节点,适用于 多节点数据 - * + * * @param node node * @param nodeName nodeName * @return List> @@ -106,7 +106,7 @@ public class XmlUtil { /** * xml转json - * + * * @param element * @param json */ From d6c11e5aa6db2f0e97eb54824319fa6684cfacc1 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Thu, 21 Apr 2022 10:03:21 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E4=B8=80=E5=A4=84v-for=E6=B2=A1=E6=9C=89key=E7=9A=84=E8=AD=A6?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/control.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/src/components/control.vue b/web_src/src/components/control.vue index 9a0a97e0..742b0917 100644 --- a/web_src/src/components/control.vue +++ b/web_src/src/components/control.vue @@ -41,7 +41,7 @@ - + From 778aa4fb0c2bfa5f62f24118f4910f3b9ed197bc Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Thu, 21 Apr 2022 10:11:08 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=9E=E6=97=B6?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=B6=8A=E7=95=8C=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/live.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/src/components/live.vue b/web_src/src/components/live.vue index 82575276..fbe52465 100644 --- a/web_src/src/components/live.vue +++ b/web_src/src/components/live.vue @@ -4,7 +4,7 @@ - +
设备列表
From 7f62101dd3d0f336dfa1811813963df4a5e3ab36 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Thu, 21 Apr 2022 12:33:10 +0800 Subject: [PATCH 13/15] =?UTF-8?q?1.=E9=87=8D=E6=9E=84=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BB=93=E6=9E=84=EF=BC=8C=E4=BB=8E=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=AF=8F=E4=B8=AA=E9=A1=B5=E9=9D=A2=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E7=BB=98=E5=88=B6=E6=94=B9=E4=B8=BA=E8=B7=AF=E7=94=B1=E5=B5=8C?= =?UTF-8?q?=E5=A5=97=202.=E5=85=A8=E5=B1=80=E9=A1=B5=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A6=82=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E3=80=81=E6=A0=87=E9=A2=98=E6=A0=8F=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/CloudRecord.vue | 108 +- web_src/src/components/CloudRecordDetail.vue | 2 +- web_src/src/components/DeviceList.vue | 647 ++++----- web_src/src/components/MediaServerManger.vue | 65 +- web_src/src/components/ParentPlatformList.vue | 144 +- web_src/src/components/PushVideoList.vue | 606 +++++---- web_src/src/components/StreamProxyList.vue | 209 ++- web_src/src/components/UiHeader.vue | 141 -- web_src/src/components/channelList.vue | 735 +++++----- web_src/src/components/control.vue | 1196 +++++++++-------- web_src/src/components/devicePosition.vue | 64 +- web_src/src/components/live.vue | 77 +- web_src/src/components/setting/Media.vue | 2 +- web_src/src/components/setting/Sip.vue | 2 +- web_src/src/components/setting/Web.vue | 2 +- web_src/src/layout/UiHeader.vue | 151 +++ web_src/src/layout/index.vue | 90 ++ web_src/src/router/index.js | 143 +- 18 files changed, 2298 insertions(+), 2086 deletions(-) delete mode 100644 web_src/src/components/UiHeader.vue create mode 100644 web_src/src/layout/UiHeader.vue create mode 100644 web_src/src/layout/index.vue diff --git a/web_src/src/components/CloudRecord.vue b/web_src/src/components/CloudRecord.vue index 78f8a46e..1d0819b0 100644 --- a/web_src/src/components/CloudRecord.vue +++ b/web_src/src/components/CloudRecord.vue @@ -1,67 +1,57 @@ diff --git a/web_src/src/components/MediaServerManger.vue b/web_src/src/components/MediaServerManger.vue index c412bcb9..2e3eeeff 100644 --- a/web_src/src/components/MediaServerManger.vue +++ b/web_src/src/components/MediaServerManger.vue @@ -1,45 +1,38 @@ diff --git a/web_src/src/components/StreamProxyList.vue b/web_src/src/components/StreamProxyList.vue index 9ecb9330..d5533927 100644 --- a/web_src/src/components/StreamProxyList.vue +++ b/web_src/src/components/StreamProxyList.vue @@ -1,115 +1,108 @@ @@ -117,7 +110,7 @@ import streamProxyEdit from './dialog/StreamProxyEdit.vue' import onvifEdit from './dialog/onvifEdit.vue' import devicePlayer from './dialog/devicePlayer.vue' - import uiHeader from './UiHeader.vue' + import uiHeader from '../layout/UiHeader.vue' export default { name: 'streamProxyList', components: { diff --git a/web_src/src/components/UiHeader.vue b/web_src/src/components/UiHeader.vue deleted file mode 100644 index 828dda97..00000000 --- a/web_src/src/components/UiHeader.vue +++ /dev/null @@ -1,141 +0,0 @@ - - - diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index 6eae383d..59a6f740 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -1,393 +1,406 @@ diff --git a/web_src/src/components/control.vue b/web_src/src/components/control.vue index 742b0917..a0b2834f 100644 --- a/web_src/src/components/control.vue +++ b/web_src/src/components/control.vue @@ -1,584 +1,702 @@ diff --git a/web_src/src/components/devicePosition.vue b/web_src/src/components/devicePosition.vue index 777b11ed..0ffd5fa3 100644 --- a/web_src/src/components/devicePosition.vue +++ b/web_src/src/components/devicePosition.vue @@ -1,43 +1,35 @@ + diff --git a/web_src/src/layout/index.vue b/web_src/src/layout/index.vue new file mode 100644 index 00000000..4fdbc72e --- /dev/null +++ b/web_src/src/layout/index.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/web_src/src/router/index.js b/web_src/src/router/index.js index 05bb1ae6..356bc337 100644 --- a/web_src/src/router/index.js +++ b/web_src/src/router/index.js @@ -1,5 +1,6 @@ import Vue from 'vue' import VueRouter from 'vue-router' +import Layout from "../layout/index.vue" import control from '../components/control.vue' import deviceList from '../components/DeviceList.vue' @@ -32,78 +33,86 @@ export default new VueRouter({ routes: [ { path: '/', - component: control, - }, - { - path: '/live', - component: live, - }, - { - path: '/deviceList', - component: deviceList, - }, - { - path: '/pushVideoList', - component: pushVideoList, - }, - { - path: '/streamProxyList', - component: streamProxyList, + name: 'home', + component: Layout, + redirect: '/control', + children: [ + { + path: '/control', + component: control, + }, + { + path: '/live', + component: live, + }, + { + path: '/deviceList', + component: deviceList, + }, + { + path: '/pushVideoList', + component: pushVideoList, + }, + { + path: '/streamProxyList', + component: streamProxyList, + }, + { + path: '/channelList/:deviceId/:parentChannelId/:count/:page', + name: 'channelList', + component: channelList, + }, + { + path: '/parentPlatformList/:count/:page', + name: 'parentPlatformList', + component: parentPlatformList, + }, + { + path: '/devicePosition/:deviceId/:parentChannelId/:count/:page', + name: 'devicePosition', + component: devicePosition, + }, + { + path: '/cloudRecord', + name: 'cloudRecord', + component: cloudRecord, + }, + { + path: '/mediaServerManger', + name: 'mediaServerManger', + component: mediaServerManger, + }, + { + path: '/setting/web', + name: 'web', + component: web, + }, + { + path: '/setting/sip', + name: 'sip', + component: sip, + }, + { + path: '/setting/media', + name: 'media', + component: media, + }, + { + path: '/play/wasm/:url', + name: 'wasmPlayer', + component: wasmPlayer, + }, + { + path: '/play/rtc/:url', + name: 'rtcPlayer', + component: rtcPlayer, + }, + ] }, { path: '/login', name: '登录', component: login, }, - { - path: '/channelList/:deviceId/:parentChannelId/:count/:page', - name: 'channelList', - component: channelList, - }, - { - path: '/parentPlatformList/:count/:page', - name: 'parentPlatformList', - component: parentPlatformList, - }, - { - path: '/devicePosition/:deviceId/:parentChannelId/:count/:page', - name: 'devicePosition', - component: devicePosition, - }, - { - path: '/cloudRecord', - name: 'cloudRecord', - component: cloudRecord, - }, - { - path: '/mediaServerManger', - name: 'mediaServerManger', - component: mediaServerManger, - }, - { - path: '/setting/web', - name: 'web', - component: web, - }, - { - path: '/setting/sip', - name: 'sip', - component: sip, - }, - { - path: '/setting/media', - name: 'media', - component: media, - }, - { - path: '/play/wasm/:url', - name: 'wasmPlayer', - component: wasmPlayer, - }, - { - path: '/play/rtc/:url', - name: 'rtcPlayer', - component: rtcPlayer, - }, ] }) From 5d8f68ede7e6233aec1e0258af38f49b40cf9ee8 Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Thu, 21 Apr 2022 12:39:09 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E9=80=9A=E9=81=93=E9=A1=B5=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=85=A8=E5=B1=80=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/channelList.vue | 164 ++++++++++++------------- 1 file changed, 81 insertions(+), 83 deletions(-) diff --git a/web_src/src/components/channelList.vue b/web_src/src/components/channelList.vue index 59a6f740..34f540df 100644 --- a/web_src/src/components/channelList.vue +++ b/web_src/src/components/channelList.vue @@ -1,15 +1,12 @@ From fd1256acb1c21ac5971df03ab0f132b32e864f1c Mon Sep 17 00:00:00 2001 From: xiaoxie Date: Thu, 21 Apr 2022 12:45:27 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E9=80=82=E9=85=8D=E4=B8=89=E4=B8=AA=E9=9A=90=E8=97=8F=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/setting/Media.vue | 147 +++++++++++------------ web_src/src/components/setting/Sip.vue | 79 ++++++------ web_src/src/components/setting/Web.vue | 15 +-- 3 files changed, 109 insertions(+), 132 deletions(-) diff --git a/web_src/src/components/setting/Media.vue b/web_src/src/components/setting/Media.vue index 0dc6c765..19465b96 100644 --- a/web_src/src/components/setting/Media.vue +++ b/web_src/src/components/setting/Media.vue @@ -1,85 +1,78 @@