Commit ab74d1cff90cc563e0eca8deb8f154d84eb51908
Merge branch 'wvp-28181-2.0'
# Conflicts: # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
Showing
42 changed files
with
865 additions
and
745 deletions
pom.xml
| @@ -263,14 +263,16 @@ | @@ -263,14 +263,16 @@ | ||
| 263 | </configuration> | 263 | </configuration> |
| 264 | </plugin> | 264 | </plugin> |
| 265 | 265 | ||
| 266 | - <!-- <plugin> | 266 | + <plugin> |
| 267 | <groupId>pl.project13.maven</groupId> | 267 | <groupId>pl.project13.maven</groupId> |
| 268 | <artifactId>git-commit-id-plugin</artifactId> | 268 | <artifactId>git-commit-id-plugin</artifactId> |
| 269 | <version>3.0.1</version> | 269 | <version>3.0.1</version> |
| 270 | <configuration> | 270 | <configuration> |
| 271 | <offline>true</offline> | 271 | <offline>true</offline> |
| 272 | + <failOnNoGitDirectory>false</failOnNoGitDirectory> | ||
| 273 | + <dateFormat>yyyyMMdd</dateFormat> | ||
| 272 | </configuration> | 274 | </configuration> |
| 273 | - </plugin>--> | 275 | + </plugin> |
| 274 | 276 | ||
| 275 | <plugin> | 277 | <plugin> |
| 276 | <groupId>org.apache.maven.plugins</groupId> | 278 | <groupId>org.apache.maven.plugins</groupId> |
sql/mysql.sql
| 1 | -- MySQL dump 10.13 Distrib 8.0.29, for Linux (x86_64) | 1 | -- MySQL dump 10.13 Distrib 8.0.29, for Linux (x86_64) |
| 2 | -- | 2 | -- |
| 3 | --- Host: 127.0.0.1 Database: wvp2 | 3 | +-- Host: 127.0.0.1 Database: 242wvp |
| 4 | -- ------------------------------------------------------ | 4 | -- ------------------------------------------------------ |
| 5 | -- Server version 8.0.29-0ubuntu0.22.04.3 | 5 | -- Server version 8.0.29-0ubuntu0.22.04.3 |
| 6 | 6 | ||
| 7 | -/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */; | ||
| 8 | -/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTER_SET_RESULTS */; | ||
| 9 | -/*!40101 SET @OLD_COLLATION_CONNECTION = @@COLLATION_CONNECTION */; | 7 | +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
| 8 | +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | ||
| 9 | +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | ||
| 10 | /*!50503 SET NAMES utf8mb4 */; | 10 | /*!50503 SET NAMES utf8mb4 */; |
| 11 | -/*!40103 SET @OLD_TIME_ZONE = @@TIME_ZONE */; | ||
| 12 | -/*!40103 SET TIME_ZONE = ' + 00:00' */; | ||
| 13 | -/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */; | ||
| 14 | -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */; | ||
| 15 | -/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */; | ||
| 16 | -/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */; | 11 | +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
| 12 | +/*!40103 SET TIME_ZONE='+00:00' */; | ||
| 13 | +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; | ||
| 14 | +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; | ||
| 15 | +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; | ||
| 16 | +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; | ||
| 17 | 17 | ||
| 18 | -- | 18 | -- |
| 19 | -- Table structure for table `device` | 19 | -- Table structure for table `device` |
| 20 | -- | 20 | -- |
| 21 | 21 | ||
| 22 | DROP TABLE IF EXISTS `device`; | 22 | DROP TABLE IF EXISTS `device`; |
| 23 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 23 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 24 | /*!50503 SET character_set_client = utf8mb4 */; | 24 | /*!50503 SET character_set_client = utf8mb4 */; |
| 25 | -CREATE TABLE `device` | ||
| 26 | -( | ||
| 27 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 28 | - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 29 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 30 | - `manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 31 | - `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 32 | - `firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 33 | - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 34 | - `streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 35 | - `online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 36 | - `registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 37 | - `keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 38 | - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 39 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 40 | - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 41 | - `port` int NOT NULL, | ||
| 42 | - `expires` int NOT NULL, | ||
| 43 | - `subscribeCycleForCatalog` int NOT NULL, | ||
| 44 | - `hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 45 | - `charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 46 | - `subscribeCycleForMobilePosition` int DEFAULT NULL, | ||
| 47 | - `mobilePositionSubmissionInterval` int DEFAULT '5 ', | ||
| 48 | - `subscribeCycleForAlarm` int DEFAULT NULL, | ||
| 49 | - `ssrcCheck` int DEFAULT '0 ', | ||
| 50 | - `geoCoordSys` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 51 | - `treeType` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 52 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 53 | - UNIQUE KEY `device_deviceId_uindex` (`deviceId`) USING BTREE | ||
| 54 | -) ENGINE = InnoDB | ||
| 55 | - AUTO_INCREMENT = 53 | ||
| 56 | - DEFAULT CHARSET = utf8mb4 | ||
| 57 | - COLLATE = utf8mb4_general_ci | ||
| 58 | - ROW_FORMAT = DYNAMIC; | 25 | +CREATE TABLE `device` ( |
| 26 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 27 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 28 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 29 | + `manufacturer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 30 | + `model` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 31 | + `firmware` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 32 | + `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 33 | + `streamMode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 34 | + `online` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 35 | + `registerTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 36 | + `keepaliveTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 37 | + `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 38 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 39 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 40 | + `port` int NOT NULL, | ||
| 41 | + `expires` int NOT NULL, | ||
| 42 | + `subscribeCycleForCatalog` int NOT NULL, | ||
| 43 | + `hostAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 44 | + `charset` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 45 | + `subscribeCycleForMobilePosition` int DEFAULT NULL, | ||
| 46 | + `mobilePositionSubmissionInterval` int DEFAULT '5', | ||
| 47 | + `subscribeCycleForAlarm` int DEFAULT NULL, | ||
| 48 | + `ssrcCheck` int DEFAULT '0', | ||
| 49 | + `geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 50 | + `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 51 | + PRIMARY KEY (`id`), | ||
| 52 | + UNIQUE KEY `device_deviceId_uindex` (`deviceId`) | ||
| 53 | +) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 59 | /*!40101 SET character_set_client = @saved_cs_client */; | 54 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 60 | 55 | ||
| 61 | -- | 56 | -- |
| @@ -63,10 +58,8 @@ CREATE TABLE `device` | @@ -63,10 +58,8 @@ CREATE TABLE `device` | ||
| 63 | -- | 58 | -- |
| 64 | 59 | ||
| 65 | LOCK TABLES `device` WRITE; | 60 | LOCK TABLES `device` WRITE; |
| 66 | -/*!40000 ALTER TABLE `device` | ||
| 67 | - DISABLE KEYS */; | ||
| 68 | -/*!40000 ALTER TABLE `device` | ||
| 69 | - ENABLE KEYS */; | 61 | +/*!40000 ALTER TABLE `device` DISABLE KEYS */; |
| 62 | +/*!40000 ALTER TABLE `device` ENABLE KEYS */; | ||
| 70 | UNLOCK TABLES; | 63 | UNLOCK TABLES; |
| 71 | 64 | ||
| 72 | -- | 65 | -- |
| @@ -74,26 +67,22 @@ UNLOCK TABLES; | @@ -74,26 +67,22 @@ UNLOCK TABLES; | ||
| 74 | -- | 67 | -- |
| 75 | 68 | ||
| 76 | DROP TABLE IF EXISTS `device_alarm`; | 69 | DROP TABLE IF EXISTS `device_alarm`; |
| 77 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 70 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 78 | /*!50503 SET character_set_client = utf8mb4 */; | 71 | /*!50503 SET character_set_client = utf8mb4 */; |
| 79 | -CREATE TABLE `device_alarm` | ||
| 80 | -( | ||
| 81 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 82 | - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 83 | - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 84 | - `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 85 | - `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 86 | - `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 87 | - `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 88 | - `longitude` double DEFAULT NULL, | ||
| 89 | - `latitude` double DEFAULT NULL, | ||
| 90 | - `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 91 | - `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 92 | - PRIMARY KEY (`id`) USING BTREE | ||
| 93 | -) ENGINE = InnoDB | ||
| 94 | - DEFAULT CHARSET = utf8mb4 | ||
| 95 | - COLLATE = utf8mb4_general_ci | ||
| 96 | - ROW_FORMAT = DYNAMIC; | 72 | +CREATE TABLE `device_alarm` ( |
| 73 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 74 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 75 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 76 | + `alarmPriority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 77 | + `alarmMethod` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 78 | + `alarmTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 79 | + `alarmDescription` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 80 | + `longitude` double DEFAULT NULL, | ||
| 81 | + `latitude` double DEFAULT NULL, | ||
| 82 | + `alarmType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 83 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 84 | + PRIMARY KEY (`id`) USING BTREE | ||
| 85 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 97 | /*!40101 SET character_set_client = @saved_cs_client */; | 86 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 98 | 87 | ||
| 99 | -- | 88 | -- |
| @@ -101,10 +90,8 @@ CREATE TABLE `device_alarm` | @@ -101,10 +90,8 @@ CREATE TABLE `device_alarm` | ||
| 101 | -- | 90 | -- |
| 102 | 91 | ||
| 103 | LOCK TABLES `device_alarm` WRITE; | 92 | LOCK TABLES `device_alarm` WRITE; |
| 104 | -/*!40000 ALTER TABLE `device_alarm` | ||
| 105 | - DISABLE KEYS */; | ||
| 106 | -/*!40000 ALTER TABLE `device_alarm` | ||
| 107 | - ENABLE KEYS */; | 93 | +/*!40000 ALTER TABLE `device_alarm` DISABLE KEYS */; |
| 94 | +/*!40000 ALTER TABLE `device_alarm` ENABLE KEYS */; | ||
| 108 | UNLOCK TABLES; | 95 | UNLOCK TABLES; |
| 109 | 96 | ||
| 110 | -- | 97 | -- |
| @@ -112,55 +99,50 @@ UNLOCK TABLES; | @@ -112,55 +99,50 @@ UNLOCK TABLES; | ||
| 112 | -- | 99 | -- |
| 113 | 100 | ||
| 114 | DROP TABLE IF EXISTS `device_channel`; | 101 | DROP TABLE IF EXISTS `device_channel`; |
| 115 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 102 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 116 | /*!50503 SET character_set_client = utf8mb4 */; | 103 | /*!50503 SET character_set_client = utf8mb4 */; |
| 117 | -CREATE TABLE `device_channel` | ||
| 118 | -( | ||
| 119 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 120 | - `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 121 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 122 | - `manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 123 | - `model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 124 | - `owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 125 | - `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 126 | - `block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 127 | - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 128 | - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 129 | - `safetyWay` int DEFAULT NULL, | ||
| 130 | - `registerWay` int DEFAULT NULL, | ||
| 131 | - `certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 132 | - `certifiable` int DEFAULT NULL, | ||
| 133 | - `errCode` int DEFAULT NULL, | ||
| 134 | - `endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 135 | - `secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 136 | - `ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 137 | - `port` int DEFAULT NULL, | ||
| 138 | - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 139 | - `PTZType` int DEFAULT NULL, | ||
| 140 | - `status` int DEFAULT NULL, | ||
| 141 | - `longitude` double DEFAULT NULL, | ||
| 142 | - `latitude` double DEFAULT NULL, | ||
| 143 | - `streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 144 | - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 145 | - `parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 146 | - `hasAudio` bit(1) DEFAULT NULL, | ||
| 147 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 148 | - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 149 | - `subCount` int DEFAULT '0 ', | ||
| 150 | - `longitudeGcj02` double DEFAULT NULL, | ||
| 151 | - `latitudeGcj02` double DEFAULT NULL, | ||
| 152 | - `longitudeWgs84` double DEFAULT NULL, | ||
| 153 | - `latitudeWgs84` double DEFAULT NULL, | ||
| 154 | - `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 155 | - `gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 156 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 157 | - UNIQUE KEY `device_channel_id_uindex` (`id`) USING BTREE, | ||
| 158 | - UNIQUE KEY `device_channel_pk` (`channelId`, `deviceId`) USING BTREE | ||
| 159 | -) ENGINE = InnoDB | ||
| 160 | - AUTO_INCREMENT = 19496 | ||
| 161 | - DEFAULT CHARSET = utf8mb4 | ||
| 162 | - COLLATE = utf8mb4_general_ci | ||
| 163 | - ROW_FORMAT = DYNAMIC; | 104 | +CREATE TABLE `device_channel` ( |
| 105 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 106 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 107 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 108 | + `manufacture` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 109 | + `model` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 110 | + `owner` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 111 | + `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 112 | + `block` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 113 | + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 114 | + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 115 | + `safetyWay` int DEFAULT NULL, | ||
| 116 | + `registerWay` int DEFAULT NULL, | ||
| 117 | + `certNum` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 118 | + `certifiable` int DEFAULT NULL, | ||
| 119 | + `errCode` int DEFAULT NULL, | ||
| 120 | + `endTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 121 | + `secrecy` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 122 | + `ipAddress` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 123 | + `port` int DEFAULT NULL, | ||
| 124 | + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 125 | + `PTZType` int DEFAULT NULL, | ||
| 126 | + `status` int DEFAULT NULL, | ||
| 127 | + `longitude` double DEFAULT NULL, | ||
| 128 | + `latitude` double DEFAULT NULL, | ||
| 129 | + `streamId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 130 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 131 | + `parental` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 132 | + `hasAudio` bit(1) DEFAULT NULL, | ||
| 133 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 134 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 135 | + `subCount` int DEFAULT '0', | ||
| 136 | + `longitudeGcj02` double DEFAULT NULL, | ||
| 137 | + `latitudeGcj02` double DEFAULT NULL, | ||
| 138 | + `longitudeWgs84` double DEFAULT NULL, | ||
| 139 | + `latitudeWgs84` double DEFAULT NULL, | ||
| 140 | + `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 141 | + `gpsTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 142 | + PRIMARY KEY (`id`), | ||
| 143 | + UNIQUE KEY `device_channel_id_uindex` (`id`), | ||
| 144 | + UNIQUE KEY `device_channel_pk` (`channelId`,`deviceId`) | ||
| 145 | +) ENGINE=InnoDB AUTO_INCREMENT=60163 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 164 | /*!40101 SET character_set_client = @saved_cs_client */; | 146 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 165 | 147 | ||
| 166 | -- | 148 | -- |
| @@ -168,10 +150,8 @@ CREATE TABLE `device_channel` | @@ -168,10 +150,8 @@ CREATE TABLE `device_channel` | ||
| 168 | -- | 150 | -- |
| 169 | 151 | ||
| 170 | LOCK TABLES `device_channel` WRITE; | 152 | LOCK TABLES `device_channel` WRITE; |
| 171 | -/*!40000 ALTER TABLE `device_channel` | ||
| 172 | - DISABLE KEYS */; | ||
| 173 | -/*!40000 ALTER TABLE `device_channel` | ||
| 174 | - ENABLE KEYS */; | 153 | +/*!40000 ALTER TABLE `device_channel` DISABLE KEYS */; |
| 154 | +/*!40000 ALTER TABLE `device_channel` ENABLE KEYS */; | ||
| 175 | UNLOCK TABLES; | 155 | UNLOCK TABLES; |
| 176 | 156 | ||
| 177 | -- | 157 | -- |
| @@ -179,32 +159,27 @@ UNLOCK TABLES; | @@ -179,32 +159,27 @@ UNLOCK TABLES; | ||
| 179 | -- | 159 | -- |
| 180 | 160 | ||
| 181 | DROP TABLE IF EXISTS `device_mobile_position`; | 161 | DROP TABLE IF EXISTS `device_mobile_position`; |
| 182 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 162 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 183 | /*!50503 SET character_set_client = utf8mb4 */; | 163 | /*!50503 SET character_set_client = utf8mb4 */; |
| 184 | -CREATE TABLE `device_mobile_position` | ||
| 185 | -( | ||
| 186 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 187 | - `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 188 | - `channelId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 189 | - `deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 190 | - `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 191 | - `longitude` double NOT NULL, | ||
| 192 | - `latitude` double NOT NULL, | ||
| 193 | - `altitude` double DEFAULT NULL, | ||
| 194 | - `speed` double DEFAULT NULL, | ||
| 195 | - `direction` double DEFAULT NULL, | ||
| 196 | - `reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 197 | - `longitudeGcj02` double DEFAULT NULL, | ||
| 198 | - `latitudeGcj02` double DEFAULT NULL, | ||
| 199 | - `longitudeWgs84` double DEFAULT NULL, | ||
| 200 | - `latitudeWgs84` double DEFAULT NULL, | ||
| 201 | - `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 202 | - PRIMARY KEY (`id`) USING BTREE | ||
| 203 | -) ENGINE = InnoDB | ||
| 204 | - AUTO_INCREMENT = 6956 | ||
| 205 | - DEFAULT CHARSET = utf8mb4 | ||
| 206 | - COLLATE = utf8mb4_general_ci | ||
| 207 | - ROW_FORMAT = DYNAMIC; | 164 | +CREATE TABLE `device_mobile_position` ( |
| 165 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 166 | + `deviceId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 167 | + `channelId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 168 | + `deviceName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 169 | + `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 170 | + `longitude` double NOT NULL, | ||
| 171 | + `latitude` double NOT NULL, | ||
| 172 | + `altitude` double DEFAULT NULL, | ||
| 173 | + `speed` double DEFAULT NULL, | ||
| 174 | + `direction` double DEFAULT NULL, | ||
| 175 | + `reportSource` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 176 | + `longitudeGcj02` double DEFAULT NULL, | ||
| 177 | + `latitudeGcj02` double DEFAULT NULL, | ||
| 178 | + `longitudeWgs84` double DEFAULT NULL, | ||
| 179 | + `latitudeWgs84` double DEFAULT NULL, | ||
| 180 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 181 | + PRIMARY KEY (`id`) | ||
| 182 | +) ENGINE=InnoDB AUTO_INCREMENT=55589 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 208 | /*!40101 SET character_set_client = @saved_cs_client */; | 183 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 209 | 184 | ||
| 210 | -- | 185 | -- |
| @@ -212,10 +187,8 @@ CREATE TABLE `device_mobile_position` | @@ -212,10 +187,8 @@ CREATE TABLE `device_mobile_position` | ||
| 212 | -- | 187 | -- |
| 213 | 188 | ||
| 214 | LOCK TABLES `device_mobile_position` WRITE; | 189 | LOCK TABLES `device_mobile_position` WRITE; |
| 215 | -/*!40000 ALTER TABLE `device_mobile_position` | ||
| 216 | - DISABLE KEYS */; | ||
| 217 | -/*!40000 ALTER TABLE `device_mobile_position` | ||
| 218 | - ENABLE KEYS */; | 190 | +/*!40000 ALTER TABLE `device_mobile_position` DISABLE KEYS */; |
| 191 | +/*!40000 ALTER TABLE `device_mobile_position` ENABLE KEYS */; | ||
| 219 | UNLOCK TABLES; | 192 | UNLOCK TABLES; |
| 220 | 193 | ||
| 221 | -- | 194 | -- |
| @@ -223,29 +196,23 @@ UNLOCK TABLES; | @@ -223,29 +196,23 @@ UNLOCK TABLES; | ||
| 223 | -- | 196 | -- |
| 224 | 197 | ||
| 225 | DROP TABLE IF EXISTS `gb_stream`; | 198 | DROP TABLE IF EXISTS `gb_stream`; |
| 226 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 199 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 227 | /*!50503 SET character_set_client = utf8mb4 */; | 200 | /*!50503 SET character_set_client = utf8mb4 */; |
| 228 | -CREATE TABLE `gb_stream` | ||
| 229 | -( | ||
| 230 | - `gbStreamId` int NOT NULL AUTO_INCREMENT, | ||
| 231 | - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 232 | - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 233 | - `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 234 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 235 | - `longitude` double DEFAULT NULL, | ||
| 236 | - `latitude` double DEFAULT NULL, | ||
| 237 | - `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 238 | - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 239 | - `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 240 | - `gpsTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 241 | - PRIMARY KEY (`gbStreamId`) USING BTREE, | ||
| 242 | - UNIQUE KEY `app` (`app`, `stream`) USING BTREE, | ||
| 243 | - UNIQUE KEY `gbId` (`gbId`) USING BTREE | ||
| 244 | -) ENGINE = InnoDB | ||
| 245 | - AUTO_INCREMENT = 301754 | ||
| 246 | - DEFAULT CHARSET = utf8mb4 | ||
| 247 | - COLLATE = utf8mb4_general_ci | ||
| 248 | - ROW_FORMAT = DYNAMIC; | 201 | +CREATE TABLE `gb_stream` ( |
| 202 | + `gbStreamId` int NOT NULL AUTO_INCREMENT, | ||
| 203 | + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 204 | + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 205 | + `gbId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 206 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 207 | + `longitude` double DEFAULT NULL, | ||
| 208 | + `latitude` double DEFAULT NULL, | ||
| 209 | + `streamType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 210 | + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 211 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 212 | + PRIMARY KEY (`gbStreamId`) USING BTREE, | ||
| 213 | + UNIQUE KEY `app` (`app`,`stream`) USING BTREE, | ||
| 214 | + UNIQUE KEY `gbId` (`gbId`) USING BTREE | ||
| 215 | +) ENGINE=InnoDB AUTO_INCREMENT=301057 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 249 | /*!40101 SET character_set_client = @saved_cs_client */; | 216 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 250 | 217 | ||
| 251 | -- | 218 | -- |
| @@ -253,10 +220,8 @@ CREATE TABLE `gb_stream` | @@ -253,10 +220,8 @@ CREATE TABLE `gb_stream` | ||
| 253 | -- | 220 | -- |
| 254 | 221 | ||
| 255 | LOCK TABLES `gb_stream` WRITE; | 222 | LOCK TABLES `gb_stream` WRITE; |
| 256 | -/*!40000 ALTER TABLE `gb_stream` | ||
| 257 | - DISABLE KEYS */; | ||
| 258 | -/*!40000 ALTER TABLE `gb_stream` | ||
| 259 | - ENABLE KEYS */; | 223 | +/*!40000 ALTER TABLE `gb_stream` DISABLE KEYS */; |
| 224 | +/*!40000 ALTER TABLE `gb_stream` ENABLE KEYS */; | ||
| 260 | UNLOCK TABLES; | 225 | UNLOCK TABLES; |
| 261 | 226 | ||
| 262 | -- | 227 | -- |
| @@ -264,25 +229,20 @@ UNLOCK TABLES; | @@ -264,25 +229,20 @@ UNLOCK TABLES; | ||
| 264 | -- | 229 | -- |
| 265 | 230 | ||
| 266 | DROP TABLE IF EXISTS `log`; | 231 | DROP TABLE IF EXISTS `log`; |
| 267 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 232 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 268 | /*!50503 SET character_set_client = utf8mb4 */; | 233 | /*!50503 SET character_set_client = utf8mb4 */; |
| 269 | -CREATE TABLE `log` | ||
| 270 | -( | ||
| 271 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 272 | - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 273 | - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 274 | - `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 275 | - `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 276 | - `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 277 | - `timing` bigint NOT NULL, | ||
| 278 | - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 279 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 280 | - PRIMARY KEY (`id`) USING BTREE | ||
| 281 | -) ENGINE = InnoDB | ||
| 282 | - AUTO_INCREMENT = 42703 | ||
| 283 | - DEFAULT CHARSET = utf8mb4 | ||
| 284 | - COLLATE = utf8mb4_general_ci | ||
| 285 | - ROW_FORMAT = DYNAMIC; | 234 | +CREATE TABLE `log` ( |
| 235 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 236 | + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 237 | + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 238 | + `uri` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 239 | + `address` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 240 | + `result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 241 | + `timing` bigint NOT NULL, | ||
| 242 | + `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 243 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 244 | + PRIMARY KEY (`id`) USING BTREE | ||
| 245 | +) ENGINE=InnoDB AUTO_INCREMENT=727574 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 286 | /*!40101 SET character_set_client = @saved_cs_client */; | 246 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 287 | 247 | ||
| 288 | -- | 248 | -- |
| @@ -290,10 +250,8 @@ CREATE TABLE `log` | @@ -290,10 +250,8 @@ CREATE TABLE `log` | ||
| 290 | -- | 250 | -- |
| 291 | 251 | ||
| 292 | LOCK TABLES `log` WRITE; | 252 | LOCK TABLES `log` WRITE; |
| 293 | -/*!40000 ALTER TABLE `log` | ||
| 294 | - DISABLE KEYS */; | ||
| 295 | -/*!40000 ALTER TABLE `log` | ||
| 296 | - ENABLE KEYS */; | 253 | +/*!40000 ALTER TABLE `log` DISABLE KEYS */; |
| 254 | +/*!40000 ALTER TABLE `log` ENABLE KEYS */; | ||
| 297 | UNLOCK TABLES; | 255 | UNLOCK TABLES; |
| 298 | 256 | ||
| 299 | -- | 257 | -- |
| @@ -301,39 +259,35 @@ UNLOCK TABLES; | @@ -301,39 +259,35 @@ UNLOCK TABLES; | ||
| 301 | -- | 259 | -- |
| 302 | 260 | ||
| 303 | DROP TABLE IF EXISTS `media_server`; | 261 | DROP TABLE IF EXISTS `media_server`; |
| 304 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 262 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 305 | /*!50503 SET character_set_client = utf8mb4 */; | 263 | /*!50503 SET character_set_client = utf8mb4 */; |
| 306 | -CREATE TABLE `media_server` | ||
| 307 | -( | ||
| 308 | - `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 309 | - `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 310 | - `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 311 | - `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 312 | - `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 313 | - `httpPort` int NOT NULL, | ||
| 314 | - `httpSSlPort` int NOT NULL, | ||
| 315 | - `rtmpPort` int NOT NULL, | ||
| 316 | - `rtmpSSlPort` int NOT NULL, | ||
| 317 | - `rtpProxyPort` int NOT NULL, | ||
| 318 | - `rtspPort` int NOT NULL, | ||
| 319 | - `rtspSSLPort` int NOT NULL, | ||
| 320 | - `autoConfig` int NOT NULL, | ||
| 321 | - `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 322 | - `streamNoneReaderDelayMS` int NOT NULL, | ||
| 323 | - `rtpEnable` int NOT NULL, | ||
| 324 | - `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 325 | - `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 326 | - `recordAssistPort` int NOT NULL, | ||
| 327 | - `defaultServer` int NOT NULL, | ||
| 328 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 329 | - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 330 | - `hookAliveInterval` int NOT NULL, | ||
| 331 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 332 | - UNIQUE KEY `media_server_i` (`ip`, `httpPort`) USING BTREE | ||
| 333 | -) ENGINE = InnoDB | ||
| 334 | - DEFAULT CHARSET = utf8mb4 | ||
| 335 | - COLLATE = utf8mb4_general_ci | ||
| 336 | - ROW_FORMAT = DYNAMIC; | 264 | +CREATE TABLE `media_server` ( |
| 265 | + `id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 266 | + `ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 267 | + `hookIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 268 | + `sdpIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 269 | + `streamIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 270 | + `httpPort` int NOT NULL, | ||
| 271 | + `httpSSlPort` int NOT NULL, | ||
| 272 | + `rtmpPort` int NOT NULL, | ||
| 273 | + `rtmpSSlPort` int NOT NULL, | ||
| 274 | + `rtpProxyPort` int NOT NULL, | ||
| 275 | + `rtspPort` int NOT NULL, | ||
| 276 | + `rtspSSLPort` int NOT NULL, | ||
| 277 | + `autoConfig` int NOT NULL, | ||
| 278 | + `secret` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 279 | + `streamNoneReaderDelayMS` int NOT NULL, | ||
| 280 | + `rtpEnable` int NOT NULL, | ||
| 281 | + `rtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 282 | + `sendRtpPortRange` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 283 | + `recordAssistPort` int NOT NULL, | ||
| 284 | + `defaultServer` int NOT NULL, | ||
| 285 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 286 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 287 | + `hookAliveInterval` int NOT NULL, | ||
| 288 | + PRIMARY KEY (`id`) USING BTREE, | ||
| 289 | + UNIQUE KEY `media_server_i` (`ip`,`httpPort`) USING BTREE | ||
| 290 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 337 | /*!40101 SET character_set_client = @saved_cs_client */; | 291 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 338 | 292 | ||
| 339 | -- | 293 | -- |
| @@ -341,10 +295,8 @@ CREATE TABLE `media_server` | @@ -341,10 +295,8 @@ CREATE TABLE `media_server` | ||
| 341 | -- | 295 | -- |
| 342 | 296 | ||
| 343 | LOCK TABLES `media_server` WRITE; | 297 | LOCK TABLES `media_server` WRITE; |
| 344 | -/*!40000 ALTER TABLE `media_server` | ||
| 345 | - DISABLE KEYS */; | ||
| 346 | -/*!40000 ALTER TABLE `media_server` | ||
| 347 | - ENABLE KEYS */; | 298 | +/*!40000 ALTER TABLE `media_server` DISABLE KEYS */; |
| 299 | +/*!40000 ALTER TABLE `media_server` ENABLE KEYS */; | ||
| 348 | UNLOCK TABLES; | 300 | UNLOCK TABLES; |
| 349 | 301 | ||
| 350 | -- | 302 | -- |
| @@ -352,44 +304,39 @@ UNLOCK TABLES; | @@ -352,44 +304,39 @@ UNLOCK TABLES; | ||
| 352 | -- | 304 | -- |
| 353 | 305 | ||
| 354 | DROP TABLE IF EXISTS `parent_platform`; | 306 | DROP TABLE IF EXISTS `parent_platform`; |
| 355 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 307 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 356 | /*!50503 SET character_set_client = utf8mb4 */; | 308 | /*!50503 SET character_set_client = utf8mb4 */; |
| 357 | -CREATE TABLE `parent_platform` | ||
| 358 | -( | ||
| 359 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 360 | - `enable` int DEFAULT NULL, | ||
| 361 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 362 | - `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 363 | - `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 364 | - `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 365 | - `serverPort` int DEFAULT NULL, | ||
| 366 | - `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 367 | - `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 368 | - `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 369 | - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 370 | - `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 371 | - `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 372 | - `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 373 | - `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 374 | - `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 375 | - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 376 | - `ptz` int DEFAULT NULL, | ||
| 377 | - `rtcp` int DEFAULT NULL, | ||
| 378 | - `status` bit(1) DEFAULT NULL, | ||
| 379 | - `startOfflinePush` int DEFAULT '0 ', | ||
| 380 | - `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 381 | - `catalogGroup` int DEFAULT '1 ', | ||
| 382 | - `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 383 | - `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 384 | - `treeType` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 385 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 386 | - UNIQUE KEY `parent_platform_id_uindex` (`id`) USING BTREE, | ||
| 387 | - UNIQUE KEY `parent_platform_pk` (`serverGBId`) USING BTREE | ||
| 388 | -) ENGINE = InnoDB | ||
| 389 | - AUTO_INCREMENT = 40 | ||
| 390 | - DEFAULT CHARSET = utf8mb4 | ||
| 391 | - COLLATE = utf8mb4_general_ci | ||
| 392 | - ROW_FORMAT = DYNAMIC; | 309 | +CREATE TABLE `parent_platform` ( |
| 310 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 311 | + `enable` int DEFAULT NULL, | ||
| 312 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 313 | + `serverGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 314 | + `serverGBDomain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 315 | + `serverIP` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 316 | + `serverPort` int DEFAULT NULL, | ||
| 317 | + `deviceGBId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 318 | + `deviceIp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 319 | + `devicePort` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 320 | + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 321 | + `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 322 | + `expires` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 323 | + `keepTimeout` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 324 | + `transport` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 325 | + `characterSet` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 326 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 327 | + `ptz` int DEFAULT NULL, | ||
| 328 | + `rtcp` int DEFAULT NULL, | ||
| 329 | + `status` bit(1) DEFAULT NULL, | ||
| 330 | + `startOfflinePush` int DEFAULT '0', | ||
| 331 | + `administrativeDivision` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 332 | + `catalogGroup` int DEFAULT '1', | ||
| 333 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 334 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 335 | + `treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 336 | + PRIMARY KEY (`id`), | ||
| 337 | + UNIQUE KEY `parent_platform_id_uindex` (`id`), | ||
| 338 | + UNIQUE KEY `parent_platform_pk` (`serverGBId`) | ||
| 339 | +) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 393 | /*!40101 SET character_set_client = @saved_cs_client */; | 340 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 394 | 341 | ||
| 395 | -- | 342 | -- |
| @@ -397,10 +344,8 @@ CREATE TABLE `parent_platform` | @@ -397,10 +344,8 @@ CREATE TABLE `parent_platform` | ||
| 397 | -- | 344 | -- |
| 398 | 345 | ||
| 399 | LOCK TABLES `parent_platform` WRITE; | 346 | LOCK TABLES `parent_platform` WRITE; |
| 400 | -/*!40000 ALTER TABLE `parent_platform` | ||
| 401 | - DISABLE KEYS */; | ||
| 402 | -/*!40000 ALTER TABLE `parent_platform` | ||
| 403 | - ENABLE KEYS */; | 347 | +/*!40000 ALTER TABLE `parent_platform` DISABLE KEYS */; |
| 348 | +/*!40000 ALTER TABLE `parent_platform` ENABLE KEYS */; | ||
| 404 | UNLOCK TABLES; | 349 | UNLOCK TABLES; |
| 405 | 350 | ||
| 406 | -- | 351 | -- |
| @@ -408,21 +353,17 @@ UNLOCK TABLES; | @@ -408,21 +353,17 @@ UNLOCK TABLES; | ||
| 408 | -- | 353 | -- |
| 409 | 354 | ||
| 410 | DROP TABLE IF EXISTS `platform_catalog`; | 355 | DROP TABLE IF EXISTS `platform_catalog`; |
| 411 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 356 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 412 | /*!50503 SET character_set_client = utf8mb4 */; | 357 | /*!50503 SET character_set_client = utf8mb4 */; |
| 413 | -CREATE TABLE `platform_catalog` | ||
| 414 | -( | ||
| 415 | - `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 416 | - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 417 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 418 | - `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 419 | - `civilCode` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 420 | - `businessGroupId` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 421 | - PRIMARY KEY (`id`) USING BTREE | ||
| 422 | -) ENGINE = InnoDB | ||
| 423 | - DEFAULT CHARSET = utf8mb4 | ||
| 424 | - COLLATE = utf8mb4_general_ci | ||
| 425 | - ROW_FORMAT = DYNAMIC; | 358 | +CREATE TABLE `platform_catalog` ( |
| 359 | + `id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 360 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 361 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 362 | + `parentId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 363 | + `civilCode` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 364 | + `businessGroupId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 365 | + PRIMARY KEY (`id`) USING BTREE | ||
| 366 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 426 | /*!40101 SET character_set_client = @saved_cs_client */; | 367 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 427 | 368 | ||
| 428 | -- | 369 | -- |
| @@ -430,10 +371,8 @@ CREATE TABLE `platform_catalog` | @@ -430,10 +371,8 @@ CREATE TABLE `platform_catalog` | ||
| 430 | -- | 371 | -- |
| 431 | 372 | ||
| 432 | LOCK TABLES `platform_catalog` WRITE; | 373 | LOCK TABLES `platform_catalog` WRITE; |
| 433 | -/*!40000 ALTER TABLE `platform_catalog` | ||
| 434 | - DISABLE KEYS */; | ||
| 435 | -/*!40000 ALTER TABLE `platform_catalog` | ||
| 436 | - ENABLE KEYS */; | 374 | +/*!40000 ALTER TABLE `platform_catalog` DISABLE KEYS */; |
| 375 | +/*!40000 ALTER TABLE `platform_catalog` ENABLE KEYS */; | ||
| 437 | UNLOCK TABLES; | 376 | UNLOCK TABLES; |
| 438 | 377 | ||
| 439 | -- | 378 | -- |
| @@ -441,20 +380,15 @@ UNLOCK TABLES; | @@ -441,20 +380,15 @@ UNLOCK TABLES; | ||
| 441 | -- | 380 | -- |
| 442 | 381 | ||
| 443 | DROP TABLE IF EXISTS `platform_gb_channel`; | 382 | DROP TABLE IF EXISTS `platform_gb_channel`; |
| 444 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 383 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 445 | /*!50503 SET character_set_client = utf8mb4 */; | 384 | /*!50503 SET character_set_client = utf8mb4 */; |
| 446 | -CREATE TABLE `platform_gb_channel` | ||
| 447 | -( | ||
| 448 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 449 | - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 450 | - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 451 | - `deviceChannelId` int NOT NULL, | ||
| 452 | - PRIMARY KEY (`id`) USING BTREE | ||
| 453 | -) ENGINE = InnoDB | ||
| 454 | - AUTO_INCREMENT = 4915 | ||
| 455 | - DEFAULT CHARSET = utf8mb4 | ||
| 456 | - COLLATE = utf8mb4_general_ci | ||
| 457 | - ROW_FORMAT = DYNAMIC; | 385 | +CREATE TABLE `platform_gb_channel` ( |
| 386 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 387 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 388 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 389 | + `deviceChannelId` int NOT NULL, | ||
| 390 | + PRIMARY KEY (`id`) | ||
| 391 | +) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 458 | /*!40101 SET character_set_client = @saved_cs_client */; | 392 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 459 | 393 | ||
| 460 | -- | 394 | -- |
| @@ -462,10 +396,8 @@ CREATE TABLE `platform_gb_channel` | @@ -462,10 +396,8 @@ CREATE TABLE `platform_gb_channel` | ||
| 462 | -- | 396 | -- |
| 463 | 397 | ||
| 464 | LOCK TABLES `platform_gb_channel` WRITE; | 398 | LOCK TABLES `platform_gb_channel` WRITE; |
| 465 | -/*!40000 ALTER TABLE `platform_gb_channel` | ||
| 466 | - DISABLE KEYS */; | ||
| 467 | -/*!40000 ALTER TABLE `platform_gb_channel` | ||
| 468 | - ENABLE KEYS */; | 399 | +/*!40000 ALTER TABLE `platform_gb_channel` DISABLE KEYS */; |
| 400 | +/*!40000 ALTER TABLE `platform_gb_channel` ENABLE KEYS */; | ||
| 469 | UNLOCK TABLES; | 401 | UNLOCK TABLES; |
| 470 | 402 | ||
| 471 | -- | 403 | -- |
| @@ -473,21 +405,16 @@ UNLOCK TABLES; | @@ -473,21 +405,16 @@ UNLOCK TABLES; | ||
| 473 | -- | 405 | -- |
| 474 | 406 | ||
| 475 | DROP TABLE IF EXISTS `platform_gb_stream`; | 407 | DROP TABLE IF EXISTS `platform_gb_stream`; |
| 476 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 408 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 477 | /*!50503 SET character_set_client = utf8mb4 */; | 409 | /*!50503 SET character_set_client = utf8mb4 */; |
| 478 | -CREATE TABLE `platform_gb_stream` | ||
| 479 | -( | ||
| 480 | - `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 481 | - `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 482 | - `gbStreamId` int NOT NULL, | ||
| 483 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 484 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 485 | - UNIQUE KEY `platform_gb_stream_pk` (`platformId`, `catalogId`, `gbStreamId`) USING BTREE | ||
| 486 | -) ENGINE = InnoDB | ||
| 487 | - AUTO_INCREMENT = 302149 | ||
| 488 | - DEFAULT CHARSET = utf8mb4 | ||
| 489 | - COLLATE = utf8mb4_general_ci | ||
| 490 | - ROW_FORMAT = DYNAMIC; | 410 | +CREATE TABLE `platform_gb_stream` ( |
| 411 | + `platformId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 412 | + `catalogId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 413 | + `gbStreamId` int NOT NULL, | ||
| 414 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 415 | + PRIMARY KEY (`id`), | ||
| 416 | + UNIQUE KEY `platform_gb_stream_pk` (`platformId`,`catalogId`,`gbStreamId`) | ||
| 417 | +) ENGINE=InnoDB AUTO_INCREMENT=301759 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 491 | /*!40101 SET character_set_client = @saved_cs_client */; | 418 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 492 | 419 | ||
| 493 | -- | 420 | -- |
| @@ -495,10 +422,8 @@ CREATE TABLE `platform_gb_stream` | @@ -495,10 +422,8 @@ CREATE TABLE `platform_gb_stream` | ||
| 495 | -- | 422 | -- |
| 496 | 423 | ||
| 497 | LOCK TABLES `platform_gb_stream` WRITE; | 424 | LOCK TABLES `platform_gb_stream` WRITE; |
| 498 | -/*!40000 ALTER TABLE `platform_gb_stream` | ||
| 499 | - DISABLE KEYS */; | ||
| 500 | -/*!40000 ALTER TABLE `platform_gb_stream` | ||
| 501 | - ENABLE KEYS */; | 425 | +/*!40000 ALTER TABLE `platform_gb_stream` DISABLE KEYS */; |
| 426 | +/*!40000 ALTER TABLE `platform_gb_stream` ENABLE KEYS */; | ||
| 502 | UNLOCK TABLES; | 427 | UNLOCK TABLES; |
| 503 | 428 | ||
| 504 | -- | 429 | -- |
| @@ -506,36 +431,31 @@ UNLOCK TABLES; | @@ -506,36 +431,31 @@ UNLOCK TABLES; | ||
| 506 | -- | 431 | -- |
| 507 | 432 | ||
| 508 | DROP TABLE IF EXISTS `stream_proxy`; | 433 | DROP TABLE IF EXISTS `stream_proxy`; |
| 509 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 434 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 510 | /*!50503 SET character_set_client = utf8mb4 */; | 435 | /*!50503 SET character_set_client = utf8mb4 */; |
| 511 | -CREATE TABLE `stream_proxy` | ||
| 512 | -( | ||
| 513 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 514 | - `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 515 | - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 516 | - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 517 | - `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 518 | - `src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 519 | - `dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 520 | - `timeout_ms` int DEFAULT NULL, | ||
| 521 | - `ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 522 | - `rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 523 | - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 524 | - `enable_hls` bit(1) DEFAULT NULL, | ||
| 525 | - `enable_mp4` bit(1) DEFAULT NULL, | ||
| 526 | - `enable` bit(1) NOT NULL, | ||
| 527 | - `status` bit(1) NOT NULL, | ||
| 528 | - `enable_remove_none_reader` bit(1) NOT NULL, | ||
| 529 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 530 | - `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 531 | - `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 532 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 533 | - UNIQUE KEY `stream_proxy_pk` (`app`, `stream`) USING BTREE | ||
| 534 | -) ENGINE = InnoDB | ||
| 535 | - AUTO_INCREMENT = 66 | ||
| 536 | - DEFAULT CHARSET = utf8mb4 | ||
| 537 | - COLLATE = utf8mb4_general_ci | ||
| 538 | - ROW_FORMAT = DYNAMIC; | 436 | +CREATE TABLE `stream_proxy` ( |
| 437 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 438 | + `type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 439 | + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 440 | + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 441 | + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 442 | + `src_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 443 | + `dst_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 444 | + `timeout_ms` int DEFAULT NULL, | ||
| 445 | + `ffmpeg_cmd_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 446 | + `rtp_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 447 | + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 448 | + `enable_hls` bit(1) DEFAULT NULL, | ||
| 449 | + `enable_mp4` bit(1) DEFAULT NULL, | ||
| 450 | + `enable` bit(1) NOT NULL, | ||
| 451 | + `status` bit(1) NOT NULL, | ||
| 452 | + `enable_remove_none_reader` bit(1) NOT NULL, | ||
| 453 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 454 | + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 455 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 456 | + PRIMARY KEY (`id`), | ||
| 457 | + UNIQUE KEY `stream_proxy_pk` (`app`,`stream`) | ||
| 458 | +) ENGINE=InnoDB AUTO_INCREMENT=545 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 539 | /*!40101 SET character_set_client = @saved_cs_client */; | 459 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 540 | 460 | ||
| 541 | -- | 461 | -- |
| @@ -543,10 +463,8 @@ CREATE TABLE `stream_proxy` | @@ -543,10 +463,8 @@ CREATE TABLE `stream_proxy` | ||
| 543 | -- | 463 | -- |
| 544 | 464 | ||
| 545 | LOCK TABLES `stream_proxy` WRITE; | 465 | LOCK TABLES `stream_proxy` WRITE; |
| 546 | -/*!40000 ALTER TABLE `stream_proxy` | ||
| 547 | - DISABLE KEYS */; | ||
| 548 | -/*!40000 ALTER TABLE `stream_proxy` | ||
| 549 | - ENABLE KEYS */; | 466 | +/*!40000 ALTER TABLE `stream_proxy` DISABLE KEYS */; |
| 467 | +/*!40000 ALTER TABLE `stream_proxy` ENABLE KEYS */; | ||
| 550 | UNLOCK TABLES; | 468 | UNLOCK TABLES; |
| 551 | 469 | ||
| 552 | -- | 470 | -- |
| @@ -554,32 +472,27 @@ UNLOCK TABLES; | @@ -554,32 +472,27 @@ UNLOCK TABLES; | ||
| 554 | -- | 472 | -- |
| 555 | 473 | ||
| 556 | DROP TABLE IF EXISTS `stream_push`; | 474 | DROP TABLE IF EXISTS `stream_push`; |
| 557 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 475 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 558 | /*!50503 SET character_set_client = utf8mb4 */; | 476 | /*!50503 SET character_set_client = utf8mb4 */; |
| 559 | -CREATE TABLE `stream_push` | ||
| 560 | -( | ||
| 561 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 562 | - `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 563 | - `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 564 | - `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 565 | - `originType` int DEFAULT NULL, | ||
| 566 | - `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 567 | - `createTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 568 | - `aliveSecond` int DEFAULT NULL, | ||
| 569 | - `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 570 | - `serverId` varchar(50) COLLATE utf8mb4_general_ci NOT NULL, | ||
| 571 | - `pushTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 572 | - `updateTime` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 573 | - `status` int DEFAULT NULL, | ||
| 574 | - `pushIng` int DEFAULT NULL, | ||
| 575 | - `self` int DEFAULT NULL, | ||
| 576 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 577 | - UNIQUE KEY `stream_push_pk` (`app`, `stream`) USING BTREE | ||
| 578 | -) ENGINE = InnoDB | ||
| 579 | - AUTO_INCREMENT = 305415 | ||
| 580 | - DEFAULT CHARSET = utf8mb4 | ||
| 581 | - COLLATE = utf8mb4_general_ci | ||
| 582 | - ROW_FORMAT = DYNAMIC; | 477 | +CREATE TABLE `stream_push` ( |
| 478 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 479 | + `app` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 480 | + `stream` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 481 | + `totalReaderCount` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 482 | + `originType` int DEFAULT NULL, | ||
| 483 | + `originTypeStr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 484 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 485 | + `aliveSecond` int DEFAULT NULL, | ||
| 486 | + `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 487 | + `serverId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 488 | + `pushTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 489 | + `status` int DEFAULT NULL, | ||
| 490 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 491 | + `pushIng` int DEFAULT NULL, | ||
| 492 | + `self` int DEFAULT NULL, | ||
| 493 | + PRIMARY KEY (`id`), | ||
| 494 | + UNIQUE KEY `stream_push_pk` (`app`,`stream`) | ||
| 495 | +) ENGINE=InnoDB AUTO_INCREMENT=310546 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
| 583 | /*!40101 SET character_set_client = @saved_cs_client */; | 496 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 584 | 497 | ||
| 585 | -- | 498 | -- |
| @@ -587,10 +500,8 @@ CREATE TABLE `stream_push` | @@ -587,10 +500,8 @@ CREATE TABLE `stream_push` | ||
| 587 | -- | 500 | -- |
| 588 | 501 | ||
| 589 | LOCK TABLES `stream_push` WRITE; | 502 | LOCK TABLES `stream_push` WRITE; |
| 590 | -/*!40000 ALTER TABLE `stream_push` | ||
| 591 | - DISABLE KEYS */; | ||
| 592 | -/*!40000 ALTER TABLE `stream_push` | ||
| 593 | - ENABLE KEYS */; | 503 | +/*!40000 ALTER TABLE `stream_push` DISABLE KEYS */; |
| 504 | +/*!40000 ALTER TABLE `stream_push` ENABLE KEYS */; | ||
| 594 | UNLOCK TABLES; | 505 | UNLOCK TABLES; |
| 595 | 506 | ||
| 596 | -- | 507 | -- |
| @@ -598,24 +509,19 @@ UNLOCK TABLES; | @@ -598,24 +509,19 @@ UNLOCK TABLES; | ||
| 598 | -- | 509 | -- |
| 599 | 510 | ||
| 600 | DROP TABLE IF EXISTS `user`; | 511 | DROP TABLE IF EXISTS `user`; |
| 601 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 512 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 602 | /*!50503 SET character_set_client = utf8mb4 */; | 513 | /*!50503 SET character_set_client = utf8mb4 */; |
| 603 | -CREATE TABLE `user` | ||
| 604 | -( | ||
| 605 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 606 | - `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 607 | - `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 608 | - `roleId` int NOT NULL, | ||
| 609 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 610 | - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 611 | - `pushKey` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 612 | - PRIMARY KEY (`id`) USING BTREE, | ||
| 613 | - UNIQUE KEY `user_username_uindex` (`username`) USING BTREE | ||
| 614 | -) ENGINE = InnoDB | ||
| 615 | - AUTO_INCREMENT = 2 | ||
| 616 | - DEFAULT CHARSET = utf8mb4 | ||
| 617 | - COLLATE = utf8mb4_general_ci | ||
| 618 | - ROW_FORMAT = DYNAMIC; | 514 | +CREATE TABLE `user` ( |
| 515 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 516 | + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 517 | + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 518 | + `roleId` int NOT NULL, | ||
| 519 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 520 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 521 | + `pushKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, | ||
| 522 | + PRIMARY KEY (`id`) USING BTREE, | ||
| 523 | + UNIQUE KEY `user_username_uindex` (`username`) USING BTREE | ||
| 524 | +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 619 | /*!40101 SET character_set_client = @saved_cs_client */; | 525 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 620 | 526 | ||
| 621 | -- | 527 | -- |
| @@ -623,13 +529,9 @@ CREATE TABLE `user` | @@ -623,13 +529,9 @@ CREATE TABLE `user` | ||
| 623 | -- | 529 | -- |
| 624 | 530 | ||
| 625 | LOCK TABLES `user` WRITE; | 531 | LOCK TABLES `user` WRITE; |
| 626 | -/*!40000 ALTER TABLE `user` | ||
| 627 | - DISABLE KEYS */; | ||
| 628 | -INSERT INTO `user` | ||
| 629 | -VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 1, '2021 - 04 - 13 14:14:57', '2021 - 04 - 13 14:14:57', | ||
| 630 | - '01685cb9573ae25ec6c52142402da7c5'); | ||
| 631 | -/*!40000 ALTER TABLE `user` | ||
| 632 | - ENABLE KEYS */; | 532 | +/*!40000 ALTER TABLE `user` DISABLE KEYS */; |
| 533 | +INSERT INTO `user` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3',1,'2021 - 04 - 13 14:14:57','2021 - 04 - 13 14:14:57','3e80d1762a324d5b0ff636e0bd16f1e3'); | ||
| 534 | +/*!40000 ALTER TABLE `user` ENABLE KEYS */; | ||
| 633 | UNLOCK TABLES; | 535 | UNLOCK TABLES; |
| 634 | 536 | ||
| 635 | -- | 537 | -- |
| @@ -637,21 +539,16 @@ UNLOCK TABLES; | @@ -637,21 +539,16 @@ UNLOCK TABLES; | ||
| 637 | -- | 539 | -- |
| 638 | 540 | ||
| 639 | DROP TABLE IF EXISTS `user_role`; | 541 | DROP TABLE IF EXISTS `user_role`; |
| 640 | -/*!40101 SET @saved_cs_client = @@character_set_client */; | 542 | +/*!40101 SET @saved_cs_client = @@character_set_client */; |
| 641 | /*!50503 SET character_set_client = utf8mb4 */; | 543 | /*!50503 SET character_set_client = utf8mb4 */; |
| 642 | -CREATE TABLE `user_role` | ||
| 643 | -( | ||
| 644 | - `id` int NOT NULL AUTO_INCREMENT, | ||
| 645 | - `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 646 | - `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 647 | - `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 648 | - `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 649 | - PRIMARY KEY (`id`) USING BTREE | ||
| 650 | -) ENGINE = InnoDB | ||
| 651 | - AUTO_INCREMENT = 2 | ||
| 652 | - DEFAULT CHARSET = utf8mb4 | ||
| 653 | - COLLATE = utf8mb4_general_ci | ||
| 654 | - ROW_FORMAT = DYNAMIC; | 544 | +CREATE TABLE `user_role` ( |
| 545 | + `id` int NOT NULL AUTO_INCREMENT, | ||
| 546 | + `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 547 | + `authority` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 548 | + `createTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 549 | + `updateTime` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, | ||
| 550 | + PRIMARY KEY (`id`) USING BTREE | ||
| 551 | +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC; | ||
| 655 | /*!40101 SET character_set_client = @saved_cs_client */; | 552 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 656 | 553 | ||
| 657 | -- | 554 | -- |
| @@ -659,21 +556,18 @@ CREATE TABLE `user_role` | @@ -659,21 +556,18 @@ CREATE TABLE `user_role` | ||
| 659 | -- | 556 | -- |
| 660 | 557 | ||
| 661 | LOCK TABLES `user_role` WRITE; | 558 | LOCK TABLES `user_role` WRITE; |
| 662 | -/*!40000 ALTER TABLE `user_role` | ||
| 663 | - DISABLE KEYS */; | ||
| 664 | -INSERT INTO `user_role` | ||
| 665 | -VALUES (1, 'admin', '0 ', '2021 - 04 - 13 14:14:57', '2021 - 04 - 13 14:14:57'); | ||
| 666 | -/*!40000 ALTER TABLE `user_role` | ||
| 667 | - ENABLE KEYS */; | 559 | +/*!40000 ALTER TABLE `user_role` DISABLE KEYS */; |
| 560 | +INSERT INTO `user_role` VALUES (1,'admin','0','2021-04-13 14:14:57','2021-04-13 14:14:57'); | ||
| 561 | +/*!40000 ALTER TABLE `user_role` ENABLE KEYS */; | ||
| 668 | UNLOCK TABLES; | 562 | UNLOCK TABLES; |
| 669 | -/*!40103 SET TIME_ZONE = @OLD_TIME_ZONE */; | 563 | +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
| 670 | 564 | ||
| 671 | -/*!40101 SET SQL_MODE = @OLD_SQL_MODE */; | ||
| 672 | -/*!40014 SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS */; | ||
| 673 | -/*!40014 SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS */; | ||
| 674 | -/*!40101 SET CHARACTER_SET_CLIENT = @OLD_CHARACTER_SET_CLIENT */; | ||
| 675 | -/*!40101 SET CHARACTER_SET_RESULTS = @OLD_CHARACTER_SET_RESULTS */; | ||
| 676 | -/*!40101 SET COLLATION_CONNECTION = @OLD_COLLATION_CONNECTION */; | ||
| 677 | -/*!40111 SET SQL_NOTES = @OLD_SQL_NOTES */; | 565 | +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
| 566 | +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; | ||
| 567 | +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; | ||
| 568 | +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; | ||
| 569 | +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; | ||
| 570 | +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; | ||
| 571 | +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; | ||
| 678 | 572 | ||
| 679 | --- Dump completed on 2022-07-27 14:51:08 | 573 | +-- Dump completed on 2022-09-08 16:46:27 |
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
| @@ -3,6 +3,12 @@ package com.genersoft.iot.vmp; | @@ -3,6 +3,12 @@ package com.genersoft.iot.vmp; | ||
| 3 | import java.util.logging.LogManager; | 3 | import java.util.logging.LogManager; |
| 4 | 4 | ||
| 5 | import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport; | 5 | import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport; |
| 6 | +import com.genersoft.iot.vmp.storager.impl.RedisCatchStorageImpl; | ||
| 7 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 8 | +import com.genersoft.iot.vmp.utils.SpringBeanFactory; | ||
| 9 | +import org.slf4j.Logger; | ||
| 10 | +import org.slf4j.LoggerFactory; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | import org.springframework.boot.SpringApplication; | 12 | import org.springframework.boot.SpringApplication; |
| 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 13 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 8 | import org.springframework.boot.web.servlet.ServletComponentScan; | 14 | import org.springframework.boot.web.servlet.ServletComponentScan; |
| @@ -17,11 +23,18 @@ import org.springframework.scheduling.annotation.EnableScheduling; | @@ -17,11 +23,18 @@ import org.springframework.scheduling.annotation.EnableScheduling; | ||
| 17 | @EnableScheduling | 23 | @EnableScheduling |
| 18 | @EnableDruidSupport | 24 | @EnableDruidSupport |
| 19 | public class VManageBootstrap extends LogManager { | 25 | public class VManageBootstrap extends LogManager { |
| 26 | + | ||
| 27 | + private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class); | ||
| 28 | + | ||
| 20 | private static String[] args; | 29 | private static String[] args; |
| 21 | private static ConfigurableApplicationContext context; | 30 | private static ConfigurableApplicationContext context; |
| 22 | public static void main(String[] args) { | 31 | public static void main(String[] args) { |
| 23 | VManageBootstrap.args = args; | 32 | VManageBootstrap.args = args; |
| 24 | VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); | 33 | VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); |
| 34 | + GitUtil gitUtil1 = SpringBeanFactory.getBean("gitUtil"); | ||
| 35 | + logger.info("构建版本: {}", gitUtil1.getBuildVersion()); | ||
| 36 | + logger.info("构建时间: {}", gitUtil1.getBuildDate()); | ||
| 37 | + logger.info("GIT最后提交时间: {}", gitUtil1.getCommitTime()); | ||
| 25 | } | 38 | } |
| 26 | // 项目重启 | 39 | // 项目重启 |
| 27 | public static void restart() { | 40 | public static void restart() { |
src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
| @@ -99,6 +99,12 @@ public class VideoManagerConstants { | @@ -99,6 +99,12 @@ public class VideoManagerConstants { | ||
| 99 | */ | 99 | */ |
| 100 | public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED"; | 100 | public static final String VM_MSG_STREAM_PUSH_REQUESTED = "VM_MSG_STREAM_PUSH_REQUESTED"; |
| 101 | 101 | ||
| 102 | + | ||
| 103 | + /** | ||
| 104 | + * redis 消息通知平台通知设备推流结果 | ||
| 105 | + */ | ||
| 106 | + public static final String VM_MSG_STREAM_PUSH_RESPONSE = "VM_MSG_STREAM_PUSH_RESPONSE"; | ||
| 107 | + | ||
| 102 | /** | 108 | /** |
| 103 | * redis 消息请求所有的在线通道 | 109 | * redis 消息请求所有的在线通道 |
| 104 | */ | 110 | */ |
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java
| @@ -46,17 +46,12 @@ public class SipPlatformRunner implements CommandLineRunner { | @@ -46,17 +46,12 @@ public class SipPlatformRunner implements CommandLineRunner { | ||
| 46 | parentPlatformCatch.setParentPlatform(parentPlatform); | 46 | parentPlatformCatch.setParentPlatform(parentPlatform); |
| 47 | parentPlatformCatch.setId(parentPlatform.getServerGBId()); | 47 | parentPlatformCatch.setId(parentPlatform.getServerGBId()); |
| 48 | redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); | 48 | redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); |
| 49 | - if (parentPlatform.isStatus()) { | ||
| 50 | - // 设置所有平台离线 | ||
| 51 | - platformService.offline(parentPlatform); | ||
| 52 | - // 取消订阅 | ||
| 53 | - sipCommanderForPlatform.unregister(parentPlatform, null, (eventResult)->{ | ||
| 54 | - platformService.login(parentPlatform); | ||
| 55 | - }); | ||
| 56 | - }else { | 49 | + // 设置所有平台离线 |
| 50 | + platformService.offline(parentPlatform); | ||
| 51 | + // 取消订阅 | ||
| 52 | + sipCommanderForPlatform.unregister(parentPlatform, null, (eventResult)->{ | ||
| 57 | platformService.login(parentPlatform); | 53 | platformService.login(parentPlatform); |
| 58 | - } | ||
| 59 | - | 54 | + }); |
| 60 | } | 55 | } |
| 61 | } | 56 | } |
| 62 | } | 57 | } |
src/main/java/com/genersoft/iot/vmp/conf/redis/RedisConfig.java
| @@ -12,7 +12,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; | @@ -12,7 +12,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory; | ||
| 12 | import org.springframework.data.redis.core.RedisTemplate; | 12 | import org.springframework.data.redis.core.RedisTemplate; |
| 13 | import org.springframework.data.redis.listener.PatternTopic; | 13 | import org.springframework.data.redis.listener.PatternTopic; |
| 14 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; | 14 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| 15 | -import org.springframework.data.redis.serializer.RedisSerializer; | ||
| 16 | import org.springframework.data.redis.serializer.StringRedisSerializer; | 15 | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| 17 | 16 | ||
| 18 | import com.genersoft.iot.vmp.utils.redis.FastJsonRedisSerializer; | 17 | import com.genersoft.iot.vmp.utils.redis.FastJsonRedisSerializer; |
| @@ -43,7 +42,10 @@ public class RedisConfig extends CachingConfigurerSupport { | @@ -43,7 +42,10 @@ public class RedisConfig extends CachingConfigurerSupport { | ||
| 43 | private RedisPushStreamStatusMsgListener redisPushStreamStatusMsgListener; | 42 | private RedisPushStreamStatusMsgListener redisPushStreamStatusMsgListener; |
| 44 | 43 | ||
| 45 | @Autowired | 44 | @Autowired |
| 46 | - private RedisPushStreamListMsgListener redisPushStreamListMsgListener; | 45 | + private RedisPushStreamStatusListMsgListener redisPushStreamListMsgListener; |
| 46 | + | ||
| 47 | + @Autowired | ||
| 48 | + private RedisPushStreamResponseListener redisPushStreamResponseListener; | ||
| 47 | 49 | ||
| 48 | @Bean | 50 | @Bean |
| 49 | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { | 51 | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
| @@ -81,7 +83,7 @@ public class RedisConfig extends CachingConfigurerSupport { | @@ -81,7 +83,7 @@ public class RedisConfig extends CachingConfigurerSupport { | ||
| 81 | container.addMessageListener(redisGbPlayMsgListener, new PatternTopic(RedisGbPlayMsgListener.WVP_PUSH_STREAM_KEY)); | 83 | container.addMessageListener(redisGbPlayMsgListener, new PatternTopic(RedisGbPlayMsgListener.WVP_PUSH_STREAM_KEY)); |
| 82 | container.addMessageListener(redisPushStreamStatusMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_PUSH_STREAM_STATUS_CHANGE)); | 84 | container.addMessageListener(redisPushStreamStatusMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_PUSH_STREAM_STATUS_CHANGE)); |
| 83 | container.addMessageListener(redisPushStreamListMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_PUSH_STREAM_LIST_CHANGE)); | 85 | container.addMessageListener(redisPushStreamListMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_PUSH_STREAM_LIST_CHANGE)); |
| 86 | + container.addMessageListener(redisPushStreamResponseListener, new PatternTopic(VideoManagerConstants.VM_MSG_STREAM_PUSH_RESPONSE)); | ||
| 84 | return container; | 87 | return container; |
| 85 | } | 88 | } |
| 86 | - | ||
| 87 | } | 89 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
| @@ -49,6 +49,7 @@ public class SipLayer{ | @@ -49,6 +49,7 @@ public class SipLayer{ | ||
| 49 | * gov/nist/javax/sip/SipStackImpl.class | 49 | * gov/nist/javax/sip/SipStackImpl.class |
| 50 | * sip消息的解析在 gov.nist.javax.sip.stack.UDPMessageChannel的processIncomingDataPacket方法 | 50 | * sip消息的解析在 gov.nist.javax.sip.stack.UDPMessageChannel的processIncomingDataPacket方法 |
| 51 | */ | 51 | */ |
| 52 | + | ||
| 52 | // * gov/nist/javax/sip/SipStackImpl.class | 53 | // * gov/nist/javax/sip/SipStackImpl.class |
| 53 | if (logger.isDebugEnabled()) { | 54 | if (logger.isDebugEnabled()) { |
| 54 | properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "false"); | 55 | properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "false"); |
| @@ -63,6 +64,8 @@ public class SipLayer{ | @@ -63,6 +64,8 @@ public class SipLayer{ | ||
| 63 | properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal"); | 64 | properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal"); |
| 64 | // 处理由该服务器处理的基于底层TCP的保持生存超时 | 65 | // 处理由该服务器处理的基于底层TCP的保持生存超时 |
| 65 | properties.setProperty("gov.nist.javax.sip.RELIABLE_CONNECTION_KEEP_ALIVE_TIMEOUT", "60"); | 66 | properties.setProperty("gov.nist.javax.sip.RELIABLE_CONNECTION_KEEP_ALIVE_TIMEOUT", "60"); |
| 67 | + // 获取实际内容长度,不使用header中的长度信息 | ||
| 68 | + properties.setProperty("gov.nist.javax.sip.COMPUTE_CONTENT_LENGTH_FROM_MESSAGE_BODY", "true"); | ||
| 66 | 69 | ||
| 67 | /** | 70 | /** |
| 68 | * sip_server_log.log 和 sip_debug_log.log ERROR, INFO, WARNING, OFF, DEBUG, TRACE | 71 | * sip_server_log.log 和 sip_debug_log.log ERROR, INFO, WARNING, OFF, DEBUG, TRACE |
src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java
| @@ -132,7 +132,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | @@ -132,7 +132,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | ||
| 132 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ | 132 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ |
| 133 | for (GbStream gbStream : event.getGbStreams()) { | 133 | for (GbStream gbStream : event.getGbStreams()) { |
| 134 | deviceChannelList.add( | 134 | deviceChannelList.add( |
| 135 | - gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform)); | 135 | + gbStreamService.getDeviceChannelListByStreamWithStatus(gbStream, gbStream.getCatalogId(), parentPlatform)); |
| 136 | } | 136 | } |
| 137 | } | 137 | } |
| 138 | if (deviceChannelList.size() > 0) { | 138 | if (deviceChannelList.size() > 0) { |
| @@ -154,7 +154,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | @@ -154,7 +154,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { | ||
| 154 | deviceChannelList.add(deviceChannel); | 154 | deviceChannelList.add(deviceChannel); |
| 155 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); | 155 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); |
| 156 | if(gbStream != null){ | 156 | if(gbStream != null){ |
| 157 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform); | 157 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStreamWithStatus(gbStream, gbStream.getCatalogId(), platform); |
| 158 | deviceChannelList.add(deviceChannelByStream); | 158 | deviceChannelList.add(deviceChannelByStream); |
| 159 | } | 159 | } |
| 160 | sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), platform, deviceChannelList, subscribeInfo, null); | 160 | sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), platform, deviceChannelList, subscribeInfo, null); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderPlarformProvider.java
| @@ -2,9 +2,9 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | @@ -2,9 +2,9 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | ||
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.SipConfig; | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; | 4 | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| 5 | -import com.genersoft.iot.vmp.gb28181.bean.SubscribeInfo; | ||
| 6 | -import com.genersoft.iot.vmp.gb28181.utils.HeaderUtils; | 5 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 7 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 7 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 8 | import gov.nist.javax.sip.message.MessageFactoryImpl; | 8 | import gov.nist.javax.sip.message.MessageFactoryImpl; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.stereotype.Component; | 10 | import org.springframework.stereotype.Component; |
| @@ -36,45 +36,10 @@ public class SIPRequestHeaderPlarformProvider { | @@ -36,45 +36,10 @@ public class SIPRequestHeaderPlarformProvider { | ||
| 36 | private SipFactory sipFactory; | 36 | private SipFactory sipFactory; |
| 37 | 37 | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | - private IRedisCatchStorage redisCatchStorage; | ||
| 40 | - | ||
| 41 | - | ||
| 42 | - public Request createKeetpaliveMessageRequest(ParentPlatform parentPlatform, String content, String viaTag, String fromTag, String toTag, CallIdHeader callIdHeader) throws ParseException, InvalidArgumentException, PeerUnavailableException { | ||
| 43 | - Request request = null; | ||
| 44 | - // sipuri | ||
| 45 | - SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort()); | ||
| 46 | - // via | ||
| 47 | - ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(); | ||
| 48 | - ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(sipConfig.getIp(), sipConfig.getPort(), | ||
| 49 | - parentPlatform.getTransport(), viaTag); | ||
| 50 | - viaHeader.setRPort(); | ||
| 51 | - viaHeaders.add(viaHeader); | ||
| 52 | - // from | ||
| 53 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getDeviceGBId(), | ||
| 54 | - sipConfig.getIp() + ":" + sipConfig.getPort()); | ||
| 55 | - Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | ||
| 56 | - FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); | ||
| 57 | - // to | ||
| 58 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP() + ":" + parentPlatform.getServerPort() ); | ||
| 59 | - Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | ||
| 60 | - ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); | ||
| 61 | - | ||
| 62 | - | ||
| 63 | - // Forwards | ||
| 64 | - MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); | ||
| 65 | - // ceq | ||
| 66 | - CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.MESSAGE); | ||
| 67 | - | ||
| 68 | - request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, | ||
| 69 | - toHeader, viaHeaders, maxForwards); | ||
| 70 | - | ||
| 71 | - List<String> agentParam = new ArrayList<>(); | ||
| 72 | - | ||
| 73 | - ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); | ||
| 74 | - request.setContent(content, contentTypeHeader); | ||
| 75 | - return request; | ||
| 76 | - } | 39 | + private GitUtil gitUtil; |
| 77 | 40 | ||
| 41 | + @Autowired | ||
| 42 | + private IRedisCatchStorage redisCatchStorage; | ||
| 78 | 43 | ||
| 79 | public Request createRegisterRequest(@NotNull ParentPlatform platform, long CSeq, String fromTag, String viaTag, CallIdHeader callIdHeader, boolean isRegister) throws ParseException, InvalidArgumentException, PeerUnavailableException { | 44 | public Request createRegisterRequest(@NotNull ParentPlatform platform, long CSeq, String fromTag, String viaTag, CallIdHeader callIdHeader, boolean isRegister) throws ParseException, InvalidArgumentException, PeerUnavailableException { |
| 80 | Request request = null; | 45 | Request request = null; |
| @@ -88,16 +53,14 @@ public class SIPRequestHeaderPlarformProvider { | @@ -88,16 +53,14 @@ public class SIPRequestHeaderPlarformProvider { | ||
| 88 | viaHeader.setRPort(); | 53 | viaHeader.setRPort(); |
| 89 | viaHeaders.add(viaHeader); | 54 | viaHeaders.add(viaHeader); |
| 90 | //from | 55 | //from |
| 91 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(),sipAddress); | 56 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(), sipConfig.getDomain()); |
| 92 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 57 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 93 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); | 58 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 94 | //to | 59 | //to |
| 95 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(),sipAddress); | 60 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(), sipConfig.getDomain()); |
| 96 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 61 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 97 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); | 62 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 98 | 63 | ||
| 99 | - | ||
| 100 | - | ||
| 101 | //Forwards | 64 | //Forwards |
| 102 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); | 65 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 103 | 66 | ||
| @@ -113,8 +76,7 @@ public class SIPRequestHeaderPlarformProvider { | @@ -113,8 +76,7 @@ public class SIPRequestHeaderPlarformProvider { | ||
| 113 | ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(isRegister ? platform.getExpires() : 0); | 76 | ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(isRegister ? platform.getExpires() : 0); |
| 114 | request.addHeader(expires); | 77 | request.addHeader(expires); |
| 115 | 78 | ||
| 116 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | ||
| 117 | - request.addHeader(userAgentHeader); | 79 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); |
| 118 | 80 | ||
| 119 | return request; | 81 | return request; |
| 120 | } | 82 | } |
| @@ -193,23 +155,24 @@ public class SIPRequestHeaderPlarformProvider { | @@ -193,23 +155,24 @@ public class SIPRequestHeaderPlarformProvider { | ||
| 193 | } | 155 | } |
| 194 | 156 | ||
| 195 | 157 | ||
| 196 | - public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { | 158 | + public Request createMessageRequest(ParentPlatform parentPlatform, String content, String fromTag, String viaTag, CallIdHeader callIdHeader) throws PeerUnavailableException, ParseException, InvalidArgumentException { |
| 197 | Request request = null; | 159 | Request request = null; |
| 160 | + String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort(); | ||
| 198 | // sipuri | 161 | // sipuri |
| 199 | - SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort()); | 162 | + SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress); |
| 200 | // via | 163 | // via |
| 201 | ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(); | 164 | ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(); |
| 202 | ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), Integer.parseInt(parentPlatform.getDevicePort()), | 165 | ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), Integer.parseInt(parentPlatform.getDevicePort()), |
| 203 | - parentPlatform.getTransport(), null); | 166 | + parentPlatform.getTransport(), viaTag); |
| 204 | viaHeader.setRPort(); | 167 | viaHeader.setRPort(); |
| 205 | viaHeaders.add(viaHeader); | 168 | viaHeaders.add(viaHeader); |
| 206 | // from | 169 | // from |
| 207 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getDeviceGBId(), | ||
| 208 | - parentPlatform.getDeviceIp() + ":" + parentPlatform.getDevicePort()); | 170 | + // SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getDeviceGBId(), parentPlatform.getDeviceIp() + ":" + parentPlatform.getDeviceIp()); |
| 171 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getDeviceGBId(), sipConfig.getDomain()); | ||
| 209 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 172 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 210 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); | 173 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 211 | // to | 174 | // to |
| 212 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerGBDomain()); | 175 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress); |
| 213 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 176 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 214 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, null); | 177 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, null); |
| 215 | 178 | ||
| @@ -223,6 +186,8 @@ public class SIPRequestHeaderPlarformProvider { | @@ -223,6 +186,8 @@ public class SIPRequestHeaderPlarformProvider { | ||
| 223 | request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, | 186 | request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
| 224 | toHeader, viaHeaders, maxForwards); | 187 | toHeader, viaHeaders, maxForwards); |
| 225 | 188 | ||
| 189 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 190 | + | ||
| 226 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); | 191 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 227 | request.setContent(content, contentTypeHeader); | 192 | request.setContent(content, contentTypeHeader); |
| 228 | return request; | 193 | return request; |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java
| @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | @@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.gb28181.transmit.cmd; | ||
| 2 | 2 | ||
| 3 | import java.text.ParseException; | 3 | import java.text.ParseException; |
| 4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 5 | -import java.util.List; | ||
| 6 | 5 | ||
| 7 | import javax.sip.*; | 6 | import javax.sip.*; |
| 8 | import javax.sip.address.Address; | 7 | import javax.sip.address.Address; |
| @@ -12,8 +11,9 @@ import javax.sip.message.Request; | @@ -12,8 +11,9 @@ import javax.sip.message.Request; | ||
| 12 | 11 | ||
| 13 | import com.genersoft.iot.vmp.common.StreamInfo; | 12 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 14 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 13 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 15 | -import com.genersoft.iot.vmp.gb28181.utils.HeaderUtils; | 14 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 16 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 15 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 16 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 17 | import gov.nist.javax.sip.SipProviderImpl; | 17 | import gov.nist.javax.sip.SipProviderImpl; |
| 18 | import gov.nist.javax.sip.SipStackImpl; | 18 | import gov.nist.javax.sip.SipStackImpl; |
| 19 | import gov.nist.javax.sip.stack.SIPDialog; | 19 | import gov.nist.javax.sip.stack.SIPDialog; |
| @@ -39,6 +39,9 @@ public class SIPRequestHeaderProvider { | @@ -39,6 +39,9 @@ public class SIPRequestHeaderProvider { | ||
| 39 | private SipFactory sipFactory; | 39 | private SipFactory sipFactory; |
| 40 | 40 | ||
| 41 | @Autowired | 41 | @Autowired |
| 42 | + private GitUtil gitUtil; | ||
| 43 | + | ||
| 44 | + @Autowired | ||
| 42 | private IRedisCatchStorage redisCatchStorage; | 45 | private IRedisCatchStorage redisCatchStorage; |
| 43 | 46 | ||
| 44 | @Autowired | 47 | @Autowired |
| @@ -62,22 +65,24 @@ public class SIPRequestHeaderProvider { | @@ -62,22 +65,24 @@ public class SIPRequestHeaderProvider { | ||
| 62 | viaHeader.setRPort(); | 65 | viaHeader.setRPort(); |
| 63 | viaHeaders.add(viaHeader); | 66 | viaHeaders.add(viaHeader); |
| 64 | // from | 67 | // from |
| 65 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), | ||
| 66 | - sipConfig.getIp() + ":" + sipConfig.getPort()); | 68 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); |
| 67 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 69 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 68 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); | 70 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 69 | // to | 71 | // to |
| 70 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), sipConfig.getDomain()); | 72 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), device.getHostAddress()); |
| 71 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 73 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 72 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); | 74 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); |
| 73 | 75 | ||
| 74 | // Forwards | 76 | // Forwards |
| 75 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); | 77 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 76 | // ceq | 78 | // ceq |
| 77 | - CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.MESSAGE); | 79 | + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.MESSAGE); |
| 78 | 80 | ||
| 79 | request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, | 81 | request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
| 80 | toHeader, viaHeaders, maxForwards); | 82 | toHeader, viaHeaders, maxForwards); |
| 83 | + | ||
| 84 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 85 | + | ||
| 81 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); | 86 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 82 | request.setContent(content, contentTypeHeader); | 87 | request.setContent(content, contentTypeHeader); |
| 83 | return request; | 88 | return request; |
| @@ -94,11 +99,11 @@ public class SIPRequestHeaderProvider { | @@ -94,11 +99,11 @@ public class SIPRequestHeaderProvider { | ||
| 94 | viaHeaders.add(viaHeader); | 99 | viaHeaders.add(viaHeader); |
| 95 | 100 | ||
| 96 | //from | 101 | //from |
| 97 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(),sipConfig.getDomain()); | 102 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); |
| 98 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 103 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 99 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack | 104 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 100 | //to | 105 | //to |
| 101 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,sipConfig.getDomain()); | 106 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress()); |
| 102 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 107 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 103 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); | 108 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 104 | 109 | ||
| @@ -108,7 +113,9 @@ public class SIPRequestHeaderProvider { | @@ -108,7 +113,9 @@ public class SIPRequestHeaderProvider { | ||
| 108 | //ceq | 113 | //ceq |
| 109 | CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.INVITE); | 114 | CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.INVITE); |
| 110 | request = sipFactory.createMessageFactory().createRequest(requestLine, Request.INVITE, callIdHeader, cSeqHeader,fromHeader, toHeader, viaHeaders, maxForwards); | 115 | request = sipFactory.createMessageFactory().createRequest(requestLine, Request.INVITE, callIdHeader, cSeqHeader,fromHeader, toHeader, viaHeaders, maxForwards); |
| 111 | - | 116 | + |
| 117 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 118 | + | ||
| 112 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); | 119 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 113 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); | 120 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); |
| 114 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); | 121 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| @@ -130,11 +137,11 @@ public class SIPRequestHeaderProvider { | @@ -130,11 +137,11 @@ public class SIPRequestHeaderProvider { | ||
| 130 | viaHeader.setRPort(); | 137 | viaHeader.setRPort(); |
| 131 | viaHeaders.add(viaHeader); | 138 | viaHeaders.add(viaHeader); |
| 132 | //from | 139 | //from |
| 133 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(),sipConfig.getDomain()); | 140 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); |
| 134 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 141 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 135 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack | 142 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 136 | //to | 143 | //to |
| 137 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, sipConfig.getDomain()); | 144 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress()); |
| 138 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 145 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 139 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); | 146 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 140 | 147 | ||
| @@ -148,6 +155,9 @@ public class SIPRequestHeaderProvider { | @@ -148,6 +155,9 @@ public class SIPRequestHeaderProvider { | ||
| 148 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); | 155 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 149 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); | 156 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); |
| 150 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); | 157 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| 158 | + | ||
| 159 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 160 | + | ||
| 151 | // Subject | 161 | // Subject |
| 152 | SubjectHeader subjectHeader = sipFactory.createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", channelId, ssrc, sipConfig.getId(), 0)); | 162 | SubjectHeader subjectHeader = sipFactory.createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", channelId, ssrc, sipConfig.getId(), 0)); |
| 153 | request.addHeader(subjectHeader); | 163 | request.addHeader(subjectHeader); |
| @@ -170,7 +180,7 @@ public class SIPRequestHeaderProvider { | @@ -170,7 +180,7 @@ public class SIPRequestHeaderProvider { | ||
| 170 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 180 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 171 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack | 181 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 172 | //to | 182 | //to |
| 173 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,sipConfig.getDomain()); | 183 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,device.getHostAddress()); |
| 174 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 184 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 175 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,toTag); | 185 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,toTag); |
| 176 | 186 | ||
| @@ -178,10 +188,12 @@ public class SIPRequestHeaderProvider { | @@ -178,10 +188,12 @@ public class SIPRequestHeaderProvider { | ||
| 178 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); | 188 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 179 | 189 | ||
| 180 | //ceq | 190 | //ceq |
| 181 | - CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.BYE); | 191 | + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.BYE); |
| 182 | CallIdHeader callIdHeader = sipFactory.createHeaderFactory().createCallIdHeader(callId); | 192 | CallIdHeader callIdHeader = sipFactory.createHeaderFactory().createCallIdHeader(callId); |
| 183 | request = sipFactory.createMessageFactory().createRequest(requestLine, Request.BYE, callIdHeader, cSeqHeader,fromHeader, toHeader, viaHeaders, maxForwards); | 193 | request = sipFactory.createMessageFactory().createRequest(requestLine, Request.BYE, callIdHeader, cSeqHeader,fromHeader, toHeader, viaHeaders, maxForwards); |
| 184 | 194 | ||
| 195 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 196 | + | ||
| 185 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); | 197 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 186 | 198 | ||
| 187 | return request; | 199 | return request; |
| @@ -198,12 +210,11 @@ public class SIPRequestHeaderProvider { | @@ -198,12 +210,11 @@ public class SIPRequestHeaderProvider { | ||
| 198 | viaHeader.setRPort(); | 210 | viaHeader.setRPort(); |
| 199 | viaHeaders.add(viaHeader); | 211 | viaHeaders.add(viaHeader); |
| 200 | // from | 212 | // from |
| 201 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), | ||
| 202 | - sipConfig.getIp() + ":" + sipConfig.getPort()); | 213 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); |
| 203 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); | 214 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 204 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); | 215 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 205 | // to | 216 | // to |
| 206 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), sipConfig.getDomain()); | 217 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), device.getHostAddress()); |
| 207 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); | 218 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 208 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); | 219 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); |
| 209 | 220 | ||
| @@ -233,6 +244,9 @@ public class SIPRequestHeaderProvider { | @@ -233,6 +244,9 @@ public class SIPRequestHeaderProvider { | ||
| 233 | 244 | ||
| 234 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); | 245 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 235 | request.setContent(content, contentTypeHeader); | 246 | request.setContent(content, contentTypeHeader); |
| 247 | + | ||
| 248 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | ||
| 249 | + | ||
| 236 | return request; | 250 | return request; |
| 237 | } | 251 | } |
| 238 | 252 | ||
| @@ -267,8 +281,7 @@ public class SIPRequestHeaderProvider { | @@ -267,8 +281,7 @@ public class SIPRequestHeaderProvider { | ||
| 267 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory() | 281 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory() |
| 268 | .createSipURI(sipConfig.getId(), sipConfig.getIp() + ":" + sipConfig.getPort())); | 282 | .createSipURI(sipConfig.getId(), sipConfig.getIp() + ":" + sipConfig.getPort())); |
| 269 | infoRequest.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); | 283 | infoRequest.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| 270 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | ||
| 271 | - infoRequest.addHeader(userAgentHeader); | 284 | + infoRequest.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); |
| 272 | 285 | ||
| 273 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", | 286 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", |
| 274 | "MANSRTSP"); | 287 | "MANSRTSP"); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| @@ -10,7 +10,7 @@ import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | @@ -10,7 +10,7 @@ import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | ||
| 10 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 10 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; | 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 12 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider; | 12 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider; |
| 13 | -import com.genersoft.iot.vmp.gb28181.utils.HeaderUtils; | 13 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 14 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; | 14 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 15 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; | 15 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| 16 | import com.genersoft.iot.vmp.utils.DateUtil; | 16 | import com.genersoft.iot.vmp.utils.DateUtil; |
| @@ -21,6 +21,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService; | @@ -21,6 +21,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService; | ||
| 21 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; | 21 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 22 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 22 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 24 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 24 | import gov.nist.javax.sip.SipProviderImpl; | 25 | import gov.nist.javax.sip.SipProviderImpl; |
| 25 | import gov.nist.javax.sip.SipStackImpl; | 26 | import gov.nist.javax.sip.SipStackImpl; |
| 26 | import gov.nist.javax.sip.message.MessageFactoryImpl; | 27 | import gov.nist.javax.sip.message.MessageFactoryImpl; |
| @@ -63,6 +64,9 @@ public class SIPCommander implements ISIPCommander { | @@ -63,6 +64,9 @@ public class SIPCommander implements ISIPCommander { | ||
| 63 | private SipFactory sipFactory; | 64 | private SipFactory sipFactory; |
| 64 | 65 | ||
| 65 | @Autowired | 66 | @Autowired |
| 67 | + private GitUtil gitUtil; | ||
| 68 | + | ||
| 69 | + @Autowired | ||
| 66 | @Qualifier(value="tcpSipProvider") | 70 | @Qualifier(value="tcpSipProvider") |
| 67 | private SipProviderImpl tcpSipProvider; | 71 | private SipProviderImpl tcpSipProvider; |
| 68 | 72 | ||
| @@ -246,13 +250,11 @@ public class SIPCommander implements ISIPCommander { | @@ -246,13 +250,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 246 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); | 250 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 247 | ptzXml.append("</Info>\r\n"); | 251 | ptzXml.append("</Info>\r\n"); |
| 248 | ptzXml.append("</Control>\r\n"); | 252 | ptzXml.append("</Control>\r\n"); |
| 249 | - | ||
| 250 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 251 | 253 | ||
| 252 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 254 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 253 | : udpSipProvider.getNewCallId(); | 255 | : udpSipProvider.getNewCallId(); |
| 254 | 256 | ||
| 255 | - Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), "z9hG4bK-ViaPtz-" + tm, "FromPtz" + tm, null, callIdHeader); | 257 | + Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 256 | 258 | ||
| 257 | transmitRequest(device, request); | 259 | transmitRequest(device, request); |
| 258 | return true; | 260 | return true; |
| @@ -289,13 +291,12 @@ public class SIPCommander implements ISIPCommander { | @@ -289,13 +291,12 @@ public class SIPCommander implements ISIPCommander { | ||
| 289 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); | 291 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 290 | ptzXml.append("</Info>\r\n"); | 292 | ptzXml.append("</Info>\r\n"); |
| 291 | ptzXml.append("</Control>\r\n"); | 293 | ptzXml.append("</Control>\r\n"); |
| 292 | - | ||
| 293 | - String tm = Long.toString(System.currentTimeMillis()); | 294 | + |
| 294 | 295 | ||
| 295 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 296 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 296 | : udpSipProvider.getNewCallId(); | 297 | : udpSipProvider.getNewCallId(); |
| 297 | 298 | ||
| 298 | - Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), "z9hG4bK-ViaPtz-" + tm, "FromPtz" + tm, null, callIdHeader); | 299 | + Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 299 | transmitRequest(device, request); | 300 | transmitRequest(device, request); |
| 300 | return true; | 301 | return true; |
| 301 | } catch (SipException | ParseException | InvalidArgumentException e) { | 302 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -325,13 +326,12 @@ public class SIPCommander implements ISIPCommander { | @@ -325,13 +326,12 @@ public class SIPCommander implements ISIPCommander { | ||
| 325 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); | 326 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 326 | ptzXml.append("</Info>\r\n"); | 327 | ptzXml.append("</Info>\r\n"); |
| 327 | ptzXml.append("</Control>\r\n"); | 328 | ptzXml.append("</Control>\r\n"); |
| 328 | - | ||
| 329 | - String tm = Long.toString(System.currentTimeMillis()); | 329 | + |
| 330 | 330 | ||
| 331 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 331 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 332 | : udpSipProvider.getNewCallId(); | 332 | : udpSipProvider.getNewCallId(); |
| 333 | 333 | ||
| 334 | - Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), "z9hG4bK-ViaPtz-" + tm, "FromPtz" + tm, null, callIdHeader); | 334 | + Request request = headerProvider.createMessageRequest(device, ptzXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 335 | transmitRequest(device, request, errorEvent, okEvent); | 335 | transmitRequest(device, request, errorEvent, okEvent); |
| 336 | return true; | 336 | return true; |
| 337 | } catch (SipException | ParseException | InvalidArgumentException e) { | 337 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -423,12 +423,10 @@ public class SIPCommander implements ISIPCommander { | @@ -423,12 +423,10 @@ public class SIPCommander implements ISIPCommander { | ||
| 423 | // f字段:f= v/编码格式/分辨率/帧率/码率类型/码率大小a/编码格式/码率大小/采样率 | 423 | // f字段:f= v/编码格式/分辨率/帧率/码率类型/码率大小a/编码格式/码率大小/采样率 |
| 424 | // content.append("f=v/2/5/25/1/4000a/1/8/1" + "\r\n"); // 未发现支持此特性的设备 | 424 | // content.append("f=v/2/5/25/1/4000a/1/8/1" + "\r\n"); // 未发现支持此特性的设备 |
| 425 | 425 | ||
| 426 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 427 | - | ||
| 428 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 426 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 429 | : udpSipProvider.getNewCallId(); | 427 | : udpSipProvider.getNewCallId(); |
| 430 | 428 | ||
| 431 | - Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, "FromInvt" + tm, null, ssrcInfo.getSsrc(), callIdHeader); | 429 | + Request request = headerProvider.createInviteRequest(device, channelId, content.toString(), null, SipUtils.getNewFromTag(), null, ssrcInfo.getSsrc(), callIdHeader); |
| 432 | 430 | ||
| 433 | transmitRequest(device, request, (e -> { | 431 | transmitRequest(device, request, (e -> { |
| 434 | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); | 432 | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| @@ -521,8 +519,6 @@ public class SIPCommander implements ISIPCommander { | @@ -521,8 +519,6 @@ public class SIPCommander implements ISIPCommander { | ||
| 521 | } | 519 | } |
| 522 | 520 | ||
| 523 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc | 521 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc |
| 524 | - | ||
| 525 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 526 | 522 | ||
| 527 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 523 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 528 | : udpSipProvider.getNewCallId(); | 524 | : udpSipProvider.getNewCallId(); |
| @@ -535,7 +531,7 @@ public class SIPCommander implements ISIPCommander { | @@ -535,7 +531,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 535 | } | 531 | } |
| 536 | subscribe.removeSubscribe(hookSubscribe); | 532 | subscribe.removeSubscribe(hookSubscribe); |
| 537 | }); | 533 | }); |
| 538 | - Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "fromplybck" + tm, null, callIdHeader, ssrcInfo.getSsrc()); | 534 | + Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader, ssrcInfo.getSsrc()); |
| 539 | 535 | ||
| 540 | transmitRequest(device, request, errorEvent, event -> { | 536 | transmitRequest(device, request, errorEvent, event -> { |
| 541 | ResponseEvent responseEvent = (ResponseEvent) event.event; | 537 | ResponseEvent responseEvent = (ResponseEvent) event.event; |
| @@ -627,8 +623,6 @@ public class SIPCommander implements ISIPCommander { | @@ -627,8 +623,6 @@ public class SIPCommander implements ISIPCommander { | ||
| 627 | content.append("a=downloadspeed:" + downloadSpeed + "\r\n"); | 623 | content.append("a=downloadspeed:" + downloadSpeed + "\r\n"); |
| 628 | 624 | ||
| 629 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc | 625 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc |
| 630 | - | ||
| 631 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 632 | 626 | ||
| 633 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 627 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 634 | : udpSipProvider.getNewCallId(); | 628 | : udpSipProvider.getNewCallId(); |
| @@ -651,7 +645,7 @@ public class SIPCommander implements ISIPCommander { | @@ -651,7 +645,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 651 | }); | 645 | }); |
| 652 | }); | 646 | }); |
| 653 | 647 | ||
| 654 | - Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, "fromplybck" + tm, null, callIdHeader, ssrcInfo.getSsrc()); | 648 | + Request request = headerProvider.createPlaybackInviteRequest(device, channelId, content.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader, ssrcInfo.getSsrc()); |
| 655 | if (inviteStreamCallback != null) { | 649 | if (inviteStreamCallback != null) { |
| 656 | inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null, callIdHeader.getCallId(), "rtp", ssrcInfo.getStream())); | 650 | inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null, callIdHeader.getCallId(), "rtp", ssrcInfo.getStream())); |
| 657 | } | 651 | } |
| @@ -734,7 +728,7 @@ public class SIPCommander implements ISIPCommander { | @@ -734,7 +728,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 734 | dialog = streamSession.getDialogByStream(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | 728 | dialog = streamSession.getDialogByStream(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); |
| 735 | } | 729 | } |
| 736 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); | 730 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); |
| 737 | - mediaServerService.closeRTPServer(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | 731 | + mediaServerService.closeRTPServer(ssrcTransaction.getMediaServerId(), ssrcTransaction.getStream()); |
| 738 | streamSession.remove(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | 732 | streamSession.remove(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); |
| 739 | 733 | ||
| 740 | if (dialog == null) { | 734 | if (dialog == null) { |
| @@ -771,7 +765,7 @@ public class SIPCommander implements ISIPCommander { | @@ -771,7 +765,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 771 | // 增加Contact header | 765 | // 增加Contact header |
| 772 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); | 766 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 773 | byeRequest.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); | 767 | byeRequest.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| 774 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | 768 | + UserAgentHeader userAgentHeader = SipUtils.createUserAgentHeader(sipFactory, gitUtil); |
| 775 | byeRequest.addHeader(userAgentHeader); | 769 | byeRequest.addHeader(userAgentHeader); |
| 776 | ClientTransaction clientTransaction = null; | 770 | ClientTransaction clientTransaction = null; |
| 777 | if("TCP".equals(protocol)) { | 771 | if("TCP".equals(protocol)) { |
| @@ -812,20 +806,41 @@ public class SIPCommander implements ISIPCommander { | @@ -812,20 +806,41 @@ public class SIPCommander implements ISIPCommander { | ||
| 812 | broadcastXml.append("<SourceID>" + sipConfig.getId() + "</SourceID>\r\n"); | 806 | broadcastXml.append("<SourceID>" + sipConfig.getId() + "</SourceID>\r\n"); |
| 813 | broadcastXml.append("<TargetID>" + channelId + "</TargetID>\r\n"); | 807 | broadcastXml.append("<TargetID>" + channelId + "</TargetID>\r\n"); |
| 814 | broadcastXml.append("</Notify>\r\n"); | 808 | broadcastXml.append("</Notify>\r\n"); |
| 815 | - | ||
| 816 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 817 | - | 809 | + |
| 818 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 810 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 819 | : udpSipProvider.getNewCallId(); | 811 | : udpSipProvider.getNewCallId(); |
| 820 | 812 | ||
| 821 | - Request request = headerProvider.createMessageRequest(device, broadcastXml.toString(), "z9hG4bK-ViaBcst-" + tm, "FromBcst" + tm, null, callIdHeader); | ||
| 822 | - transmitRequest(device, request, errorEvent, okEvent); | 813 | + Request request = headerProvider.createMessageRequest(device, broadcastXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 814 | + transmitRequest(device, request); | ||
| 823 | return true; | 815 | return true; |
| 824 | } catch (SipException | ParseException | InvalidArgumentException e) { | 816 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 825 | e.printStackTrace(); | 817 | e.printStackTrace(); |
| 826 | } | 818 | } |
| 827 | return false; | 819 | return false; |
| 828 | } | 820 | } |
| 821 | + @Override | ||
| 822 | + public void audioBroadcastCmd(Device device, SipSubscribe.Event errorEvent) { | ||
| 823 | + try { | ||
| 824 | + StringBuffer broadcastXml = new StringBuffer(200); | ||
| 825 | + String charset = device.getCharset(); | ||
| 826 | + broadcastXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n"); | ||
| 827 | + broadcastXml.append("<Notify>\r\n"); | ||
| 828 | + broadcastXml.append("<CmdType>Broadcast</CmdType>\r\n"); | ||
| 829 | + broadcastXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); | ||
| 830 | + broadcastXml.append("<SourceID>" + sipConfig.getId() + "</SourceID>\r\n"); | ||
| 831 | + broadcastXml.append("<TargetID>" + device.getDeviceId() + "</TargetID>\r\n"); | ||
| 832 | + broadcastXml.append("</Notify>\r\n"); | ||
| 833 | + | ||
| 834 | + CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | ||
| 835 | + : udpSipProvider.getNewCallId(); | ||
| 836 | + | ||
| 837 | + Request request = headerProvider.createMessageRequest(device, broadcastXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); | ||
| 838 | + transmitRequest(device, request, errorEvent); | ||
| 839 | + } catch (SipException | ParseException | InvalidArgumentException e) { | ||
| 840 | + e.printStackTrace(); | ||
| 841 | + } | ||
| 842 | + } | ||
| 843 | + | ||
| 829 | 844 | ||
| 830 | /** | 845 | /** |
| 831 | * 音视频录像控制 | 846 | * 音视频录像控制 |
| @@ -850,13 +865,11 @@ public class SIPCommander implements ISIPCommander { | @@ -850,13 +865,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 850 | } | 865 | } |
| 851 | cmdXml.append("<RecordCmd>" + recordCmdStr + "</RecordCmd>\r\n"); | 866 | cmdXml.append("<RecordCmd>" + recordCmdStr + "</RecordCmd>\r\n"); |
| 852 | cmdXml.append("</Control>\r\n"); | 867 | cmdXml.append("</Control>\r\n"); |
| 853 | - | ||
| 854 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 855 | 868 | ||
| 856 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 869 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 857 | : udpSipProvider.getNewCallId(); | 870 | : udpSipProvider.getNewCallId(); |
| 858 | 871 | ||
| 859 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromRecord" + tm, null, callIdHeader); | 872 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 860 | transmitRequest(device, request, errorEvent); | 873 | transmitRequest(device, request, errorEvent); |
| 861 | return true; | 874 | return true; |
| 862 | } catch (SipException | ParseException | InvalidArgumentException e) { | 875 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -882,13 +895,11 @@ public class SIPCommander implements ISIPCommander { | @@ -882,13 +895,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 882 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 895 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 883 | cmdXml.append("<TeleBoot>Boot</TeleBoot>\r\n"); | 896 | cmdXml.append("<TeleBoot>Boot</TeleBoot>\r\n"); |
| 884 | cmdXml.append("</Control>\r\n"); | 897 | cmdXml.append("</Control>\r\n"); |
| 885 | - | ||
| 886 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 887 | 898 | ||
| 888 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 899 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 889 | : udpSipProvider.getNewCallId(); | 900 | : udpSipProvider.getNewCallId(); |
| 890 | 901 | ||
| 891 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromBoot" + tm, null, callIdHeader); | 902 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 892 | transmitRequest(device, request); | 903 | transmitRequest(device, request); |
| 893 | return true; | 904 | return true; |
| 894 | } catch (SipException | ParseException | InvalidArgumentException e) { | 905 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -915,13 +926,11 @@ public class SIPCommander implements ISIPCommander { | @@ -915,13 +926,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 915 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 926 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 916 | cmdXml.append("<GuardCmd>" + guardCmdStr + "</GuardCmd>\r\n"); | 927 | cmdXml.append("<GuardCmd>" + guardCmdStr + "</GuardCmd>\r\n"); |
| 917 | cmdXml.append("</Control>\r\n"); | 928 | cmdXml.append("</Control>\r\n"); |
| 918 | - | ||
| 919 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 920 | 929 | ||
| 921 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 930 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 922 | : udpSipProvider.getNewCallId(); | 931 | : udpSipProvider.getNewCallId(); |
| 923 | 932 | ||
| 924 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromGuard" + tm, null, callIdHeader); | 933 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 925 | transmitRequest(device, request, errorEvent); | 934 | transmitRequest(device, request, errorEvent); |
| 926 | return true; | 935 | return true; |
| 927 | } catch (SipException | ParseException | InvalidArgumentException e) { | 936 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -959,13 +968,11 @@ public class SIPCommander implements ISIPCommander { | @@ -959,13 +968,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 959 | cmdXml.append("</Info>\r\n"); | 968 | cmdXml.append("</Info>\r\n"); |
| 960 | } | 969 | } |
| 961 | cmdXml.append("</Control>\r\n"); | 970 | cmdXml.append("</Control>\r\n"); |
| 962 | - | ||
| 963 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 964 | 971 | ||
| 965 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 972 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 966 | : udpSipProvider.getNewCallId(); | 973 | : udpSipProvider.getNewCallId(); |
| 967 | 974 | ||
| 968 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromAlarm" + tm, null, callIdHeader); | 975 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 969 | transmitRequest(device, request, errorEvent); | 976 | transmitRequest(device, request, errorEvent); |
| 970 | return true; | 977 | return true; |
| 971 | } catch (SipException | ParseException | InvalidArgumentException e) { | 978 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -996,13 +1003,11 @@ public class SIPCommander implements ISIPCommander { | @@ -996,13 +1003,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 996 | } | 1003 | } |
| 997 | cmdXml.append("<IFameCmd>Send</IFameCmd>\r\n"); | 1004 | cmdXml.append("<IFameCmd>Send</IFameCmd>\r\n"); |
| 998 | cmdXml.append("</Control>\r\n"); | 1005 | cmdXml.append("</Control>\r\n"); |
| 999 | - | ||
| 1000 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1001 | 1006 | ||
| 1002 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1007 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1003 | : udpSipProvider.getNewCallId(); | 1008 | : udpSipProvider.getNewCallId(); |
| 1004 | 1009 | ||
| 1005 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromBoot" + tm, null, callIdHeader); | 1010 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1006 | transmitRequest(device, request); | 1011 | transmitRequest(device, request); |
| 1007 | return true; | 1012 | return true; |
| 1008 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1013 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1051,13 +1056,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1051,13 +1056,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1051 | } | 1056 | } |
| 1052 | cmdXml.append("</HomePosition>\r\n"); | 1057 | cmdXml.append("</HomePosition>\r\n"); |
| 1053 | cmdXml.append("</Control>\r\n"); | 1058 | cmdXml.append("</Control>\r\n"); |
| 1054 | - | ||
| 1055 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1056 | 1059 | ||
| 1057 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1060 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1058 | : udpSipProvider.getNewCallId(); | 1061 | : udpSipProvider.getNewCallId(); |
| 1059 | 1062 | ||
| 1060 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromGuard" + tm, null, callIdHeader); | 1063 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1061 | transmitRequest(device, request, errorEvent); | 1064 | transmitRequest(device, request, errorEvent); |
| 1062 | return true; | 1065 | return true; |
| 1063 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1066 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1123,13 +1126,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1123,13 +1126,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1123 | } | 1126 | } |
| 1124 | cmdXml.append("</BasicParam>\r\n"); | 1127 | cmdXml.append("</BasicParam>\r\n"); |
| 1125 | cmdXml.append("</Control>\r\n"); | 1128 | cmdXml.append("</Control>\r\n"); |
| 1126 | - | ||
| 1127 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1128 | 1129 | ||
| 1129 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1130 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1130 | : udpSipProvider.getNewCallId(); | 1131 | : udpSipProvider.getNewCallId(); |
| 1131 | 1132 | ||
| 1132 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromConfig" + tm, null, callIdHeader); | 1133 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1133 | transmitRequest(device, request, errorEvent); | 1134 | transmitRequest(device, request, errorEvent); |
| 1134 | return true; | 1135 | return true; |
| 1135 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1136 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1154,13 +1155,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1154,13 +1155,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1154 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); | 1155 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); |
| 1155 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 1156 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1156 | catalogXml.append("</Query>\r\n"); | 1157 | catalogXml.append("</Query>\r\n"); |
| 1157 | - | ||
| 1158 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1159 | 1158 | ||
| 1160 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1159 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1161 | : udpSipProvider.getNewCallId(); | 1160 | : udpSipProvider.getNewCallId(); |
| 1162 | 1161 | ||
| 1163 | - Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), null, "FromStatus" + tm, null, callIdHeader); | 1162 | + Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1164 | 1163 | ||
| 1165 | transmitRequest(device, request, errorEvent); | 1164 | transmitRequest(device, request, errorEvent); |
| 1166 | return true; | 1165 | return true; |
| @@ -1187,13 +1186,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1187,13 +1186,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1187 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); | 1186 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); |
| 1188 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 1187 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1189 | catalogXml.append("</Query>\r\n"); | 1188 | catalogXml.append("</Query>\r\n"); |
| 1190 | - | ||
| 1191 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1192 | 1189 | ||
| 1193 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1190 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1194 | : udpSipProvider.getNewCallId(); | 1191 | : udpSipProvider.getNewCallId(); |
| 1195 | 1192 | ||
| 1196 | - Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), "z9hG4bK-ViaDeviceInfo-" + tm, "FromDev" + tm, null, callIdHeader); | 1193 | + Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1197 | 1194 | ||
| 1198 | transmitRequest(device, request); | 1195 | transmitRequest(device, request); |
| 1199 | 1196 | ||
| @@ -1216,17 +1213,15 @@ public class SIPCommander implements ISIPCommander { | @@ -1216,17 +1213,15 @@ public class SIPCommander implements ISIPCommander { | ||
| 1216 | String charset = device.getCharset(); | 1213 | String charset = device.getCharset(); |
| 1217 | catalogXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n"); | 1214 | catalogXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n"); |
| 1218 | catalogXml.append("<Query>\r\n"); | 1215 | catalogXml.append("<Query>\r\n"); |
| 1219 | - catalogXml.append("<CmdType>Catalog</CmdType>\r\n"); | ||
| 1220 | - catalogXml.append("<SN>" + sn + "</SN>\r\n"); | ||
| 1221 | - catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 1216 | + catalogXml.append(" <CmdType>Catalog</CmdType>\r\n"); |
| 1217 | + catalogXml.append(" <SN>" + sn + "</SN>\r\n"); | ||
| 1218 | + catalogXml.append(" <DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | ||
| 1222 | catalogXml.append("</Query>\r\n"); | 1219 | catalogXml.append("</Query>\r\n"); |
| 1223 | - | ||
| 1224 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1225 | 1220 | ||
| 1226 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1221 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1227 | : udpSipProvider.getNewCallId(); | 1222 | : udpSipProvider.getNewCallId(); |
| 1228 | 1223 | ||
| 1229 | - Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), "z9hG4bK-ViaCatalog-" + tm, "FromCat" + tm, null, callIdHeader); | 1224 | + Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1230 | 1225 | ||
| 1231 | transmitRequest(device, request, errorEvent); | 1226 | transmitRequest(device, request, errorEvent); |
| 1232 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1227 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1273,14 +1268,12 @@ public class SIPCommander implements ISIPCommander { | @@ -1273,14 +1268,12 @@ public class SIPCommander implements ISIPCommander { | ||
| 1273 | recordInfoXml.append("<Type>" + type+"</Type>\r\n"); | 1268 | recordInfoXml.append("<Type>" + type+"</Type>\r\n"); |
| 1274 | } | 1269 | } |
| 1275 | recordInfoXml.append("</Query>\r\n"); | 1270 | recordInfoXml.append("</Query>\r\n"); |
| 1276 | - | ||
| 1277 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1278 | 1271 | ||
| 1279 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1272 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1280 | : udpSipProvider.getNewCallId(); | 1273 | : udpSipProvider.getNewCallId(); |
| 1281 | 1274 | ||
| 1282 | Request request = headerProvider.createMessageRequest(device, recordInfoXml.toString(), | 1275 | Request request = headerProvider.createMessageRequest(device, recordInfoXml.toString(), |
| 1283 | - "z9hG4bK-ViaRecordInfo-" + tm, "fromRec" + tm, null, callIdHeader); | 1276 | + SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1284 | 1277 | ||
| 1285 | transmitRequest(device, request, errorEvent, okEvent); | 1278 | transmitRequest(device, request, errorEvent, okEvent); |
| 1286 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1279 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1332,13 +1325,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1332,13 +1325,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1332 | cmdXml.append("<EndAlarmTime>" + endTime + "</EndAlarmTime>\r\n"); | 1325 | cmdXml.append("<EndAlarmTime>" + endTime + "</EndAlarmTime>\r\n"); |
| 1333 | } | 1326 | } |
| 1334 | cmdXml.append("</Query>\r\n"); | 1327 | cmdXml.append("</Query>\r\n"); |
| 1335 | - | ||
| 1336 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1337 | 1328 | ||
| 1338 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1329 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1339 | : udpSipProvider.getNewCallId(); | 1330 | : udpSipProvider.getNewCallId(); |
| 1340 | 1331 | ||
| 1341 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromAlarm" + tm, null, callIdHeader); | 1332 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1342 | transmitRequest(device, request, errorEvent); | 1333 | transmitRequest(device, request, errorEvent); |
| 1343 | return true; | 1334 | return true; |
| 1344 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1335 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1370,13 +1361,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1370,13 +1361,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1370 | } | 1361 | } |
| 1371 | cmdXml.append("<ConfigType>" + configType + "</ConfigType>\r\n"); | 1362 | cmdXml.append("<ConfigType>" + configType + "</ConfigType>\r\n"); |
| 1372 | cmdXml.append("</Query>\r\n"); | 1363 | cmdXml.append("</Query>\r\n"); |
| 1373 | - | ||
| 1374 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1375 | 1364 | ||
| 1376 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1365 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1377 | : udpSipProvider.getNewCallId(); | 1366 | : udpSipProvider.getNewCallId(); |
| 1378 | 1367 | ||
| 1379 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromConfig" + tm, null, callIdHeader); | 1368 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1380 | transmitRequest(device, request, errorEvent); | 1369 | transmitRequest(device, request, errorEvent); |
| 1381 | return true; | 1370 | return true; |
| 1382 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1371 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1405,13 +1394,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1405,13 +1394,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1405 | cmdXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n"); | 1394 | cmdXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n"); |
| 1406 | } | 1395 | } |
| 1407 | cmdXml.append("</Query>\r\n"); | 1396 | cmdXml.append("</Query>\r\n"); |
| 1408 | - | ||
| 1409 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1410 | 1397 | ||
| 1411 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1398 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1412 | : udpSipProvider.getNewCallId(); | 1399 | : udpSipProvider.getNewCallId(); |
| 1413 | 1400 | ||
| 1414 | - Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, "FromConfig" + tm, null, callIdHeader); | 1401 | + Request request = headerProvider.createMessageRequest(device, cmdXml.toString(), null, SipUtils.getNewFromTag(), null, callIdHeader); |
| 1415 | transmitRequest(device, request, errorEvent); | 1402 | transmitRequest(device, request, errorEvent); |
| 1416 | return true; | 1403 | return true; |
| 1417 | } catch (SipException | ParseException | InvalidArgumentException e) { | 1404 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -1437,13 +1424,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1437,13 +1424,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1437 | mobilePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); | 1424 | mobilePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1438 | mobilePostitionXml.append("<Interval>60</Interval>\r\n"); | 1425 | mobilePostitionXml.append("<Interval>60</Interval>\r\n"); |
| 1439 | mobilePostitionXml.append("</Query>\r\n"); | 1426 | mobilePostitionXml.append("</Query>\r\n"); |
| 1440 | - | ||
| 1441 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1442 | 1427 | ||
| 1443 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1428 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1444 | : udpSipProvider.getNewCallId(); | 1429 | : udpSipProvider.getNewCallId(); |
| 1445 | 1430 | ||
| 1446 | - Request request = headerProvider.createMessageRequest(device, mobilePostitionXml.toString(), "z9hG4bK-viaPos-" + tm, "fromTagPos" + tm, null, callIdHeader); | 1431 | + Request request = headerProvider.createMessageRequest(device, mobilePostitionXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1447 | 1432 | ||
| 1448 | transmitRequest(device, request, errorEvent); | 1433 | transmitRequest(device, request, errorEvent); |
| 1449 | 1434 | ||
| @@ -1492,10 +1477,9 @@ public class SIPCommander implements ISIPCommander { | @@ -1492,10 +1477,9 @@ public class SIPCommander implements ISIPCommander { | ||
| 1492 | request.removeHeader(CSeqHeader.NAME); | 1477 | request.removeHeader(CSeqHeader.NAME); |
| 1493 | request.addHeader(cSeqHeader); | 1478 | request.addHeader(cSeqHeader); |
| 1494 | }else { | 1479 | }else { |
| 1495 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1496 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1480 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1497 | : udpSipProvider.getNewCallId(); | 1481 | : udpSipProvider.getNewCallId(); |
| 1498 | - request = headerProvider.createSubscribeRequest(device, subscribePostitionXml.toString(), "z9hG4bK-viaPos-" + tm, "fromTagPos" + tm, null, device.getSubscribeCycleForMobilePosition(), "presence" ,callIdHeader); //Position;id=" + tm.substring(tm.length() - 4)); | 1482 | + request = headerProvider.createSubscribeRequest(device, subscribePostitionXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, device.getSubscribeCycleForMobilePosition(), "presence" ,callIdHeader); //Position;id=" + tm.substring(tm.length() - 4)); |
| 1499 | } | 1483 | } |
| 1500 | transmitRequest(device, request, errorEvent, okEvent); | 1484 | transmitRequest(device, request, errorEvent, okEvent); |
| 1501 | 1485 | ||
| @@ -1550,12 +1534,10 @@ public class SIPCommander implements ISIPCommander { | @@ -1550,12 +1534,10 @@ public class SIPCommander implements ISIPCommander { | ||
| 1550 | } | 1534 | } |
| 1551 | cmdXml.append("</Query>\r\n"); | 1535 | cmdXml.append("</Query>\r\n"); |
| 1552 | 1536 | ||
| 1553 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1554 | - | ||
| 1555 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1537 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1556 | : udpSipProvider.getNewCallId(); | 1538 | : udpSipProvider.getNewCallId(); |
| 1557 | 1539 | ||
| 1558 | - Request request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), "z9hG4bK-viaPos-" + tm, "fromTagPos" + tm, null, expires, "presence" , callIdHeader); | 1540 | + Request request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, expires, "presence" , callIdHeader); |
| 1559 | transmitRequest(device, request); | 1541 | transmitRequest(device, request); |
| 1560 | 1542 | ||
| 1561 | return true; | 1543 | return true; |
| @@ -1597,14 +1579,12 @@ public class SIPCommander implements ISIPCommander { | @@ -1597,14 +1579,12 @@ public class SIPCommander implements ISIPCommander { | ||
| 1597 | request.addHeader(cSeqHeader); | 1579 | request.addHeader(cSeqHeader); |
| 1598 | 1580 | ||
| 1599 | }else { | 1581 | }else { |
| 1600 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1601 | - | ||
| 1602 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1582 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1603 | : udpSipProvider.getNewCallId(); | 1583 | : udpSipProvider.getNewCallId(); |
| 1604 | 1584 | ||
| 1605 | // 有效时间默认为60秒以上 | 1585 | // 有效时间默认为60秒以上 |
| 1606 | - request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), "z9hG4bK-viaPos-" + tm, | ||
| 1607 | - "fromTagPos" + tm, null, device.getSubscribeCycleForCatalog(), "Catalog" , | 1586 | + request = headerProvider.createSubscribeRequest(device, cmdXml.toString(), SipUtils.getNewViaTag(), |
| 1587 | + SipUtils.getNewFromTag(), null, device.getSubscribeCycleForCatalog(), "Catalog" , | ||
| 1608 | callIdHeader); | 1588 | callIdHeader); |
| 1609 | 1589 | ||
| 1610 | } | 1590 | } |
| @@ -1633,10 +1613,9 @@ public class SIPCommander implements ISIPCommander { | @@ -1633,10 +1613,9 @@ public class SIPCommander implements ISIPCommander { | ||
| 1633 | } | 1613 | } |
| 1634 | dragXml.append(cmdString); | 1614 | dragXml.append(cmdString); |
| 1635 | dragXml.append("</Control>\r\n"); | 1615 | dragXml.append("</Control>\r\n"); |
| 1636 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1637 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1616 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1638 | : udpSipProvider.getNewCallId(); | 1617 | : udpSipProvider.getNewCallId(); |
| 1639 | - Request request = headerProvider.createMessageRequest(device, dragXml.toString(), "z9hG4bK-ViaPtz-" + tm, "FromPtz" + tm, null, callIdHeader); | 1618 | + Request request = headerProvider.createMessageRequest(device, dragXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1640 | logger.debug("拉框信令: " + request.toString()); | 1619 | logger.debug("拉框信令: " + request.toString()); |
| 1641 | transmitRequest(device, request); | 1620 | transmitRequest(device, request); |
| 1642 | return true; | 1621 | return true; |
| @@ -1663,13 +1642,11 @@ public class SIPCommander implements ISIPCommander { | @@ -1663,13 +1642,11 @@ public class SIPCommander implements ISIPCommander { | ||
| 1663 | clientTransaction = udpSipProvider.getNewClientTransaction(request); | 1642 | clientTransaction = udpSipProvider.getNewClientTransaction(request); |
| 1664 | } | 1643 | } |
| 1665 | if (request.getHeader(UserAgentHeader.NAME) == null) { | 1644 | if (request.getHeader(UserAgentHeader.NAME) == null) { |
| 1666 | - UserAgentHeader userAgentHeader = null; | ||
| 1667 | try { | 1645 | try { |
| 1668 | - userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | 1646 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); |
| 1669 | } catch (ParseException e) { | 1647 | } catch (ParseException e) { |
| 1670 | logger.error("添加UserAgentHeader失败", e); | 1648 | logger.error("添加UserAgentHeader失败", e); |
| 1671 | } | 1649 | } |
| 1672 | - request.addHeader(userAgentHeader); | ||
| 1673 | } | 1650 | } |
| 1674 | CallIdHeader callIdHeader = (CallIdHeader)request.getHeader(CallIdHeader.NAME); | 1651 | CallIdHeader callIdHeader = (CallIdHeader)request.getHeader(CallIdHeader.NAME); |
| 1675 | // 添加错误订阅 | 1652 | // 添加错误订阅 |
| @@ -1880,8 +1857,7 @@ public class SIPCommander implements ISIPCommander { | @@ -1880,8 +1857,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 1880 | 1857 | ||
| 1881 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 1858 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1882 | : udpSipProvider.getNewCallId(); | 1859 | : udpSipProvider.getNewCallId(); |
| 1883 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 1884 | - Request request = headerProvider.createMessageRequest(device, deviceStatusXml.toString(), "z9hG4bK-ViaPtz-" + tm, "FromPtz" + tm, null, callIdHeader); | 1860 | + Request request = headerProvider.createMessageRequest(device, deviceStatusXml.toString(), SipUtils.getNewViaTag(), SipUtils.getNewFromTag(), null, callIdHeader); |
| 1885 | transmitRequest(device, request); | 1861 | transmitRequest(device, request); |
| 1886 | 1862 | ||
| 1887 | 1863 | ||
| @@ -1896,7 +1872,7 @@ public class SIPCommander implements ISIPCommander { | @@ -1896,7 +1872,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 1896 | 1872 | ||
| 1897 | private void sendNotify(Device device, String catalogXmlContent, | 1873 | private void sendNotify(Device device, String catalogXmlContent, |
| 1898 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) | 1874 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) |
| 1899 | - throws NoSuchFieldException, IllegalAccessException, SipException, ParseException { | 1875 | + throws SipException, ParseException { |
| 1900 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); | 1876 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); |
| 1901 | String characterSet = device.getCharset(); | 1877 | String characterSet = device.getCharset(); |
| 1902 | // 设置编码, 防止中文乱码 | 1878 | // 设置编码, 防止中文乱码 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.gb28181.bean.*; | @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.gb28181.bean.*; | ||
| 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; | 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; | 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; |
| 7 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | ||
| 7 | import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; | 8 | import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; |
| 8 | import com.genersoft.iot.vmp.utils.DateUtil; | 9 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 9 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| @@ -26,7 +27,6 @@ import org.springframework.context.annotation.Lazy; | @@ -26,7 +27,6 @@ import org.springframework.context.annotation.Lazy; | ||
| 26 | import org.springframework.lang.Nullable; | 27 | import org.springframework.lang.Nullable; |
| 27 | import org.springframework.stereotype.Component; | 28 | import org.springframework.stereotype.Component; |
| 28 | import org.springframework.util.ObjectUtils; | 29 | import org.springframework.util.ObjectUtils; |
| 29 | -import org.springframework.util.StringUtils; | ||
| 30 | 30 | ||
| 31 | 31 | ||
| 32 | import com.genersoft.iot.vmp.utils.DateUtil; | 32 | import com.genersoft.iot.vmp.utils.DateUtil; |
| @@ -39,7 +39,6 @@ import java.text.ParseException; | @@ -39,7 +39,6 @@ import java.text.ParseException; | ||
| 39 | import java.util.ArrayList; | 39 | import java.util.ArrayList; |
| 40 | import java.util.HashSet; | 40 | import java.util.HashSet; |
| 41 | import java.util.List; | 41 | import java.util.List; |
| 42 | -import java.util.UUID; | ||
| 43 | 42 | ||
| 44 | @Component | 43 | @Component |
| 45 | @DependsOn("sipLayer") | 44 | @DependsOn("sipLayer") |
| @@ -90,7 +89,6 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -90,7 +89,6 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 90 | SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean registerAgain, boolean isRegister) { | 89 | SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean registerAgain, boolean isRegister) { |
| 91 | try { | 90 | try { |
| 92 | Request request; | 91 | Request request; |
| 93 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 94 | if (!registerAgain ) { | 92 | if (!registerAgain ) { |
| 95 | CallIdHeader callIdHeader = null; | 93 | CallIdHeader callIdHeader = null; |
| 96 | if(parentPlatform.getTransport().equalsIgnoreCase("TCP")) { | 94 | if(parentPlatform.getTransport().equalsIgnoreCase("TCP")) { |
| @@ -101,8 +99,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -101,8 +99,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 101 | } | 99 | } |
| 102 | 100 | ||
| 103 | request = headerProviderPlarformProvider.createRegisterRequest(parentPlatform, | 101 | request = headerProviderPlarformProvider.createRegisterRequest(parentPlatform, |
| 104 | - redisCatchStorage.getCSEQ(), "FromRegister" + tm, | ||
| 105 | - "z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""), callIdHeader, isRegister); | 102 | + redisCatchStorage.getCSEQ(), SipUtils.getNewFromTag(), |
| 103 | + SipUtils.getNewViaTag(), callIdHeader, isRegister); | ||
| 106 | // 将 callid 写入缓存, 等注册成功可以更新状态 | 104 | // 将 callid 写入缓存, 等注册成功可以更新状态 |
| 107 | String callIdFromHeader = callIdHeader.getCallId(); | 105 | String callIdFromHeader = callIdHeader.getCallId(); |
| 108 | redisCatchStorage.updatePlatformRegisterInfo(callIdFromHeader, PlatformRegisterInfo.getInstance(parentPlatform.getServerGBId(), isRegister)); | 106 | redisCatchStorage.updatePlatformRegisterInfo(callIdFromHeader, PlatformRegisterInfo.getInstance(parentPlatform.getServerGBId(), isRegister)); |
| @@ -122,7 +120,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -122,7 +120,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 122 | }else { | 120 | }else { |
| 123 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 121 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 124 | : udpSipProvider.getNewCallId(); | 122 | : udpSipProvider.getNewCallId(); |
| 125 | - request = headerProviderPlarformProvider.createRegisterRequest(parentPlatform, "FromRegister" + tm, null, callId, www, callIdHeader, isRegister); | 123 | + request = headerProviderPlarformProvider.createRegisterRequest(parentPlatform, SipUtils.getNewFromTag(), null, callId, www, callIdHeader, isRegister); |
| 126 | } | 124 | } |
| 127 | 125 | ||
| 128 | transmitRequest(parentPlatform, request, null, okEvent); | 126 | transmitRequest(parentPlatform, request, null, okEvent); |
| @@ -156,12 +154,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -156,12 +154,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 156 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 154 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 157 | : udpSipProvider.getNewCallId(); | 155 | : udpSipProvider.getNewCallId(); |
| 158 | 156 | ||
| 159 | - Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest( | 157 | + Request request = headerProviderPlarformProvider.createMessageRequest( |
| 160 | parentPlatform, | 158 | parentPlatform, |
| 161 | keepaliveXml.toString(), | 159 | keepaliveXml.toString(), |
| 162 | - "z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""), | ||
| 163 | - UUID.randomUUID().toString().replace("-", ""), | ||
| 164 | - null, | 160 | + SipUtils.getNewFromTag(), |
| 161 | + SipUtils.getNewViaTag(), | ||
| 165 | callIdHeader); | 162 | callIdHeader); |
| 166 | transmitRequest(parentPlatform, request, errorEvent, okEvent); | 163 | transmitRequest(parentPlatform, request, errorEvent, okEvent); |
| 167 | callId = callIdHeader.getCallId(); | 164 | callId = callIdHeader.getCallId(); |
| @@ -223,7 +220,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -223,7 +220,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 223 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 220 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 224 | : udpSipProvider.getNewCallId(); | 221 | : udpSipProvider.getNewCallId(); |
| 225 | 222 | ||
| 226 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml.toString(), fromTag, callIdHeader); | 223 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 227 | transmitRequest(parentPlatform, request); | 224 | transmitRequest(parentPlatform, request); |
| 228 | 225 | ||
| 229 | } catch (SipException | ParseException | InvalidArgumentException e) { | 226 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -263,26 +260,34 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -263,26 +260,34 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 263 | if (channel.getParentId() != null) { | 260 | if (channel.getParentId() != null) { |
| 264 | // 业务分组加上这一项即可,提高兼容性, | 261 | // 业务分组加上这一项即可,提高兼容性, |
| 265 | catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); | 262 | catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); |
| 263 | +// catalogXml.append("<ParentID>" + parentPlatform.getDeviceGBId() + "/" + channel.getParentId() + "</ParentID>\r\n"); | ||
| 266 | } | 264 | } |
| 267 | if (channel.getChannelId().length() == 20 && Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { | 265 | if (channel.getChannelId().length() == 20 && Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { |
| 268 | // 虚拟组织增加BusinessGroupID字段 | 266 | // 虚拟组织增加BusinessGroupID字段 |
| 269 | catalogXml.append("<BusinessGroupID>" + channel.getParentId() + "</BusinessGroupID>\r\n"); | 267 | catalogXml.append("<BusinessGroupID>" + channel.getParentId() + "</BusinessGroupID>\r\n"); |
| 270 | } | 268 | } |
| 271 | - catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n"); | 269 | + if (!channel.getChannelId().equals(parentPlatform.getDeviceGBId())) { |
| 270 | + catalogXml.append("<Parental>" + channel.getParental() + "</Parental>\r\n"); | ||
| 271 | + if (channel.getParental() == 0) { | ||
| 272 | + catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n"); | ||
| 273 | + } | ||
| 274 | + } | ||
| 272 | if (channel.getParental() == 0) { | 275 | if (channel.getParental() == 0) { |
| 273 | // 通道项 | 276 | // 通道项 |
| 274 | catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n"); | 277 | catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n"); |
| 275 | catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); | 278 | catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); |
| 276 | catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); | 279 | catalogXml.append("<RegisterWay>" + channel.getRegisterWay() + "</RegisterWay>\r\n"); |
| 277 | - catalogXml.append("<Status>" + (channel.getStatus() == 0 ? "OFF" : "ON") + "</Status>\r\n"); | ||
| 278 | - | 280 | + String civilCode = channel.getCivilCode() == null?parentPlatform.getAdministrativeDivision() : channel.getCivilCode(); |
| 279 | if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 | 281 | if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 |
| 280 | catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); | 282 | catalogXml.append("<Model>" + channel.getModel() + "</Model>\r\n"); |
| 281 | - catalogXml.append("<Owner> " + channel.getOwner()+ "</Owner>\r\n"); | ||
| 282 | - catalogXml.append("<CivilCode>" + channel.getCivilCode() + "</CivilCode>\r\n"); | ||
| 283 | - catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); | 283 | + catalogXml.append("<Owner>" + parentPlatform.getDeviceGBId()+ "</Owner>\r\n"); |
| 284 | + catalogXml.append("<CivilCode>" + civilCode + "</CivilCode>\r\n"); | ||
| 285 | + if (channel.getAddress() == null) { | ||
| 286 | + catalogXml.append("<Address></Address>\r\n"); | ||
| 287 | + }else { | ||
| 288 | + catalogXml.append("<Address>" + channel.getAddress() + "</Address>\r\n"); | ||
| 289 | + } | ||
| 284 | } | 290 | } |
| 285 | - | ||
| 286 | } | 291 | } |
| 287 | catalogXml.append("</Item>\r\n"); | 292 | catalogXml.append("</Item>\r\n"); |
| 288 | } | 293 | } |
| @@ -309,7 +314,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -309,7 +314,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 309 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 314 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 310 | : udpSipProvider.getNewCallId(); | 315 | : udpSipProvider.getNewCallId(); |
| 311 | 316 | ||
| 312 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml, fromTag, callIdHeader); | 317 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, catalogXml, fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 313 | transmitRequest(parentPlatform, request, null, eventResult -> { | 318 | transmitRequest(parentPlatform, request, null, eventResult -> { |
| 314 | int indexNext = index + parentPlatform.getCatalogGroup(); | 319 | int indexNext = index + parentPlatform.getCatalogGroup(); |
| 315 | sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext); | 320 | sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext); |
| @@ -349,7 +354,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -349,7 +354,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 349 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 354 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 350 | : udpSipProvider.getNewCallId(); | 355 | : udpSipProvider.getNewCallId(); |
| 351 | 356 | ||
| 352 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceInfoXml.toString(), fromTag, callIdHeader); | 357 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceInfoXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 353 | transmitRequest(parentPlatform, request); | 358 | transmitRequest(parentPlatform, request); |
| 354 | 359 | ||
| 355 | } catch (SipException | ParseException | InvalidArgumentException e) { | 360 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -387,7 +392,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -387,7 +392,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 387 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 392 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 388 | : udpSipProvider.getNewCallId(); | 393 | : udpSipProvider.getNewCallId(); |
| 389 | 394 | ||
| 390 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceStatusXml.toString(), fromTag, callIdHeader); | 395 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceStatusXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 391 | transmitRequest(parentPlatform, request); | 396 | transmitRequest(parentPlatform, request); |
| 392 | 397 | ||
| 393 | } catch (SipException | ParseException | InvalidArgumentException e) { | 398 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -437,6 +442,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -437,6 +442,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 437 | e.printStackTrace(); | 442 | e.printStackTrace(); |
| 438 | } catch (IllegalAccessException e) { | 443 | } catch (IllegalAccessException e) { |
| 439 | e.printStackTrace(); | 444 | e.printStackTrace(); |
| 445 | + } catch (InvalidArgumentException e) { | ||
| 446 | + e.printStackTrace(); | ||
| 440 | } | 447 | } |
| 441 | return true; | 448 | return true; |
| 442 | } | 449 | } |
| @@ -470,15 +477,14 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -470,15 +477,14 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 470 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() | 477 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 471 | : udpSipProvider.getNewCallId(); | 478 | : udpSipProvider.getNewCallId(); |
| 472 | 479 | ||
| 473 | - String tm = Long.toString(System.currentTimeMillis()); | ||
| 474 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceStatusXml.toString(), "FromPtz" + tm, callIdHeader); | 480 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, deviceStatusXml.toString(), SipUtils.getNewFromTag(), SipUtils.getNewViaTag(), callIdHeader); |
| 475 | transmitRequest(parentPlatform, request); | 481 | transmitRequest(parentPlatform, request); |
| 476 | 482 | ||
| 477 | } catch (SipException | ParseException e) { | 483 | } catch (SipException | ParseException e) { |
| 478 | e.printStackTrace(); | 484 | e.printStackTrace(); |
| 479 | return false; | 485 | return false; |
| 480 | } catch (InvalidArgumentException e) { | 486 | } catch (InvalidArgumentException e) { |
| 481 | - throw new RuntimeException(e); | 487 | + e.printStackTrace(); |
| 482 | } | 488 | } |
| 483 | return true; | 489 | return true; |
| 484 | } | 490 | } |
| @@ -517,13 +523,15 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -517,13 +523,15 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 517 | e.printStackTrace(); | 523 | e.printStackTrace(); |
| 518 | } catch (IllegalAccessException e) { | 524 | } catch (IllegalAccessException e) { |
| 519 | e.printStackTrace(); | 525 | e.printStackTrace(); |
| 526 | + } catch (InvalidArgumentException e) { | ||
| 527 | + e.printStackTrace(); | ||
| 520 | } | 528 | } |
| 521 | return true; | 529 | return true; |
| 522 | } | 530 | } |
| 523 | 531 | ||
| 524 | private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent, | 532 | private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent, |
| 525 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) | 533 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) |
| 526 | - throws NoSuchFieldException, IllegalAccessException, SipException, ParseException { | 534 | + throws NoSuchFieldException, IllegalAccessException, SipException, ParseException, InvalidArgumentException { |
| 527 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); | 535 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); |
| 528 | String characterSet = parentPlatform.getCharacterSet(); | 536 | String characterSet = parentPlatform.getCharacterSet(); |
| 529 | // 设置编码, 防止中文乱码 | 537 | // 设置编码, 防止中文乱码 |
| @@ -533,6 +541,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -533,6 +541,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 533 | return; | 541 | return; |
| 534 | } | 542 | } |
| 535 | SIPRequest notifyRequest = (SIPRequest)dialog.createRequest(Request.NOTIFY); | 543 | SIPRequest notifyRequest = (SIPRequest)dialog.createRequest(Request.NOTIFY); |
| 544 | + | ||
| 545 | + notifyRequest.getCSeqHeader().setSeqNumber(redisCatchStorage.getCSEQ()); | ||
| 546 | + | ||
| 536 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); | 547 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 537 | notifyRequest.setContent(catalogXmlContent, contentTypeHeader); | 548 | notifyRequest.setContent(catalogXmlContent, contentTypeHeader); |
| 538 | 549 | ||
| @@ -665,6 +676,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -665,6 +676,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 665 | e.printStackTrace(); | 676 | e.printStackTrace(); |
| 666 | } catch (IllegalAccessException e) { | 677 | } catch (IllegalAccessException e) { |
| 667 | e.printStackTrace(); | 678 | e.printStackTrace(); |
| 679 | + } catch (InvalidArgumentException e) { | ||
| 680 | + e.printStackTrace(); | ||
| 668 | } | 681 | } |
| 669 | 682 | ||
| 670 | return true; | 683 | return true; |
| @@ -742,7 +755,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -742,7 +755,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 742 | // callid | 755 | // callid |
| 743 | CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() | 756 | CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 744 | : udpSipProvider.getNewCallId(); | 757 | : udpSipProvider.getNewCallId(); |
| 745 | - Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, recordXml.toString(), fromTag, callIdHeader); | 758 | + Request request = headerProviderPlarformProvider.createMessageRequest(parentPlatform, recordXml.toString(), fromTag, SipUtils.getNewViaTag(), callIdHeader); |
| 746 | transmitRequest(parentPlatform, request); | 759 | transmitRequest(parentPlatform, request); |
| 747 | 760 | ||
| 748 | } catch (SipException | ParseException | InvalidArgumentException e) { | 761 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| @@ -819,9 +832,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | @@ -819,9 +832,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { | ||
| 819 | e.printStackTrace(); | 832 | e.printStackTrace(); |
| 820 | return false; | 833 | return false; |
| 821 | } catch (NoSuchFieldException e) { | 834 | } catch (NoSuchFieldException e) { |
| 822 | - throw new RuntimeException(e); | 835 | + e.printStackTrace(); |
| 823 | } catch (IllegalAccessException e) { | 836 | } catch (IllegalAccessException e) { |
| 824 | - throw new RuntimeException(e); | 837 | + e.printStackTrace(); |
| 825 | } | 838 | } |
| 826 | return true; | 839 | return true; |
| 827 | 840 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
| @@ -130,7 +130,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In | @@ -130,7 +130,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In | ||
| 130 | StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId); | 130 | StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId); |
| 131 | if (streamInfo != null) { | 131 | if (streamInfo != null) { |
| 132 | redisCatchStorage.stopPlay(streamInfo); | 132 | redisCatchStorage.stopPlay(streamInfo); |
| 133 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, streamInfo.getStream()); | 133 | + mediaServerService.closeRTPServer(streamInfo.getMediaServerId(), streamInfo.getStream()); |
| 134 | } | 134 | } |
| 135 | SsrcTransaction ssrcTransactionForPlay = streamSession.getSsrcTransaction(device.getDeviceId(), channelId, "play", null); | 135 | SsrcTransaction ssrcTransactionForPlay = streamSession.getSsrcTransaction(device.getDeviceId(), channelId, "play", null); |
| 136 | if (ssrcTransactionForPlay != null){ | 136 | if (ssrcTransactionForPlay != null){ |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| @@ -32,6 +32,7 @@ import com.genersoft.iot.vmp.service.IStreamPushService; | @@ -32,6 +32,7 @@ import com.genersoft.iot.vmp.service.IStreamPushService; | ||
| 32 | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; | 32 | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; |
| 33 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; | 33 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 34 | import com.genersoft.iot.vmp.service.impl.RedisGbPlayMsgListener; | 34 | import com.genersoft.iot.vmp.service.impl.RedisGbPlayMsgListener; |
| 35 | +import com.genersoft.iot.vmp.service.impl.RedisPushStreamResponseListener; | ||
| 35 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 36 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 36 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 37 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 37 | import com.genersoft.iot.vmp.utils.DateUtil; | 38 | import com.genersoft.iot.vmp.utils.DateUtil; |
| @@ -87,7 +88,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -87,7 +88,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 87 | private DynamicTask dynamicTask; | 88 | private DynamicTask dynamicTask; |
| 88 | 89 | ||
| 89 | @Autowired | 90 | @Autowired |
| 90 | - private SIPCommander cmder; | 91 | + private RedisPushStreamResponseListener redisPushStreamResponseListener; |
| 91 | 92 | ||
| 92 | @Autowired | 93 | @Autowired |
| 93 | private IPlayService playService; | 94 | private IPlayService playService; |
| @@ -588,7 +589,6 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -588,7 +589,6 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 588 | otherWvpPushStream(evt, gbStream, streamPushItem, platform, callIdHeader, mediaServerItem, port, tcpActive, | 589 | otherWvpPushStream(evt, gbStream, streamPushItem, platform, callIdHeader, mediaServerItem, port, tcpActive, |
| 589 | mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId); | 590 | mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId); |
| 590 | } | 591 | } |
| 591 | - | ||
| 592 | } | 592 | } |
| 593 | /** | 593 | /** |
| 594 | * 通知流上线 | 594 | * 通知流上线 |
| @@ -671,6 +671,23 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -671,6 +671,23 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 671 | mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId); | 671 | mediaTransmissionTCP, channelId, addressStr, ssrc, requesterId); |
| 672 | } | 672 | } |
| 673 | }); | 673 | }); |
| 674 | + | ||
| 675 | + // 添加回复的拒绝或者错误的通知 | ||
| 676 | + redisPushStreamResponseListener.addEvent(gbStream.getApp(), gbStream.getStream(), response -> { | ||
| 677 | + if (response.getCode() != 0) { | ||
| 678 | + dynamicTask.stop(callIdHeader.getCallId()); | ||
| 679 | + mediaListManager.removedChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream()); | ||
| 680 | + try { | ||
| 681 | + responseAck(evt, Response.TEMPORARILY_UNAVAILABLE, response.getMsg()); | ||
| 682 | + } catch (SipException e) { | ||
| 683 | + throw new RuntimeException(e); | ||
| 684 | + } catch (InvalidArgumentException e) { | ||
| 685 | + throw new RuntimeException(e); | ||
| 686 | + } catch (ParseException e) { | ||
| 687 | + throw new RuntimeException(e); | ||
| 688 | + } | ||
| 689 | + } | ||
| 690 | + }); | ||
| 674 | } | 691 | } |
| 675 | } | 692 | } |
| 676 | 693 |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
| @@ -78,6 +78,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | @@ -78,6 +78,11 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | ||
| 78 | 78 | ||
| 79 | List<DeviceChannel> allChannels = new ArrayList<>(); | 79 | List<DeviceChannel> allChannels = new ArrayList<>(); |
| 80 | 80 | ||
| 81 | + // 回复平台 | ||
| 82 | +// DeviceChannel deviceChannel = getChannelForPlatform(parentPlatform); | ||
| 83 | +// allChannels.add(deviceChannel); | ||
| 84 | + | ||
| 85 | + // 回复目录 | ||
| 81 | if (catalogs.size() > 0) { | 86 | if (catalogs.size() > 0) { |
| 82 | allChannels.addAll(catalogs); | 87 | allChannels.addAll(catalogs); |
| 83 | } | 88 | } |
| @@ -104,4 +109,19 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | @@ -104,4 +109,19 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem | ||
| 104 | } | 109 | } |
| 105 | 110 | ||
| 106 | } | 111 | } |
| 112 | + | ||
| 113 | + private DeviceChannel getChannelForPlatform(ParentPlatform platform) { | ||
| 114 | + DeviceChannel deviceChannel = new DeviceChannel(); | ||
| 115 | + | ||
| 116 | + deviceChannel.setChannelId(platform.getDeviceGBId()); | ||
| 117 | + deviceChannel.setName(platform.getName()); | ||
| 118 | + deviceChannel.setManufacture("wvp-pro"); | ||
| 119 | + deviceChannel.setOwner("wvp-pro"); | ||
| 120 | + deviceChannel.setCivilCode(platform.getAdministrativeDivision()); | ||
| 121 | + deviceChannel.setAddress("wvp-pro"); | ||
| 122 | + deviceChannel.setRegisterWay(0); | ||
| 123 | + deviceChannel.setSecrecy("0"); | ||
| 124 | + | ||
| 125 | + return deviceChannel; | ||
| 126 | + } | ||
| 107 | } | 127 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/InviteResponseProcessor.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl; |
| 2 | 2 | ||
| 3 | import com.genersoft.iot.vmp.conf.SipConfig; | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | -import com.genersoft.iot.vmp.gb28181.SipLayer; | ||
| 5 | -import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 4 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 7 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; | 5 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 8 | import com.genersoft.iot.vmp.gb28181.transmit.event.response.SIPResponseProcessorAbstract; | 6 | import com.genersoft.iot.vmp.gb28181.transmit.event.response.SIPResponseProcessorAbstract; |
| 9 | -import com.genersoft.iot.vmp.gb28181.utils.HeaderUtils; | 7 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 8 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 10 | import gov.nist.javax.sip.ResponseEventExt; | 9 | import gov.nist.javax.sip.ResponseEventExt; |
| 11 | -import gov.nist.javax.sip.message.SIPResponse; | ||
| 12 | import gov.nist.javax.sip.stack.SIPDialog; | 10 | import gov.nist.javax.sip.stack.SIPDialog; |
| 13 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 14 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| @@ -22,13 +20,10 @@ import javax.sip.*; | @@ -22,13 +20,10 @@ import javax.sip.*; | ||
| 22 | import javax.sip.address.Address; | 20 | import javax.sip.address.Address; |
| 23 | import javax.sip.address.SipURI; | 21 | import javax.sip.address.SipURI; |
| 24 | import javax.sip.header.CSeqHeader; | 22 | import javax.sip.header.CSeqHeader; |
| 25 | -import javax.sip.header.CallIdHeader; | ||
| 26 | import javax.sip.header.UserAgentHeader; | 23 | import javax.sip.header.UserAgentHeader; |
| 27 | import javax.sip.message.Request; | 24 | import javax.sip.message.Request; |
| 28 | import javax.sip.message.Response; | 25 | import javax.sip.message.Response; |
| 29 | import java.text.ParseException; | 26 | import java.text.ParseException; |
| 30 | -import java.util.ArrayList; | ||
| 31 | -import java.util.List; | ||
| 32 | 27 | ||
| 33 | 28 | ||
| 34 | /** | 29 | /** |
| @@ -54,6 +49,9 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract { | @@ -54,6 +49,9 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract { | ||
| 54 | @Autowired | 49 | @Autowired |
| 55 | private SipFactory sipFactory; | 50 | private SipFactory sipFactory; |
| 56 | 51 | ||
| 52 | + @Autowired | ||
| 53 | + private GitUtil gitUtil; | ||
| 54 | + | ||
| 57 | @Override | 55 | @Override |
| 58 | public void afterPropertiesSet() throws Exception { | 56 | public void afterPropertiesSet() throws Exception { |
| 59 | // 添加消息处理的订阅 | 57 | // 添加消息处理的订阅 |
| @@ -104,7 +102,7 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract { | @@ -104,7 +102,7 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract { | ||
| 104 | } | 102 | } |
| 105 | requestURI.setPort(event.getRemotePort()); | 103 | requestURI.setPort(event.getRemotePort()); |
| 106 | reqAck.setRequestURI(requestURI); | 104 | reqAck.setRequestURI(requestURI); |
| 107 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | 105 | + UserAgentHeader userAgentHeader = SipUtils.createUserAgentHeader(sipFactory, gitUtil); |
| 108 | reqAck.addHeader(userAgentHeader); | 106 | reqAck.addHeader(userAgentHeader); |
| 109 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); | 107 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 110 | reqAck.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); | 108 | reqAck.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java
| @@ -26,11 +26,17 @@ public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor | @@ -26,11 +26,17 @@ public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor | ||
| 26 | 26 | ||
| 27 | @Override | 27 | @Override |
| 28 | public void process(TimeoutEvent event) { | 28 | public void process(TimeoutEvent event) { |
| 29 | - // TODO Auto-generated method stub | ||
| 30 | - CallIdHeader callIdHeader = event.getClientTransaction().getDialog().getCallId(); | ||
| 31 | - String callId = callIdHeader.getCallId(); | ||
| 32 | - SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId); | ||
| 33 | - SipSubscribe.EventResult<TimeoutEvent> timeoutEventEventResult = new SipSubscribe.EventResult<>(event); | ||
| 34 | - errorSubscribe.response(timeoutEventEventResult); | 29 | + try { |
| 30 | + // TODO Auto-generated method stub | ||
| 31 | + CallIdHeader callIdHeader = event.getClientTransaction().getDialog().getCallId(); | ||
| 32 | + String callId = callIdHeader.getCallId(); | ||
| 33 | + SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId); | ||
| 34 | + SipSubscribe.EventResult<TimeoutEvent> timeoutEventEventResult = new SipSubscribe.EventResult<>(event); | ||
| 35 | + errorSubscribe.response(timeoutEventEventResult); | ||
| 36 | + sipSubscribe.removeErrorSubscribe(callId); | ||
| 37 | + sipSubscribe.removeOkSubscribe(callId); | ||
| 38 | + } catch (Exception e) { | ||
| 39 | + e.printStackTrace(); | ||
| 40 | + } | ||
| 35 | } | 41 | } |
| 36 | } | 42 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/HeaderUtils.java deleted
100644 → 0
| 1 | -package com.genersoft.iot.vmp.gb28181.utils; | ||
| 2 | - | ||
| 3 | -import javax.sip.PeerUnavailableException; | ||
| 4 | -import javax.sip.SipFactory; | ||
| 5 | -import javax.sip.header.UserAgentHeader; | ||
| 6 | -import java.text.ParseException; | ||
| 7 | -import java.util.ArrayList; | ||
| 8 | -import java.util.List; | ||
| 9 | - | ||
| 10 | -/** | ||
| 11 | - * 生成header的工具类 | ||
| 12 | - * @author lin | ||
| 13 | - */ | ||
| 14 | -public class HeaderUtils { | ||
| 15 | - | ||
| 16 | - public static UserAgentHeader createUserAgentHeader(SipFactory sipFactory) throws PeerUnavailableException, ParseException { | ||
| 17 | - List<String> agentParam = new ArrayList<>(); | ||
| 18 | - agentParam.add("WVP PRO"); | ||
| 19 | - // TODO 添加版本信息以及日期 | ||
| 20 | - return sipFactory.createHeaderFactory().createUserAgentHeader(agentParam); | ||
| 21 | - } | ||
| 22 | -} |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java
| 1 | package com.genersoft.iot.vmp.gb28181.utils; | 1 | package com.genersoft.iot.vmp.gb28181.utils; |
| 2 | 2 | ||
| 3 | +import com.genersoft.iot.vmp.utils.GitUtil; | ||
| 3 | import gov.nist.javax.sip.address.AddressImpl; | 4 | import gov.nist.javax.sip.address.AddressImpl; |
| 4 | import gov.nist.javax.sip.address.SipUri; | 5 | import gov.nist.javax.sip.address.SipUri; |
| 5 | import gov.nist.javax.sip.header.Subject; | 6 | import gov.nist.javax.sip.header.Subject; |
| 6 | 7 | ||
| 8 | +import javax.sip.PeerUnavailableException; | ||
| 9 | +import javax.sip.SipFactory; | ||
| 7 | import javax.sip.header.FromHeader; | 10 | import javax.sip.header.FromHeader; |
| 8 | import javax.sip.header.Header; | 11 | import javax.sip.header.Header; |
| 12 | +import javax.sip.header.UserAgentHeader; | ||
| 9 | import javax.sip.message.Request; | 13 | import javax.sip.message.Request; |
| 14 | +import java.text.ParseException; | ||
| 15 | +import java.util.ArrayList; | ||
| 16 | +import java.util.List; | ||
| 17 | +import java.util.UUID; | ||
| 10 | 18 | ||
| 11 | /** | 19 | /** |
| 12 | * @author panlinlin | 20 | * @author panlinlin |
| @@ -38,4 +46,28 @@ public class SipUtils { | @@ -38,4 +46,28 @@ public class SipUtils { | ||
| 38 | return uri.getUser(); | 46 | return uri.getUser(); |
| 39 | } | 47 | } |
| 40 | 48 | ||
| 49 | + public static String getNewViaTag() { | ||
| 50 | + return "z9hG4bK" + System.currentTimeMillis(); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public static UserAgentHeader createUserAgentHeader(SipFactory sipFactory, GitUtil gitUtil) throws PeerUnavailableException, ParseException { | ||
| 54 | + List<String> agentParam = new ArrayList<>(); | ||
| 55 | + agentParam.add("WVP-Pro v"); | ||
| 56 | + if (gitUtil != null && gitUtil.getCommitTime() != null) { | ||
| 57 | + agentParam.add(gitUtil.getBuildVersion() + "."); | ||
| 58 | + agentParam.add(gitUtil.getCommitTime()); | ||
| 59 | + } | ||
| 60 | + return sipFactory.createHeaderFactory().createUserAgentHeader(agentParam); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public static String getNewFromTag(){ | ||
| 64 | + return UUID.randomUUID().toString().replace("-", ""); | ||
| 65 | + | ||
| 66 | +// return getNewTag(); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public static String getNewTag(){ | ||
| 70 | + return String.valueOf(System.currentTimeMillis()); | ||
| 71 | + } | ||
| 72 | + | ||
| 41 | } | 73 | } |
src/main/java/com/genersoft/iot/vmp/gb28181/utils/XmlUtil.java
| @@ -203,12 +203,6 @@ public class XmlUtil { | @@ -203,12 +203,6 @@ public class XmlUtil { | ||
| 203 | return null; | 203 | return null; |
| 204 | } | 204 | } |
| 205 | deviceChannel.setChannelId(channelId); | 205 | deviceChannel.setChannelId(channelId); |
| 206 | - int channelTypeCode = Integer.parseInt(channelId.substring(10, 13)); | ||
| 207 | - if (channelTypeCode == 136 || channelTypeCode == 137 || channelTypeCode == 138) { | ||
| 208 | - deviceChannel.setHasAudio(true); | ||
| 209 | - }else { | ||
| 210 | - deviceChannel.setHasAudio(false); | ||
| 211 | - } | ||
| 212 | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) { | 206 | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) { |
| 213 | // 除了ADD和update情况下需要识别全部内容, | 207 | // 除了ADD和update情况下需要识别全部内容, |
| 214 | return deviceChannel; | 208 | return deviceChannel; |
| @@ -217,17 +211,26 @@ public class XmlUtil { | @@ -217,17 +211,26 @@ public class XmlUtil { | ||
| 217 | ChannelType channelType = ChannelType.Other; | 211 | ChannelType channelType = ChannelType.Other; |
| 218 | if (channelId.length() <= 8) { | 212 | if (channelId.length() <= 8) { |
| 219 | channelType = ChannelType.CivilCode; | 213 | channelType = ChannelType.CivilCode; |
| 214 | + deviceChannel.setHasAudio(false); | ||
| 220 | }else { | 215 | }else { |
| 221 | if (channelId.length() == 20) { | 216 | if (channelId.length() == 20) { |
| 222 | int code = Integer.parseInt(channelId.substring(10, 13)); | 217 | int code = Integer.parseInt(channelId.substring(10, 13)); |
| 223 | switch (code){ | 218 | switch (code){ |
| 224 | case 215: | 219 | case 215: |
| 225 | channelType = ChannelType.BusinessGroup; | 220 | channelType = ChannelType.BusinessGroup; |
| 221 | + deviceChannel.setHasAudio(false); | ||
| 226 | break; | 222 | break; |
| 227 | case 216: | 223 | case 216: |
| 228 | channelType = ChannelType.VirtualOrganization; | 224 | channelType = ChannelType.VirtualOrganization; |
| 225 | + deviceChannel.setHasAudio(false); | ||
| 226 | + break; | ||
| 227 | + case 136: | ||
| 228 | + case 137: | ||
| 229 | + case 138: | ||
| 230 | + deviceChannel.setHasAudio(true); | ||
| 229 | break; | 231 | break; |
| 230 | default: | 232 | default: |
| 233 | + deviceChannel.setHasAudio(false); | ||
| 231 | break; | 234 | break; |
| 232 | 235 | ||
| 233 | } | 236 | } |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
| @@ -139,6 +139,7 @@ public class ZLMRTPServerFactory { | @@ -139,6 +139,7 @@ public class ZLMRTPServerFactory { | ||
| 139 | param.put("stream_id", streamId); | 139 | param.put("stream_id", streamId); |
| 140 | JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param); | 140 | JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param); |
| 141 | if (jsonObject != null ) { | 141 | if (jsonObject != null ) { |
| 142 | + System.out.println(jsonObject); | ||
| 142 | if (jsonObject.getInteger("code") == 0) { | 143 | if (jsonObject.getInteger("code") == 0) { |
| 143 | result = jsonObject.getInteger("hit") == 1; | 144 | result = jsonObject.getInteger("hit") == 1; |
| 144 | }else { | 145 | }else { |
src/main/java/com/genersoft/iot/vmp/service/IGbStreamService.java
| @@ -53,4 +53,6 @@ public interface IGbStreamService { | @@ -53,4 +53,6 @@ public interface IGbStreamService { | ||
| 53 | * @return | 53 | * @return |
| 54 | */ | 54 | */ |
| 55 | int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate); | 55 | int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate); |
| 56 | + | ||
| 57 | + DeviceChannel getDeviceChannelListByStreamWithStatus(GbStream gbStream, String catalogId, ParentPlatform platform); | ||
| 56 | } | 58 | } |
src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java
| @@ -49,7 +49,9 @@ public interface IMediaServerService { | @@ -49,7 +49,9 @@ public interface IMediaServerService { | ||
| 49 | 49 | ||
| 50 | SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, String ssrc, boolean ssrcCheck, boolean isPlayback, Integer port); | 50 | SSRCInfo openRTPServer(MediaServerItem mediaServerItem, String streamId, String ssrc, boolean ssrcCheck, boolean isPlayback, Integer port); |
| 51 | 51 | ||
| 52 | - void closeRTPServer(String deviceId, String channelId, String ssrc); | 52 | + void closeRTPServer(MediaServerItem mediaServerItem, String streamId); |
| 53 | + | ||
| 54 | + void closeRTPServer(String mediaServerId, String streamId); | ||
| 53 | 55 | ||
| 54 | void clearRTPServer(MediaServerItem mediaServerItem); | 56 | void clearRTPServer(MediaServerItem mediaServerItem); |
| 55 | 57 |
src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannel.java
| @@ -48,6 +48,8 @@ public class MessageForPushChannel { | @@ -48,6 +48,8 @@ public class MessageForPushChannel { | ||
| 48 | */ | 48 | */ |
| 49 | private String mediaServerId; | 49 | private String mediaServerId; |
| 50 | 50 | ||
| 51 | + | ||
| 52 | + | ||
| 51 | public static MessageForPushChannel getInstance(int type, String app, String stream, String gbId, | 53 | public static MessageForPushChannel getInstance(int type, String app, String stream, String gbId, |
| 52 | String platFormId, String platFormName, String serverId, | 54 | String platFormId, String platFormName, String serverId, |
| 53 | String mediaServerId){ | 55 | String mediaServerId){ |
src/main/java/com/genersoft/iot/vmp/service/bean/MessageForPushChannelResponse.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.service.bean; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 当redis回复推流结果上级平台 | ||
| 5 | + * @author lin | ||
| 6 | + */ | ||
| 7 | +public class MessageForPushChannelResponse { | ||
| 8 | + /** | ||
| 9 | + * 错误玛 | ||
| 10 | + * 0 成功 1 失败 | ||
| 11 | + */ | ||
| 12 | + private int code; | ||
| 13 | + /** | ||
| 14 | + * 错误内容 | ||
| 15 | + */ | ||
| 16 | + private String msg; | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 流应用名 | ||
| 20 | + */ | ||
| 21 | + private String app; | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 流Id | ||
| 25 | + */ | ||
| 26 | + private String stream; | ||
| 27 | + | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + public static MessageForPushChannelResponse getInstance(int code, String msg, String app, String stream){ | ||
| 31 | + MessageForPushChannelResponse messageForPushChannel = new MessageForPushChannelResponse(); | ||
| 32 | + messageForPushChannel.setCode(code); | ||
| 33 | + messageForPushChannel.setMsg(msg); | ||
| 34 | + messageForPushChannel.setApp(app); | ||
| 35 | + messageForPushChannel.setStream(stream); | ||
| 36 | + return messageForPushChannel; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + | ||
| 40 | + public int getCode() { | ||
| 41 | + return code; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + public void setCode(int code) { | ||
| 45 | + this.code = code; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public String getApp() { | ||
| 49 | + return app; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public void setApp(String app) { | ||
| 53 | + this.app = app; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public String getStream() { | ||
| 57 | + return stream; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public void setStream(String stream) { | ||
| 61 | + this.stream = stream; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public String getMsg() { | ||
| 65 | + return msg; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + public void setMsg(String msg) { | ||
| 69 | + this.msg = msg; | ||
| 70 | + } | ||
| 71 | +} |
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
| @@ -145,7 +145,7 @@ public class DeviceServiceImpl implements IDeviceService { | @@ -145,7 +145,7 @@ public class DeviceServiceImpl implements IDeviceService { | ||
| 145 | if (ssrcTransactions != null && ssrcTransactions.size() > 0) { | 145 | if (ssrcTransactions != null && ssrcTransactions.size() > 0) { |
| 146 | for (SsrcTransaction ssrcTransaction : ssrcTransactions) { | 146 | for (SsrcTransaction ssrcTransaction : ssrcTransactions) { |
| 147 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); | 147 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); |
| 148 | - mediaServerService.closeRTPServer(deviceId, ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | 148 | + mediaServerService.closeRTPServer(ssrcTransaction.getMediaServerId(), ssrcTransaction.getStream()); |
| 149 | streamSession.remove(deviceId, ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | 149 | streamSession.remove(deviceId, ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); |
| 150 | } | 150 | } |
| 151 | } | 151 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java
| @@ -79,7 +79,7 @@ public class GbStreamServiceImpl implements IGbStreamService { | @@ -79,7 +79,7 @@ public class GbStreamServiceImpl implements IGbStreamService { | ||
| 79 | gbStream.setPlatformId(platformId); | 79 | gbStream.setPlatformId(platformId); |
| 80 | // TODO 修改为批量提交 | 80 | // TODO 修改为批量提交 |
| 81 | platformGbStreamMapper.add(gbStream); | 81 | platformGbStreamMapper.add(gbStream); |
| 82 | - DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform); | 82 | + DeviceChannel deviceChannelListByStream = getDeviceChannelListByStreamWithStatus(gbStream, catalogId, parentPlatform); |
| 83 | deviceChannelList.add(deviceChannelListByStream); | 83 | deviceChannelList.add(deviceChannelListByStream); |
| 84 | } | 84 | } |
| 85 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 | 85 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| @@ -188,4 +188,46 @@ public class GbStreamServiceImpl implements IGbStreamService { | @@ -188,4 +188,46 @@ public class GbStreamServiceImpl implements IGbStreamService { | ||
| 188 | public int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate) { | 188 | public int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate) { |
| 189 | return gbStreamMapper.updateGbIdOrName(streamPushItemForUpdate); | 189 | return gbStreamMapper.updateGbIdOrName(streamPushItemForUpdate); |
| 190 | } | 190 | } |
| 191 | + | ||
| 192 | + @Override | ||
| 193 | + public DeviceChannel getDeviceChannelListByStreamWithStatus(GbStream gbStream, String catalogId, ParentPlatform platform) { | ||
| 194 | + DeviceChannel deviceChannel = new DeviceChannel(); | ||
| 195 | + deviceChannel.setChannelId(gbStream.getGbId()); | ||
| 196 | + deviceChannel.setName(gbStream.getName()); | ||
| 197 | + deviceChannel.setLongitude(gbStream.getLongitude()); | ||
| 198 | + deviceChannel.setLatitude(gbStream.getLatitude()); | ||
| 199 | + deviceChannel.setDeviceId(platform.getDeviceGBId()); | ||
| 200 | + deviceChannel.setManufacture("wvp-pro"); | ||
| 201 | + // todo 目前是每一条查询一次,需要优化 | ||
| 202 | + Boolean status = null; | ||
| 203 | + if ("proxy".equals(gbStream.getStreamType())) { | ||
| 204 | + status = gbStreamMapper.selectStatusForProxy(gbStream.getApp(), gbStream.getStream()); | ||
| 205 | + }else { | ||
| 206 | + status = gbStreamMapper.selectStatusForPush(gbStream.getApp(), gbStream.getStream()); | ||
| 207 | + } | ||
| 208 | + deviceChannel.setStatus((status != null && status )?1:0); | ||
| 209 | + | ||
| 210 | + deviceChannel.setRegisterWay(1); | ||
| 211 | + deviceChannel.setCivilCode(platform.getAdministrativeDivision()); | ||
| 212 | + | ||
| 213 | + if (platform.getTreeType().equals(TreeType.CIVIL_CODE)){ | ||
| 214 | + deviceChannel.setCivilCode(catalogId); | ||
| 215 | + }else if (platform.getTreeType().equals(TreeType.BUSINESS_GROUP)){ | ||
| 216 | + PlatformCatalog catalog = catalogMapper.select(catalogId); | ||
| 217 | + if (catalog == null) { | ||
| 218 | + deviceChannel.setParentId(platform.getDeviceGBId()); | ||
| 219 | + deviceChannel.setBusinessGroupId(null); | ||
| 220 | + }else { | ||
| 221 | + deviceChannel.setParentId(catalog.getId()); | ||
| 222 | + deviceChannel.setBusinessGroupId(catalog.getBusinessGroupId()); | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + deviceChannel.setModel("live"); | ||
| 228 | + deviceChannel.setOwner("wvp-pro"); | ||
| 229 | + deviceChannel.setParental(0); | ||
| 230 | + deviceChannel.setSecrecy("0"); | ||
| 231 | + return deviceChannel; | ||
| 232 | + } | ||
| 191 | } | 233 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| @@ -169,16 +169,18 @@ public class MediaServerServiceImpl implements IMediaServerService { | @@ -169,16 +169,18 @@ public class MediaServerServiceImpl implements IMediaServerService { | ||
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | @Override | 171 | @Override |
| 172 | - public void closeRTPServer(String deviceId, String channelId, String stream) { | ||
| 173 | - String mediaServerId = streamSession.getMediaServerId(deviceId, channelId, stream); | ||
| 174 | - String ssrc = streamSession.getSSRC(deviceId, channelId, stream); | ||
| 175 | - MediaServerItem mediaServerItem = this.getOne(mediaServerId); | ||
| 176 | - if (mediaServerItem != null) { | ||
| 177 | - String streamId = String.format("%s_%s", deviceId, channelId); | ||
| 178 | - zlmrtpServerFactory.closeRTPServer(mediaServerItem, streamId); | ||
| 179 | - releaseSsrc(mediaServerItem.getId(), ssrc); | 172 | + public void closeRTPServer(MediaServerItem mediaServerItem, String streamId) { |
| 173 | + if (mediaServerItem == null) { | ||
| 174 | + return; | ||
| 180 | } | 175 | } |
| 181 | - streamSession.remove(deviceId, channelId, stream); | 176 | + zlmrtpServerFactory.closeRTPServer(mediaServerItem, streamId); |
| 177 | + releaseSsrc(mediaServerItem.getId(), streamId); | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + @Override | ||
| 181 | + public void closeRTPServer(String mediaServerId, String streamId) { | ||
| 182 | + MediaServerItem mediaServerItem = this.getOne(mediaServerId); | ||
| 183 | + closeRTPServer(mediaServerItem, streamId); | ||
| 182 | } | 184 | } |
| 183 | 185 | ||
| 184 | @Override | 186 | @Override |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -285,6 +285,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -285,6 +285,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 285 | // 超时处理 | 285 | // 超时处理 |
| 286 | String timeOutTaskKey = UUID.randomUUID().toString(); | 286 | String timeOutTaskKey = UUID.randomUUID().toString(); |
| 287 | SSRCInfo finalSsrcInfo = ssrcInfo; | 287 | SSRCInfo finalSsrcInfo = ssrcInfo; |
| 288 | + System.out.println("设置超时任务: " + timeOutTaskKey); | ||
| 288 | dynamicTask.startDelay( timeOutTaskKey,()->{ | 289 | dynamicTask.startDelay( timeOutTaskKey,()->{ |
| 289 | 290 | ||
| 290 | SIPDialog dialog = streamSession.getDialogByStream(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | 291 | SIPDialog dialog = streamSession.getDialogByStream(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); |
| @@ -297,7 +298,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -297,7 +298,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 297 | logger.info("[点播超时] 消息未响应 deviceId: {}, channelId: {}", device.getDeviceId(), channelId); | 298 | logger.info("[点播超时] 消息未响应 deviceId: {}, channelId: {}", device.getDeviceId(), channelId); |
| 298 | timeoutCallback.run(0, "点播超时"); | 299 | timeoutCallback.run(0, "点播超时"); |
| 299 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); | 300 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); |
| 300 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | 301 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); |
| 301 | streamSession.remove(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | 302 | streamSession.remove(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); |
| 302 | } | 303 | } |
| 303 | }, userSetting.getPlayTimeout()); | 304 | }, userSetting.getPlayTimeout()); |
| @@ -310,6 +311,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -310,6 +311,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 310 | } | 311 | } |
| 311 | cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> { | 312 | cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> { |
| 312 | logger.info("收到订阅消息: " + response.toJSONString()); | 313 | logger.info("收到订阅消息: " + response.toJSONString()); |
| 314 | + System.out.println("停止超时任务: " + timeOutTaskKey); | ||
| 313 | dynamicTask.stop(timeOutTaskKey); | 315 | dynamicTask.stop(timeOutTaskKey); |
| 314 | // hook响应 | 316 | // hook响应 |
| 315 | onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId, uuid); | 317 | onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId, uuid); |
| @@ -359,7 +361,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -359,7 +361,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 359 | }); | 361 | }); |
| 360 | } | 362 | } |
| 361 | // 关闭rtp server | 363 | // 关闭rtp server |
| 362 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | 364 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); |
| 363 | // 重新开启ssrc server | 365 | // 重新开启ssrc server |
| 364 | mediaServerService.openRTPServer(mediaServerItem, finalSsrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), false, finalSsrcInfo.getPort()); | 366 | mediaServerService.openRTPServer(mediaServerItem, finalSsrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), false, finalSsrcInfo.getPort()); |
| 365 | 367 | ||
| @@ -367,7 +369,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -367,7 +369,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 367 | } | 369 | } |
| 368 | }, (event) -> { | 370 | }, (event) -> { |
| 369 | dynamicTask.stop(timeOutTaskKey); | 371 | dynamicTask.stop(timeOutTaskKey); |
| 370 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | 372 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); |
| 371 | // 释放ssrc | 373 | // 释放ssrc |
| 372 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); | 374 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); |
| 373 | 375 | ||
| @@ -471,7 +473,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -471,7 +473,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 471 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); | 473 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| 472 | }else { | 474 | }else { |
| 473 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); | 475 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); |
| 474 | - mediaServerService.closeRTPServer(deviceId, channelId, ssrcInfo.getStream()); | 476 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); |
| 475 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); | 477 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); |
| 476 | } | 478 | } |
| 477 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); | 479 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| @@ -559,7 +561,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -559,7 +561,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 559 | }); | 561 | }); |
| 560 | } | 562 | } |
| 561 | // 关闭rtp server | 563 | // 关闭rtp server |
| 562 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, ssrcInfo.getStream()); | 564 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); |
| 563 | // 重新开启ssrc server | 565 | // 重新开启ssrc server |
| 564 | mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort()); | 566 | mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort()); |
| 565 | } | 567 | } |
| @@ -619,7 +621,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -619,7 +621,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 619 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); | 621 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| 620 | }else { | 622 | }else { |
| 621 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); | 623 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); |
| 622 | - mediaServerService.closeRTPServer(deviceId, channelId, ssrcInfo.getStream()); | 624 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); |
| 623 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); | 625 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); |
| 624 | } | 626 | } |
| 625 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); | 627 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
src/main/java/com/genersoft/iot/vmp/service/impl/RedisPushStreamResponseListener.java
0 → 100644
| 1 | +package com.genersoft.iot.vmp.service.impl; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.genersoft.iot.vmp.media.zlm.dto.ChannelOnlineEvent; | ||
| 6 | +import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; | ||
| 7 | +import com.genersoft.iot.vmp.service.IGbStreamService; | ||
| 8 | +import com.genersoft.iot.vmp.service.IMediaServerService; | ||
| 9 | +import com.genersoft.iot.vmp.service.IStreamPushService; | ||
| 10 | +import com.genersoft.iot.vmp.service.bean.MessageForPushChannelResponse; | ||
| 11 | +import com.genersoft.iot.vmp.utils.DateUtil; | ||
| 12 | +import org.slf4j.Logger; | ||
| 13 | +import org.slf4j.LoggerFactory; | ||
| 14 | +import org.springframework.data.redis.connection.Message; | ||
| 15 | +import org.springframework.data.redis.connection.MessageListener; | ||
| 16 | +import org.springframework.stereotype.Component; | ||
| 17 | +import org.springframework.util.ObjectUtils; | ||
| 18 | + | ||
| 19 | +import javax.annotation.Resource; | ||
| 20 | +import java.util.ArrayList; | ||
| 21 | +import java.util.List; | ||
| 22 | +import java.util.Map; | ||
| 23 | +import java.util.concurrent.ConcurrentHashMap; | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * 接收redis返回的推流结果 | ||
| 27 | + * @author lin | ||
| 28 | + */ | ||
| 29 | +@Component | ||
| 30 | +public class RedisPushStreamResponseListener implements MessageListener { | ||
| 31 | + | ||
| 32 | + private final static Logger logger = LoggerFactory.getLogger(RedisPushStreamResponseListener.class); | ||
| 33 | + | ||
| 34 | + private Map<String, PushStreamResponseEvent> responseEvents = new ConcurrentHashMap<>(); | ||
| 35 | + | ||
| 36 | + public interface PushStreamResponseEvent{ | ||
| 37 | + void run(MessageForPushChannelResponse response); | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + @Override | ||
| 41 | + public void onMessage(Message message, byte[] bytes) { | ||
| 42 | + // | ||
| 43 | + logger.warn("[REDIS消息-请求推流结果]: {}", new String(message.getBody())); | ||
| 44 | + MessageForPushChannelResponse response = JSON.parseObject(new String(message.getBody()), MessageForPushChannelResponse.class); | ||
| 45 | + if (response == null || ObjectUtils.isEmpty(response.getApp()) || ObjectUtils.isEmpty(response.getStream())){ | ||
| 46 | + logger.info("[REDIS消息-请求推流结果]:参数不全"); | ||
| 47 | + return; | ||
| 48 | + } | ||
| 49 | + // 查看正在等待的invite消息 | ||
| 50 | + if (responseEvents.get(response.getApp() + response.getStream()) != null) { | ||
| 51 | + responseEvents.get(response.getApp() + response.getStream()).run(response); | ||
| 52 | + } | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void addEvent(String app, String stream, PushStreamResponseEvent callback) { | ||
| 56 | + responseEvents.put(app + stream, callback); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public void removeEvent(String app, String stream) { | ||
| 60 | + responseEvents.remove(app + stream); | ||
| 61 | + } | ||
| 62 | +} |
src/main/java/com/genersoft/iot/vmp/service/impl/RedisPushStreamListMsgListener.java renamed to src/main/java/com/genersoft/iot/vmp/service/impl/RedisPushStreamStatusListMsgListener.java
| @@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.service.IStreamPushService; | @@ -9,7 +9,6 @@ import com.genersoft.iot.vmp.service.IStreamPushService; | ||
| 9 | import com.genersoft.iot.vmp.utils.DateUtil; | 9 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 10 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 11 | import org.slf4j.LoggerFactory; |
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | import org.springframework.data.redis.connection.Message; | 12 | import org.springframework.data.redis.connection.Message; |
| 14 | import org.springframework.data.redis.connection.MessageListener; | 13 | import org.springframework.data.redis.connection.MessageListener; |
| 15 | import org.springframework.stereotype.Component; | 14 | import org.springframework.stereotype.Component; |
| @@ -23,9 +22,9 @@ import java.util.*; | @@ -23,9 +22,9 @@ import java.util.*; | ||
| 23 | * @Description: 接收redis发送的推流设备列表更新通知 | 22 | * @Description: 接收redis发送的推流设备列表更新通知 |
| 24 | */ | 23 | */ |
| 25 | @Component | 24 | @Component |
| 26 | -public class RedisPushStreamListMsgListener implements MessageListener { | 25 | +public class RedisPushStreamStatusListMsgListener implements MessageListener { |
| 27 | 26 | ||
| 28 | - private final static Logger logger = LoggerFactory.getLogger(RedisPushStreamListMsgListener.class); | 27 | + private final static Logger logger = LoggerFactory.getLogger(RedisPushStreamStatusListMsgListener.class); |
| 29 | @Resource | 28 | @Resource |
| 30 | private IMediaServerService mediaServerService; | 29 | private IMediaServerService mediaServerService; |
| 31 | 30 |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| @@ -428,7 +428,6 @@ public class StreamPushServiceImpl implements IStreamPushService { | @@ -428,7 +428,6 @@ public class StreamPushServiceImpl implements IStreamPushService { | ||
| 428 | platformId, platformForEvent.get(platformId), CatalogEvent.ADD); | 428 | platformId, platformForEvent.get(platformId), CatalogEvent.ADD); |
| 429 | } | 429 | } |
| 430 | } | 430 | } |
| 431 | - | ||
| 432 | } | 431 | } |
| 433 | } | 432 | } |
| 434 | 433 |
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| @@ -19,11 +19,11 @@ public interface DeviceChannelMapper { | @@ -19,11 +19,11 @@ public interface DeviceChannelMapper { | ||
| 19 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + | 19 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| 20 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + | 20 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 21 | "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + | 21 | "ipAddress, port, password, PTZType, status, streamId, longitude, latitude, longitudeGcj02, latitudeGcj02, " + |
| 22 | - "longitudeWgs84, latitudeWgs84, createTime, updateTime, businessGroupId, gpsTime) " + | 22 | + "longitudeWgs84, latitudeWgs84, hasAudio, createTime, updateTime, businessGroupId, gpsTime) " + |
| 23 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + | 23 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| 24 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + | 24 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| 25 | "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " + | 25 | "'${ipAddress}', ${port}, '${password}', ${PTZType}, ${status}, '${streamId}', ${longitude}, ${latitude}, ${longitudeGcj02}, " + |
| 26 | - "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84},'${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')") | 26 | + "${latitudeGcj02}, ${longitudeWgs84}, ${latitudeWgs84}, ${hasAudio}, '${createTime}', '${updateTime}', '${businessGroupId}', '${gpsTime}')") |
| 27 | int add(DeviceChannel channel); | 27 | int add(DeviceChannel channel); |
| 28 | 28 | ||
| 29 | @Update(value = {" <script>" + | 29 | @Update(value = {" <script>" + |
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
| @@ -158,4 +158,10 @@ public interface GbStreamMapper { | @@ -158,4 +158,10 @@ public interface GbStreamMapper { | ||
| 158 | "</foreach>"+ | 158 | "</foreach>"+ |
| 159 | "</script>") | 159 | "</script>") |
| 160 | int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate); | 160 | int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate); |
| 161 | + | ||
| 162 | + @Select("SELECT status FROM stream_proxy WHERE app=#{app} AND stream=#{stream}") | ||
| 163 | + Boolean selectStatusForProxy(String app, String stream); | ||
| 164 | + | ||
| 165 | + @Select("SELECT status FROM stream_push WHERE app=#{app} AND stream=#{stream}") | ||
| 166 | + Boolean selectStatusForPush(String app, String stream); | ||
| 161 | } | 167 | } |
src/main/java/com/genersoft/iot/vmp/storager/dao/StreamPushMapper.java
| @@ -77,7 +77,7 @@ public interface StreamPushMapper { | @@ -77,7 +77,7 @@ public interface StreamPushMapper { | ||
| 77 | "1=1 " + | 77 | "1=1 " + |
| 78 | " <if test='query != null'> AND (st.app LIKE '%${query}%' OR st.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " + | 78 | " <if test='query != null'> AND (st.app LIKE '%${query}%' OR st.stream LIKE '%${query}%' OR gs.gbId LIKE '%${query}%' OR gs.name LIKE '%${query}%')</if> " + |
| 79 | " <if test='pushing == true' > AND (gs.gbId is null OR st.pushIng=1)</if>" + | 79 | " <if test='pushing == true' > AND (gs.gbId is null OR st.pushIng=1)</if>" + |
| 80 | - " <if test='pushing == false' > AND (gs.pushIng is null OR st.pushIng=0) </if>" + | 80 | + " <if test='pushing == false' > AND (st.pushIng is null OR st.pushIng=0) </if>" + |
| 81 | " <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" + | 81 | " <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" + |
| 82 | "order by st.createTime desc" + | 82 | "order by st.createTime desc" + |
| 83 | " </script>"}) | 83 | " </script>"}) |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| @@ -133,7 +133,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | @@ -133,7 +133,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | ||
| 133 | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); | 133 | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| 134 | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); | 134 | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| 135 | } | 135 | } |
| 136 | - | ||
| 137 | channels.add(deviceChannel); | 136 | channels.add(deviceChannel); |
| 138 | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { | 137 | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| 139 | if (subContMap.get(deviceChannel.getParentId()) == null) { | 138 | if (subContMap.get(deviceChannel.getParentId()) == null) { |
| @@ -696,7 +695,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | @@ -696,7 +695,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { | ||
| 696 | return 0; | 695 | return 0; |
| 697 | } | 696 | } |
| 698 | if (platform.getTreeType().equals(TreeType.BUSINESS_GROUP)) { | 697 | if (platform.getTreeType().equals(TreeType.BUSINESS_GROUP)) { |
| 699 | - if (platformCatalog.getPlatformId().equals(platformCatalog.getParentId())) { | 698 | + if (platform.getDeviceGBId().equals(platformCatalog.getParentId())) { |
| 700 | // 第一层节点 | 699 | // 第一层节点 |
| 701 | platformCatalog.setBusinessGroupId(platformCatalog.getId()); | 700 | platformCatalog.setBusinessGroupId(platformCatalog.getId()); |
| 702 | platformCatalog.setParentId(platform.getDeviceGBId()); | 701 | platformCatalog.setParentId(platform.getDeviceGBId()); |
src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java
| @@ -19,9 +19,16 @@ public class GitUtil { | @@ -19,9 +19,16 @@ public class GitUtil { | ||
| 19 | private String gitUrl; | 19 | private String gitUrl; |
| 20 | @Value("${git.build.time:null}") | 20 | @Value("${git.build.time:null}") |
| 21 | private String buildDate; | 21 | private String buildDate; |
| 22 | + | ||
| 23 | + @Value("${git.build.version:null}") | ||
| 24 | + private String buildVersion; | ||
| 25 | + | ||
| 22 | @Value("${git.commit.id.abbrev:null}") | 26 | @Value("${git.commit.id.abbrev:null}") |
| 23 | private String commitIdShort; | 27 | private String commitIdShort; |
| 24 | 28 | ||
| 29 | + @Value("${git.commit.time:null}") | ||
| 30 | + private String commitTime; | ||
| 31 | + | ||
| 25 | public String getGitCommitId() { | 32 | public String getGitCommitId() { |
| 26 | return gitCommitId; | 33 | return gitCommitId; |
| 27 | } | 34 | } |
| @@ -41,4 +48,12 @@ public class GitUtil { | @@ -41,4 +48,12 @@ public class GitUtil { | ||
| 41 | public String getCommitIdShort() { | 48 | public String getCommitIdShort() { |
| 42 | return commitIdShort; | 49 | return commitIdShort; |
| 43 | } | 50 | } |
| 51 | + | ||
| 52 | + public String getBuildVersion() { | ||
| 53 | + return buildVersion; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public String getCommitTime() { | ||
| 57 | + return commitTime; | ||
| 58 | + } | ||
| 44 | } | 59 | } |
src/main/resources/all-application.yml
| @@ -195,9 +195,3 @@ springdoc: | @@ -195,9 +195,3 @@ springdoc: | ||
| 195 | enabled: false | 195 | enabled: false |
| 196 | swagger-ui: | 196 | swagger-ui: |
| 197 | enabled: false | 197 | enabled: false |
| 198 | - | ||
| 199 | -# 版本信息, 不需修改 | ||
| 200 | -version: | ||
| 201 | - version: "@project.version@" | ||
| 202 | - description: "@project.description@" | ||
| 203 | - artifact-id: "@project.artifactId@" |
src/main/resources/application-dev.yml
| @@ -84,9 +84,3 @@ media: | @@ -84,9 +84,3 @@ media: | ||
| 84 | # [可选] 日志配置, 一般不需要改 | 84 | # [可选] 日志配置, 一般不需要改 |
| 85 | logging: | 85 | logging: |
| 86 | config: classpath:logback-spring-local.xml | 86 | config: classpath:logback-spring-local.xml |
| 87 | - | ||
| 88 | -# 版本信息, 不需修改 | ||
| 89 | -version: | ||
| 90 | - version: "@project.version@" | ||
| 91 | - description: "@project.description@" | ||
| 92 | - artifact-id: "@project.artifactId@" |
src/main/resources/application-docker.yml
| @@ -78,10 +78,3 @@ user-settings: | @@ -78,10 +78,3 @@ user-settings: | ||
| 78 | # 推流直播是否录制 | 78 | # 推流直播是否录制 |
| 79 | record-push-live: true | 79 | record-push-live: true |
| 80 | auto-apply-play: true | 80 | auto-apply-play: true |
| 81 | - | ||
| 82 | - | ||
| 83 | -# 版本信息, 不需修改 | ||
| 84 | -version: | ||
| 85 | - version: "@project.version@" | ||
| 86 | - description: "@project.description@" | ||
| 87 | - artifact-id: "@project.artifactId@" |
src/main/resources/banner.txt
| @@ -5,5 +5,3 @@ | @@ -5,5 +5,3 @@ | ||
| 5 | \ \ \|\__\_\ \ \ / / \ \ \___\|____________|\ \ \___|\ \ \\ \\ \ \\\ \ | 5 | \ \ \|\__\_\ \ \ / / \ \ \___\|____________|\ \ \___|\ \ \\ \\ \ \\\ \ |
| 6 | \ \____________\ \__/ / \ \__\ \ \__\ \ \__\\ _\\ \_______\ | 6 | \ \____________\ \__/ / \ \__\ \ \__\ \ \__\\ _\\ \_______\ |
| 7 | \|____________|\|__|/ \|__| \|__| \|__|\|__|\|_______| | 7 | \|____________|\|__|/ \|__| \|__| \|__|\|__|\|_______| |
| 8 | - | ||
| 9 | -版本:${version.version} | ||
| 10 | \ No newline at end of file | 8 | \ No newline at end of file |
web_src/src/components/channelList.vue
| @@ -250,6 +250,7 @@ export default { | @@ -250,6 +250,7 @@ export default { | ||
| 250 | that.loadSnap[deviceId + channelId] = 0; | 250 | that.loadSnap[deviceId + channelId] = 0; |
| 251 | that.getSnapErrorEvent(snapId) | 251 | that.getSnapErrorEvent(snapId) |
| 252 | }, 5000) | 252 | }, 5000) |
| 253 | + itemData.streamId = res.data.data.stream; | ||
| 253 | that.$refs.devicePlayer.openDialog("media", deviceId, channelId, { | 254 | that.$refs.devicePlayer.openDialog("media", deviceId, channelId, { |
| 254 | streamInfo: res.data.data, | 255 | streamInfo: res.data.data, |
| 255 | hasAudio: itemData.hasAudio | 256 | hasAudio: itemData.hasAudio |