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 | 263 | </configuration> |
| 264 | 264 | </plugin> |
| 265 | 265 | |
| 266 | - <!-- <plugin> | |
| 266 | + <plugin> | |
| 267 | 267 | <groupId>pl.project13.maven</groupId> |
| 268 | 268 | <artifactId>git-commit-id-plugin</artifactId> |
| 269 | 269 | <version>3.0.1</version> |
| 270 | 270 | <configuration> |
| 271 | 271 | <offline>true</offline> |
| 272 | + <failOnNoGitDirectory>false</failOnNoGitDirectory> | |
| 273 | + <dateFormat>yyyyMMdd</dateFormat> | |
| 272 | 274 | </configuration> |
| 273 | - </plugin>--> | |
| 275 | + </plugin> | |
| 274 | 276 | |
| 275 | 277 | <plugin> |
| 276 | 278 | <groupId>org.apache.maven.plugins</groupId> | ... | ... |
sql/mysql.sql
| 1 | 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 | 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 | 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 | 19 | -- Table structure for table `device` |
| 20 | 20 | -- |
| 21 | 21 | |
| 22 | 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 | 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 | 54 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 60 | 55 | |
| 61 | 56 | -- |
| ... | ... | @@ -63,10 +58,8 @@ CREATE TABLE `device` |
| 63 | 58 | -- |
| 64 | 59 | |
| 65 | 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 | 63 | UNLOCK TABLES; |
| 71 | 64 | |
| 72 | 65 | -- |
| ... | ... | @@ -74,26 +67,22 @@ UNLOCK TABLES; |
| 74 | 67 | -- |
| 75 | 68 | |
| 76 | 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 | 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 | 86 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 98 | 87 | |
| 99 | 88 | -- |
| ... | ... | @@ -101,10 +90,8 @@ CREATE TABLE `device_alarm` |
| 101 | 90 | -- |
| 102 | 91 | |
| 103 | 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 | 95 | UNLOCK TABLES; |
| 109 | 96 | |
| 110 | 97 | -- |
| ... | ... | @@ -112,55 +99,50 @@ UNLOCK TABLES; |
| 112 | 99 | -- |
| 113 | 100 | |
| 114 | 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 | 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 | 146 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 165 | 147 | |
| 166 | 148 | -- |
| ... | ... | @@ -168,10 +150,8 @@ CREATE TABLE `device_channel` |
| 168 | 150 | -- |
| 169 | 151 | |
| 170 | 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 | 155 | UNLOCK TABLES; |
| 176 | 156 | |
| 177 | 157 | -- |
| ... | ... | @@ -179,32 +159,27 @@ UNLOCK TABLES; |
| 179 | 159 | -- |
| 180 | 160 | |
| 181 | 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 | 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 | 183 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 209 | 184 | |
| 210 | 185 | -- |
| ... | ... | @@ -212,10 +187,8 @@ CREATE TABLE `device_mobile_position` |
| 212 | 187 | -- |
| 213 | 188 | |
| 214 | 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 | 192 | UNLOCK TABLES; |
| 220 | 193 | |
| 221 | 194 | -- |
| ... | ... | @@ -223,29 +196,23 @@ UNLOCK TABLES; |
| 223 | 196 | -- |
| 224 | 197 | |
| 225 | 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 | 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 | 216 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 250 | 217 | |
| 251 | 218 | -- |
| ... | ... | @@ -253,10 +220,8 @@ CREATE TABLE `gb_stream` |
| 253 | 220 | -- |
| 254 | 221 | |
| 255 | 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 | 225 | UNLOCK TABLES; |
| 261 | 226 | |
| 262 | 227 | -- |
| ... | ... | @@ -264,25 +229,20 @@ UNLOCK TABLES; |
| 264 | 229 | -- |
| 265 | 230 | |
| 266 | 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 | 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 | 246 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 287 | 247 | |
| 288 | 248 | -- |
| ... | ... | @@ -290,10 +250,8 @@ CREATE TABLE `log` |
| 290 | 250 | -- |
| 291 | 251 | |
| 292 | 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 | 255 | UNLOCK TABLES; |
| 298 | 256 | |
| 299 | 257 | -- |
| ... | ... | @@ -301,39 +259,35 @@ UNLOCK TABLES; |
| 301 | 259 | -- |
| 302 | 260 | |
| 303 | 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 | 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 | 291 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 338 | 292 | |
| 339 | 293 | -- |
| ... | ... | @@ -341,10 +295,8 @@ CREATE TABLE `media_server` |
| 341 | 295 | -- |
| 342 | 296 | |
| 343 | 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 | 300 | UNLOCK TABLES; |
| 349 | 301 | |
| 350 | 302 | -- |
| ... | ... | @@ -352,44 +304,39 @@ UNLOCK TABLES; |
| 352 | 304 | -- |
| 353 | 305 | |
| 354 | 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 | 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 | 340 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 394 | 341 | |
| 395 | 342 | -- |
| ... | ... | @@ -397,10 +344,8 @@ CREATE TABLE `parent_platform` |
| 397 | 344 | -- |
| 398 | 345 | |
| 399 | 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 | 349 | UNLOCK TABLES; |
| 405 | 350 | |
| 406 | 351 | -- |
| ... | ... | @@ -408,21 +353,17 @@ UNLOCK TABLES; |
| 408 | 353 | -- |
| 409 | 354 | |
| 410 | 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 | 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 | 367 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 427 | 368 | |
| 428 | 369 | -- |
| ... | ... | @@ -430,10 +371,8 @@ CREATE TABLE `platform_catalog` |
| 430 | 371 | -- |
| 431 | 372 | |
| 432 | 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 | 376 | UNLOCK TABLES; |
| 438 | 377 | |
| 439 | 378 | -- |
| ... | ... | @@ -441,20 +380,15 @@ UNLOCK TABLES; |
| 441 | 380 | -- |
| 442 | 381 | |
| 443 | 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 | 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 | 392 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 459 | 393 | |
| 460 | 394 | -- |
| ... | ... | @@ -462,10 +396,8 @@ CREATE TABLE `platform_gb_channel` |
| 462 | 396 | -- |
| 463 | 397 | |
| 464 | 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 | 401 | UNLOCK TABLES; |
| 470 | 402 | |
| 471 | 403 | -- |
| ... | ... | @@ -473,21 +405,16 @@ UNLOCK TABLES; |
| 473 | 405 | -- |
| 474 | 406 | |
| 475 | 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 | 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 | 418 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 492 | 419 | |
| 493 | 420 | -- |
| ... | ... | @@ -495,10 +422,8 @@ CREATE TABLE `platform_gb_stream` |
| 495 | 422 | -- |
| 496 | 423 | |
| 497 | 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 | 427 | UNLOCK TABLES; |
| 503 | 428 | |
| 504 | 429 | -- |
| ... | ... | @@ -506,36 +431,31 @@ UNLOCK TABLES; |
| 506 | 431 | -- |
| 507 | 432 | |
| 508 | 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 | 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 | 459 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 540 | 460 | |
| 541 | 461 | -- |
| ... | ... | @@ -543,10 +463,8 @@ CREATE TABLE `stream_proxy` |
| 543 | 463 | -- |
| 544 | 464 | |
| 545 | 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 | 468 | UNLOCK TABLES; |
| 551 | 469 | |
| 552 | 470 | -- |
| ... | ... | @@ -554,32 +472,27 @@ UNLOCK TABLES; |
| 554 | 472 | -- |
| 555 | 473 | |
| 556 | 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 | 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 | 496 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 584 | 497 | |
| 585 | 498 | -- |
| ... | ... | @@ -587,10 +500,8 @@ CREATE TABLE `stream_push` |
| 587 | 500 | -- |
| 588 | 501 | |
| 589 | 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 | 505 | UNLOCK TABLES; |
| 595 | 506 | |
| 596 | 507 | -- |
| ... | ... | @@ -598,24 +509,19 @@ UNLOCK TABLES; |
| 598 | 509 | -- |
| 599 | 510 | |
| 600 | 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 | 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 | 525 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 620 | 526 | |
| 621 | 527 | -- |
| ... | ... | @@ -623,13 +529,9 @@ CREATE TABLE `user` |
| 623 | 529 | -- |
| 624 | 530 | |
| 625 | 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 | 535 | UNLOCK TABLES; |
| 634 | 536 | |
| 635 | 537 | -- |
| ... | ... | @@ -637,21 +539,16 @@ UNLOCK TABLES; |
| 637 | 539 | -- |
| 638 | 540 | |
| 639 | 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 | 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 | 552 | /*!40101 SET character_set_client = @saved_cs_client */; |
| 656 | 553 | |
| 657 | 554 | -- |
| ... | ... | @@ -659,21 +556,18 @@ CREATE TABLE `user_role` |
| 659 | 556 | -- |
| 660 | 557 | |
| 661 | 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 | 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 | 3 | import java.util.logging.LogManager; |
| 4 | 4 | |
| 5 | 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 | 12 | import org.springframework.boot.SpringApplication; |
| 7 | 13 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 8 | 14 | import org.springframework.boot.web.servlet.ServletComponentScan; |
| ... | ... | @@ -17,11 +23,18 @@ import org.springframework.scheduling.annotation.EnableScheduling; |
| 17 | 23 | @EnableScheduling |
| 18 | 24 | @EnableDruidSupport |
| 19 | 25 | public class VManageBootstrap extends LogManager { |
| 26 | + | |
| 27 | + private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class); | |
| 28 | + | |
| 20 | 29 | private static String[] args; |
| 21 | 30 | private static ConfigurableApplicationContext context; |
| 22 | 31 | public static void main(String[] args) { |
| 23 | 32 | VManageBootstrap.args = args; |
| 24 | 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 | 40 | public static void restart() { | ... | ... |
src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
| ... | ... | @@ -99,6 +99,12 @@ public class VideoManagerConstants { |
| 99 | 99 | */ |
| 100 | 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 | 109 | * redis 消息请求所有的在线通道 |
| 104 | 110 | */ | ... | ... |
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java
| ... | ... | @@ -46,17 +46,12 @@ public class SipPlatformRunner implements CommandLineRunner { |
| 46 | 46 | parentPlatformCatch.setParentPlatform(parentPlatform); |
| 47 | 47 | parentPlatformCatch.setId(parentPlatform.getServerGBId()); |
| 48 | 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 | 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 | 12 | import org.springframework.data.redis.core.RedisTemplate; |
| 13 | 13 | import org.springframework.data.redis.listener.PatternTopic; |
| 14 | 14 | import org.springframework.data.redis.listener.RedisMessageListenerContainer; |
| 15 | -import org.springframework.data.redis.serializer.RedisSerializer; | |
| 16 | 15 | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| 17 | 16 | |
| 18 | 17 | import com.genersoft.iot.vmp.utils.redis.FastJsonRedisSerializer; |
| ... | ... | @@ -43,7 +42,10 @@ public class RedisConfig extends CachingConfigurerSupport { |
| 43 | 42 | private RedisPushStreamStatusMsgListener redisPushStreamStatusMsgListener; |
| 44 | 43 | |
| 45 | 44 | @Autowired |
| 46 | - private RedisPushStreamListMsgListener redisPushStreamListMsgListener; | |
| 45 | + private RedisPushStreamStatusListMsgListener redisPushStreamListMsgListener; | |
| 46 | + | |
| 47 | + @Autowired | |
| 48 | + private RedisPushStreamResponseListener redisPushStreamResponseListener; | |
| 47 | 49 | |
| 48 | 50 | @Bean |
| 49 | 51 | public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
| ... | ... | @@ -81,7 +83,7 @@ public class RedisConfig extends CachingConfigurerSupport { |
| 81 | 83 | container.addMessageListener(redisGbPlayMsgListener, new PatternTopic(RedisGbPlayMsgListener.WVP_PUSH_STREAM_KEY)); |
| 82 | 84 | container.addMessageListener(redisPushStreamStatusMsgListener, new PatternTopic(VideoManagerConstants.VM_MSG_PUSH_STREAM_STATUS_CHANGE)); |
| 83 | 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 | 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 | 49 | * gov/nist/javax/sip/SipStackImpl.class |
| 50 | 50 | * sip消息的解析在 gov.nist.javax.sip.stack.UDPMessageChannel的processIncomingDataPacket方法 |
| 51 | 51 | */ |
| 52 | + | |
| 52 | 53 | // * gov/nist/javax/sip/SipStackImpl.class |
| 53 | 54 | if (logger.isDebugEnabled()) { |
| 54 | 55 | properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "false"); |
| ... | ... | @@ -63,6 +64,8 @@ public class SipLayer{ |
| 63 | 64 | properties.setProperty("gov.nist.javax.sip.RELEASE_REFERENCES_STRATEGY", "Normal"); |
| 64 | 65 | // 处理由该服务器处理的基于底层TCP的保持生存超时 |
| 65 | 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 | 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 | 132 | if (event.getGbStreams() != null && event.getGbStreams().size() > 0){ |
| 133 | 133 | for (GbStream gbStream : event.getGbStreams()) { |
| 134 | 134 | deviceChannelList.add( |
| 135 | - gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), parentPlatform)); | |
| 135 | + gbStreamService.getDeviceChannelListByStreamWithStatus(gbStream, gbStream.getCatalogId(), parentPlatform)); | |
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | if (deviceChannelList.size() > 0) { |
| ... | ... | @@ -154,7 +154,7 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { |
| 154 | 154 | deviceChannelList.add(deviceChannel); |
| 155 | 155 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); |
| 156 | 156 | if(gbStream != null){ |
| 157 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform); | |
| 157 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStreamWithStatus(gbStream, gbStream.getCatalogId(), platform); | |
| 158 | 158 | deviceChannelList.add(deviceChannelByStream); |
| 159 | 159 | } |
| 160 | 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 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 4 | 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 | 6 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 7 | +import com.genersoft.iot.vmp.utils.GitUtil; | |
| 8 | 8 | import gov.nist.javax.sip.message.MessageFactoryImpl; |
| 9 | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 10 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -36,45 +36,10 @@ public class SIPRequestHeaderPlarformProvider { |
| 36 | 36 | private SipFactory sipFactory; |
| 37 | 37 | |
| 38 | 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 | 44 | public Request createRegisterRequest(@NotNull ParentPlatform platform, long CSeq, String fromTag, String viaTag, CallIdHeader callIdHeader, boolean isRegister) throws ParseException, InvalidArgumentException, PeerUnavailableException { |
| 80 | 45 | Request request = null; |
| ... | ... | @@ -88,16 +53,14 @@ public class SIPRequestHeaderPlarformProvider { |
| 88 | 53 | viaHeader.setRPort(); |
| 89 | 54 | viaHeaders.add(viaHeader); |
| 90 | 55 | //from |
| 91 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(),sipAddress); | |
| 56 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(), sipConfig.getDomain()); | |
| 92 | 57 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 93 | 58 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 94 | 59 | //to |
| 95 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(),sipAddress); | |
| 60 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(platform.getDeviceGBId(), sipConfig.getDomain()); | |
| 96 | 61 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 97 | 62 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 98 | 63 | |
| 99 | - | |
| 100 | - | |
| 101 | 64 | //Forwards |
| 102 | 65 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 103 | 66 | |
| ... | ... | @@ -113,8 +76,7 @@ public class SIPRequestHeaderPlarformProvider { |
| 113 | 76 | ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(isRegister ? platform.getExpires() : 0); |
| 114 | 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 | 81 | return request; |
| 120 | 82 | } |
| ... | ... | @@ -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 | 159 | Request request = null; |
| 160 | + String serverAddress = parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort(); | |
| 198 | 161 | // sipuri |
| 199 | - SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerIP()+ ":" + parentPlatform.getServerPort()); | |
| 162 | + SipURI requestURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress); | |
| 200 | 163 | // via |
| 201 | 164 | ArrayList<ViaHeader> viaHeaders = new ArrayList<ViaHeader>(); |
| 202 | 165 | ViaHeader viaHeader = sipFactory.createHeaderFactory().createViaHeader(parentPlatform.getDeviceIp(), Integer.parseInt(parentPlatform.getDevicePort()), |
| 203 | - parentPlatform.getTransport(), null); | |
| 166 | + parentPlatform.getTransport(), viaTag); | |
| 204 | 167 | viaHeader.setRPort(); |
| 205 | 168 | viaHeaders.add(viaHeader); |
| 206 | 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 | 172 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 210 | 173 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 211 | 174 | // to |
| 212 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), parentPlatform.getServerGBDomain()); | |
| 175 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(parentPlatform.getServerGBId(), serverAddress); | |
| 213 | 176 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 214 | 177 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, null); |
| 215 | 178 | |
| ... | ... | @@ -223,6 +186,8 @@ public class SIPRequestHeaderPlarformProvider { |
| 223 | 186 | request = messageFactory.createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
| 224 | 187 | toHeader, viaHeaders, maxForwards); |
| 225 | 188 | |
| 189 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | |
| 190 | + | |
| 226 | 191 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 227 | 192 | request.setContent(content, contentTypeHeader); |
| 228 | 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 | 2 | |
| 3 | 3 | import java.text.ParseException; |
| 4 | 4 | import java.util.ArrayList; |
| 5 | -import java.util.List; | |
| 6 | 5 | |
| 7 | 6 | import javax.sip.*; |
| 8 | 7 | import javax.sip.address.Address; |
| ... | ... | @@ -12,8 +11,9 @@ import javax.sip.message.Request; |
| 12 | 11 | |
| 13 | 12 | import com.genersoft.iot.vmp.common.StreamInfo; |
| 14 | 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 | 15 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 16 | +import com.genersoft.iot.vmp.utils.GitUtil; | |
| 17 | 17 | import gov.nist.javax.sip.SipProviderImpl; |
| 18 | 18 | import gov.nist.javax.sip.SipStackImpl; |
| 19 | 19 | import gov.nist.javax.sip.stack.SIPDialog; |
| ... | ... | @@ -39,6 +39,9 @@ public class SIPRequestHeaderProvider { |
| 39 | 39 | private SipFactory sipFactory; |
| 40 | 40 | |
| 41 | 41 | @Autowired |
| 42 | + private GitUtil gitUtil; | |
| 43 | + | |
| 44 | + @Autowired | |
| 42 | 45 | private IRedisCatchStorage redisCatchStorage; |
| 43 | 46 | |
| 44 | 47 | @Autowired |
| ... | ... | @@ -62,22 +65,24 @@ public class SIPRequestHeaderProvider { |
| 62 | 65 | viaHeader.setRPort(); |
| 63 | 66 | viaHeaders.add(viaHeader); |
| 64 | 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 | 69 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 68 | 70 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 69 | 71 | // to |
| 70 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), sipConfig.getDomain()); | |
| 72 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), device.getHostAddress()); | |
| 71 | 73 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 72 | 74 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); |
| 73 | 75 | |
| 74 | 76 | // Forwards |
| 75 | 77 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 76 | 78 | // ceq |
| 77 | - CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.MESSAGE); | |
| 79 | + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.MESSAGE); | |
| 78 | 80 | |
| 79 | 81 | request = sipFactory.createMessageFactory().createRequest(requestURI, Request.MESSAGE, callIdHeader, cSeqHeader, fromHeader, |
| 80 | 82 | toHeader, viaHeaders, maxForwards); |
| 83 | + | |
| 84 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | |
| 85 | + | |
| 81 | 86 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 82 | 87 | request.setContent(content, contentTypeHeader); |
| 83 | 88 | return request; |
| ... | ... | @@ -94,11 +99,11 @@ public class SIPRequestHeaderProvider { |
| 94 | 99 | viaHeaders.add(viaHeader); |
| 95 | 100 | |
| 96 | 101 | //from |
| 97 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(),sipConfig.getDomain()); | |
| 102 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); | |
| 98 | 103 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 99 | 104 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 100 | 105 | //to |
| 101 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,sipConfig.getDomain()); | |
| 106 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress()); | |
| 102 | 107 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 103 | 108 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 104 | 109 | |
| ... | ... | @@ -108,7 +113,9 @@ public class SIPRequestHeaderProvider { |
| 108 | 113 | //ceq |
| 109 | 114 | CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.INVITE); |
| 110 | 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 | 119 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 113 | 120 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); |
| 114 | 121 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| ... | ... | @@ -130,11 +137,11 @@ public class SIPRequestHeaderProvider { |
| 130 | 137 | viaHeader.setRPort(); |
| 131 | 138 | viaHeaders.add(viaHeader); |
| 132 | 139 | //from |
| 133 | - SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(),sipConfig.getDomain()); | |
| 140 | + SipURI fromSipURI = sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getDomain()); | |
| 134 | 141 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 135 | 142 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 136 | 143 | //to |
| 137 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, sipConfig.getDomain()); | |
| 144 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId, device.getHostAddress()); | |
| 138 | 145 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 139 | 146 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,null); |
| 140 | 147 | |
| ... | ... | @@ -148,6 +155,9 @@ public class SIPRequestHeaderProvider { |
| 148 | 155 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 149 | 156 | // Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), device.getHost().getIp()+":"+device.getHost().getPort())); |
| 150 | 157 | request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| 158 | + | |
| 159 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | |
| 160 | + | |
| 151 | 161 | // Subject |
| 152 | 162 | SubjectHeader subjectHeader = sipFactory.createHeaderFactory().createSubjectHeader(String.format("%s:%s,%s:%s", channelId, ssrc, sipConfig.getId(), 0)); |
| 153 | 163 | request.addHeader(subjectHeader); |
| ... | ... | @@ -170,7 +180,7 @@ public class SIPRequestHeaderProvider { |
| 170 | 180 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 171 | 181 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); //必须要有标记,否则无法创建会话,无法回应ack |
| 172 | 182 | //to |
| 173 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,sipConfig.getDomain()); | |
| 183 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(channelId,device.getHostAddress()); | |
| 174 | 184 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 175 | 185 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress,toTag); |
| 176 | 186 | |
| ... | ... | @@ -178,10 +188,12 @@ public class SIPRequestHeaderProvider { |
| 178 | 188 | MaxForwardsHeader maxForwards = sipFactory.createHeaderFactory().createMaxForwardsHeader(70); |
| 179 | 189 | |
| 180 | 190 | //ceq |
| 181 | - CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(1L, Request.BYE); | |
| 191 | + CSeqHeader cSeqHeader = sipFactory.createHeaderFactory().createCSeqHeader(redisCatchStorage.getCSEQ(), Request.BYE); | |
| 182 | 192 | CallIdHeader callIdHeader = sipFactory.createHeaderFactory().createCallIdHeader(callId); |
| 183 | 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 | 197 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 186 | 198 | |
| 187 | 199 | return request; |
| ... | ... | @@ -198,12 +210,11 @@ public class SIPRequestHeaderProvider { |
| 198 | 210 | viaHeader.setRPort(); |
| 199 | 211 | viaHeaders.add(viaHeader); |
| 200 | 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 | 214 | Address fromAddress = sipFactory.createAddressFactory().createAddress(fromSipURI); |
| 204 | 215 | FromHeader fromHeader = sipFactory.createHeaderFactory().createFromHeader(fromAddress, fromTag); |
| 205 | 216 | // to |
| 206 | - SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), sipConfig.getDomain()); | |
| 217 | + SipURI toSipURI = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), device.getHostAddress()); | |
| 207 | 218 | Address toAddress = sipFactory.createAddressFactory().createAddress(toSipURI); |
| 208 | 219 | ToHeader toHeader = sipFactory.createHeaderFactory().createToHeader(toAddress, toTag); |
| 209 | 220 | |
| ... | ... | @@ -233,6 +244,9 @@ public class SIPRequestHeaderProvider { |
| 233 | 244 | |
| 234 | 245 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 235 | 246 | request.setContent(content, contentTypeHeader); |
| 247 | + | |
| 248 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | |
| 249 | + | |
| 236 | 250 | return request; |
| 237 | 251 | } |
| 238 | 252 | |
| ... | ... | @@ -267,8 +281,7 @@ public class SIPRequestHeaderProvider { |
| 267 | 281 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory() |
| 268 | 282 | .createSipURI(sipConfig.getId(), sipConfig.getIp() + ":" + sipConfig.getPort())); |
| 269 | 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 | 286 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", |
| 274 | 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 | 10 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 11 | 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 12 | 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 | 14 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 15 | 15 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| 16 | 16 | import com.genersoft.iot.vmp.utils.DateUtil; |
| ... | ... | @@ -21,6 +21,7 @@ import com.genersoft.iot.vmp.service.IMediaServerService; |
| 21 | 21 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 22 | 22 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 23 | 23 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 24 | +import com.genersoft.iot.vmp.utils.GitUtil; | |
| 24 | 25 | import gov.nist.javax.sip.SipProviderImpl; |
| 25 | 26 | import gov.nist.javax.sip.SipStackImpl; |
| 26 | 27 | import gov.nist.javax.sip.message.MessageFactoryImpl; |
| ... | ... | @@ -63,6 +64,9 @@ public class SIPCommander implements ISIPCommander { |
| 63 | 64 | private SipFactory sipFactory; |
| 64 | 65 | |
| 65 | 66 | @Autowired |
| 67 | + private GitUtil gitUtil; | |
| 68 | + | |
| 69 | + @Autowired | |
| 66 | 70 | @Qualifier(value="tcpSipProvider") |
| 67 | 71 | private SipProviderImpl tcpSipProvider; |
| 68 | 72 | |
| ... | ... | @@ -246,13 +250,11 @@ public class SIPCommander implements ISIPCommander { |
| 246 | 250 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 247 | 251 | ptzXml.append("</Info>\r\n"); |
| 248 | 252 | ptzXml.append("</Control>\r\n"); |
| 249 | - | |
| 250 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 251 | 253 | |
| 252 | 254 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 253 | 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 | 259 | transmitRequest(device, request); |
| 258 | 260 | return true; |
| ... | ... | @@ -289,13 +291,12 @@ public class SIPCommander implements ISIPCommander { |
| 289 | 291 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 290 | 292 | ptzXml.append("</Info>\r\n"); |
| 291 | 293 | ptzXml.append("</Control>\r\n"); |
| 292 | - | |
| 293 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 294 | + | |
| 294 | 295 | |
| 295 | 296 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 296 | 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 | 300 | transmitRequest(device, request); |
| 300 | 301 | return true; |
| 301 | 302 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -325,13 +326,12 @@ public class SIPCommander implements ISIPCommander { |
| 325 | 326 | ptzXml.append("<ControlPriority>5</ControlPriority>\r\n"); |
| 326 | 327 | ptzXml.append("</Info>\r\n"); |
| 327 | 328 | ptzXml.append("</Control>\r\n"); |
| 328 | - | |
| 329 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 329 | + | |
| 330 | 330 | |
| 331 | 331 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 332 | 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 | 335 | transmitRequest(device, request, errorEvent, okEvent); |
| 336 | 336 | return true; |
| 337 | 337 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -423,12 +423,10 @@ public class SIPCommander implements ISIPCommander { |
| 423 | 423 | // f字段:f= v/编码格式/分辨率/帧率/码率类型/码率大小a/编码格式/码率大小/采样率 |
| 424 | 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 | 426 | CallIdHeader callIdHeader = device.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 429 | 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 | 431 | transmitRequest(device, request, (e -> { |
| 434 | 432 | streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| ... | ... | @@ -521,8 +519,6 @@ public class SIPCommander implements ISIPCommander { |
| 521 | 519 | } |
| 522 | 520 | |
| 523 | 521 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc |
| 524 | - | |
| 525 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 526 | 522 | |
| 527 | 523 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 528 | 524 | : udpSipProvider.getNewCallId(); |
| ... | ... | @@ -535,7 +531,7 @@ public class SIPCommander implements ISIPCommander { |
| 535 | 531 | } |
| 536 | 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 | 536 | transmitRequest(device, request, errorEvent, event -> { |
| 541 | 537 | ResponseEvent responseEvent = (ResponseEvent) event.event; |
| ... | ... | @@ -627,8 +623,6 @@ public class SIPCommander implements ISIPCommander { |
| 627 | 623 | content.append("a=downloadspeed:" + downloadSpeed + "\r\n"); |
| 628 | 624 | |
| 629 | 625 | content.append("y=" + ssrcInfo.getSsrc() + "\r\n");//ssrc |
| 630 | - | |
| 631 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 632 | 626 | |
| 633 | 627 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 634 | 628 | : udpSipProvider.getNewCallId(); |
| ... | ... | @@ -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 | 649 | if (inviteStreamCallback != null) { |
| 656 | 650 | inviteStreamCallback.call(new InviteStreamInfo(mediaServerItem, null, callIdHeader.getCallId(), "rtp", ssrcInfo.getStream())); |
| 657 | 651 | } |
| ... | ... | @@ -734,7 +728,7 @@ public class SIPCommander implements ISIPCommander { |
| 734 | 728 | dialog = streamSession.getDialogByStream(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); |
| 735 | 729 | } |
| 736 | 730 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); |
| 737 | - mediaServerService.closeRTPServer(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | |
| 731 | + mediaServerService.closeRTPServer(ssrcTransaction.getMediaServerId(), ssrcTransaction.getStream()); | |
| 738 | 732 | streamSession.remove(ssrcTransaction.getDeviceId(), ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); |
| 739 | 733 | |
| 740 | 734 | if (dialog == null) { |
| ... | ... | @@ -771,7 +765,7 @@ public class SIPCommander implements ISIPCommander { |
| 771 | 765 | // 增加Contact header |
| 772 | 766 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 773 | 767 | byeRequest.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); |
| 774 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | |
| 768 | + UserAgentHeader userAgentHeader = SipUtils.createUserAgentHeader(sipFactory, gitUtil); | |
| 775 | 769 | byeRequest.addHeader(userAgentHeader); |
| 776 | 770 | ClientTransaction clientTransaction = null; |
| 777 | 771 | if("TCP".equals(protocol)) { |
| ... | ... | @@ -812,20 +806,41 @@ public class SIPCommander implements ISIPCommander { |
| 812 | 806 | broadcastXml.append("<SourceID>" + sipConfig.getId() + "</SourceID>\r\n"); |
| 813 | 807 | broadcastXml.append("<TargetID>" + channelId + "</TargetID>\r\n"); |
| 814 | 808 | broadcastXml.append("</Notify>\r\n"); |
| 815 | - | |
| 816 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 817 | - | |
| 809 | + | |
| 818 | 810 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 819 | 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 | 815 | return true; |
| 824 | 816 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| 825 | 817 | e.printStackTrace(); |
| 826 | 818 | } |
| 827 | 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 | 865 | } |
| 851 | 866 | cmdXml.append("<RecordCmd>" + recordCmdStr + "</RecordCmd>\r\n"); |
| 852 | 867 | cmdXml.append("</Control>\r\n"); |
| 853 | - | |
| 854 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 855 | 868 | |
| 856 | 869 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 857 | 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 | 873 | transmitRequest(device, request, errorEvent); |
| 861 | 874 | return true; |
| 862 | 875 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -882,13 +895,11 @@ public class SIPCommander implements ISIPCommander { |
| 882 | 895 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 883 | 896 | cmdXml.append("<TeleBoot>Boot</TeleBoot>\r\n"); |
| 884 | 897 | cmdXml.append("</Control>\r\n"); |
| 885 | - | |
| 886 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 887 | 898 | |
| 888 | 899 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 889 | 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 | 903 | transmitRequest(device, request); |
| 893 | 904 | return true; |
| 894 | 905 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -915,13 +926,11 @@ public class SIPCommander implements ISIPCommander { |
| 915 | 926 | cmdXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 916 | 927 | cmdXml.append("<GuardCmd>" + guardCmdStr + "</GuardCmd>\r\n"); |
| 917 | 928 | cmdXml.append("</Control>\r\n"); |
| 918 | - | |
| 919 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 920 | 929 | |
| 921 | 930 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 922 | 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 | 934 | transmitRequest(device, request, errorEvent); |
| 926 | 935 | return true; |
| 927 | 936 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -959,13 +968,11 @@ public class SIPCommander implements ISIPCommander { |
| 959 | 968 | cmdXml.append("</Info>\r\n"); |
| 960 | 969 | } |
| 961 | 970 | cmdXml.append("</Control>\r\n"); |
| 962 | - | |
| 963 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 964 | 971 | |
| 965 | 972 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 966 | 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 | 976 | transmitRequest(device, request, errorEvent); |
| 970 | 977 | return true; |
| 971 | 978 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -996,13 +1003,11 @@ public class SIPCommander implements ISIPCommander { |
| 996 | 1003 | } |
| 997 | 1004 | cmdXml.append("<IFameCmd>Send</IFameCmd>\r\n"); |
| 998 | 1005 | cmdXml.append("</Control>\r\n"); |
| 999 | - | |
| 1000 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1001 | 1006 | |
| 1002 | 1007 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1003 | 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 | 1011 | transmitRequest(device, request); |
| 1007 | 1012 | return true; |
| 1008 | 1013 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1051,13 +1056,11 @@ public class SIPCommander implements ISIPCommander { |
| 1051 | 1056 | } |
| 1052 | 1057 | cmdXml.append("</HomePosition>\r\n"); |
| 1053 | 1058 | cmdXml.append("</Control>\r\n"); |
| 1054 | - | |
| 1055 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1056 | 1059 | |
| 1057 | 1060 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1058 | 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 | 1064 | transmitRequest(device, request, errorEvent); |
| 1062 | 1065 | return true; |
| 1063 | 1066 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1123,13 +1126,11 @@ public class SIPCommander implements ISIPCommander { |
| 1123 | 1126 | } |
| 1124 | 1127 | cmdXml.append("</BasicParam>\r\n"); |
| 1125 | 1128 | cmdXml.append("</Control>\r\n"); |
| 1126 | - | |
| 1127 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1128 | 1129 | |
| 1129 | 1130 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1130 | 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 | 1134 | transmitRequest(device, request, errorEvent); |
| 1134 | 1135 | return true; |
| 1135 | 1136 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1154,13 +1155,11 @@ public class SIPCommander implements ISIPCommander { |
| 1154 | 1155 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); |
| 1155 | 1156 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1156 | 1157 | catalogXml.append("</Query>\r\n"); |
| 1157 | - | |
| 1158 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1159 | 1158 | |
| 1160 | 1159 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1161 | 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 | 1164 | transmitRequest(device, request, errorEvent); |
| 1166 | 1165 | return true; |
| ... | ... | @@ -1187,13 +1186,11 @@ public class SIPCommander implements ISIPCommander { |
| 1187 | 1186 | catalogXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n"); |
| 1188 | 1187 | catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1189 | 1188 | catalogXml.append("</Query>\r\n"); |
| 1190 | - | |
| 1191 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1192 | 1189 | |
| 1193 | 1190 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1194 | 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 | 1195 | transmitRequest(device, request); |
| 1199 | 1196 | |
| ... | ... | @@ -1216,17 +1213,15 @@ public class SIPCommander implements ISIPCommander { |
| 1216 | 1213 | String charset = device.getCharset(); |
| 1217 | 1214 | catalogXml.append("<?xml version=\"1.0\" encoding=\"" + charset + "\"?>\r\n"); |
| 1218 | 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 | 1219 | catalogXml.append("</Query>\r\n"); |
| 1223 | - | |
| 1224 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1225 | 1220 | |
| 1226 | 1221 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1227 | 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 | 1226 | transmitRequest(device, request, errorEvent); |
| 1232 | 1227 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1273,14 +1268,12 @@ public class SIPCommander implements ISIPCommander { |
| 1273 | 1268 | recordInfoXml.append("<Type>" + type+"</Type>\r\n"); |
| 1274 | 1269 | } |
| 1275 | 1270 | recordInfoXml.append("</Query>\r\n"); |
| 1276 | - | |
| 1277 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1278 | 1271 | |
| 1279 | 1272 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1280 | 1273 | : udpSipProvider.getNewCallId(); |
| 1281 | 1274 | |
| 1282 | 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 | 1278 | transmitRequest(device, request, errorEvent, okEvent); |
| 1286 | 1279 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1332,13 +1325,11 @@ public class SIPCommander implements ISIPCommander { |
| 1332 | 1325 | cmdXml.append("<EndAlarmTime>" + endTime + "</EndAlarmTime>\r\n"); |
| 1333 | 1326 | } |
| 1334 | 1327 | cmdXml.append("</Query>\r\n"); |
| 1335 | - | |
| 1336 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1337 | 1328 | |
| 1338 | 1329 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1339 | 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 | 1333 | transmitRequest(device, request, errorEvent); |
| 1343 | 1334 | return true; |
| 1344 | 1335 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1370,13 +1361,11 @@ public class SIPCommander implements ISIPCommander { |
| 1370 | 1361 | } |
| 1371 | 1362 | cmdXml.append("<ConfigType>" + configType + "</ConfigType>\r\n"); |
| 1372 | 1363 | cmdXml.append("</Query>\r\n"); |
| 1373 | - | |
| 1374 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1375 | 1364 | |
| 1376 | 1365 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1377 | 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 | 1369 | transmitRequest(device, request, errorEvent); |
| 1381 | 1370 | return true; |
| 1382 | 1371 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1405,13 +1394,11 @@ public class SIPCommander implements ISIPCommander { |
| 1405 | 1394 | cmdXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n"); |
| 1406 | 1395 | } |
| 1407 | 1396 | cmdXml.append("</Query>\r\n"); |
| 1408 | - | |
| 1409 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1410 | 1397 | |
| 1411 | 1398 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1412 | 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 | 1402 | transmitRequest(device, request, errorEvent); |
| 1416 | 1403 | return true; |
| 1417 | 1404 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -1437,13 +1424,11 @@ public class SIPCommander implements ISIPCommander { |
| 1437 | 1424 | mobilePostitionXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); |
| 1438 | 1425 | mobilePostitionXml.append("<Interval>60</Interval>\r\n"); |
| 1439 | 1426 | mobilePostitionXml.append("</Query>\r\n"); |
| 1440 | - | |
| 1441 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1442 | 1427 | |
| 1443 | 1428 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1444 | 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 | 1433 | transmitRequest(device, request, errorEvent); |
| 1449 | 1434 | |
| ... | ... | @@ -1492,10 +1477,9 @@ public class SIPCommander implements ISIPCommander { |
| 1492 | 1477 | request.removeHeader(CSeqHeader.NAME); |
| 1493 | 1478 | request.addHeader(cSeqHeader); |
| 1494 | 1479 | }else { |
| 1495 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1496 | 1480 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1497 | 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 | 1484 | transmitRequest(device, request, errorEvent, okEvent); |
| 1501 | 1485 | |
| ... | ... | @@ -1550,12 +1534,10 @@ public class SIPCommander implements ISIPCommander { |
| 1550 | 1534 | } |
| 1551 | 1535 | cmdXml.append("</Query>\r\n"); |
| 1552 | 1536 | |
| 1553 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1554 | - | |
| 1555 | 1537 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1556 | 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 | 1541 | transmitRequest(device, request); |
| 1560 | 1542 | |
| 1561 | 1543 | return true; |
| ... | ... | @@ -1597,14 +1579,12 @@ public class SIPCommander implements ISIPCommander { |
| 1597 | 1579 | request.addHeader(cSeqHeader); |
| 1598 | 1580 | |
| 1599 | 1581 | }else { |
| 1600 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1601 | - | |
| 1602 | 1582 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1603 | 1583 | : udpSipProvider.getNewCallId(); |
| 1604 | 1584 | |
| 1605 | 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 | 1588 | callIdHeader); |
| 1609 | 1589 | |
| 1610 | 1590 | } |
| ... | ... | @@ -1633,10 +1613,9 @@ public class SIPCommander implements ISIPCommander { |
| 1633 | 1613 | } |
| 1634 | 1614 | dragXml.append(cmdString); |
| 1635 | 1615 | dragXml.append("</Control>\r\n"); |
| 1636 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 1637 | 1616 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1638 | 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 | 1619 | logger.debug("拉框信令: " + request.toString()); |
| 1641 | 1620 | transmitRequest(device, request); |
| 1642 | 1621 | return true; |
| ... | ... | @@ -1663,13 +1642,11 @@ public class SIPCommander implements ISIPCommander { |
| 1663 | 1642 | clientTransaction = udpSipProvider.getNewClientTransaction(request); |
| 1664 | 1643 | } |
| 1665 | 1644 | if (request.getHeader(UserAgentHeader.NAME) == null) { |
| 1666 | - UserAgentHeader userAgentHeader = null; | |
| 1667 | 1645 | try { |
| 1668 | - userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | |
| 1646 | + request.addHeader(SipUtils.createUserAgentHeader(sipFactory, gitUtil)); | |
| 1669 | 1647 | } catch (ParseException e) { |
| 1670 | 1648 | logger.error("添加UserAgentHeader失败", e); |
| 1671 | 1649 | } |
| 1672 | - request.addHeader(userAgentHeader); | |
| 1673 | 1650 | } |
| 1674 | 1651 | CallIdHeader callIdHeader = (CallIdHeader)request.getHeader(CallIdHeader.NAME); |
| 1675 | 1652 | // 添加错误订阅 |
| ... | ... | @@ -1880,8 +1857,7 @@ public class SIPCommander implements ISIPCommander { |
| 1880 | 1857 | |
| 1881 | 1858 | CallIdHeader callIdHeader = device.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 1882 | 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 | 1861 | transmitRequest(device, request); |
| 1886 | 1862 | |
| 1887 | 1863 | |
| ... | ... | @@ -1896,7 +1872,7 @@ public class SIPCommander implements ISIPCommander { |
| 1896 | 1872 | |
| 1897 | 1873 | private void sendNotify(Device device, String catalogXmlContent, |
| 1898 | 1874 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) |
| 1899 | - throws NoSuchFieldException, IllegalAccessException, SipException, ParseException { | |
| 1875 | + throws SipException, ParseException { | |
| 1900 | 1876 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); |
| 1901 | 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 | 4 | import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 5 | 5 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 6 | 6 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; |
| 7 | +import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | |
| 7 | 8 | import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; |
| 8 | 9 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 9 | 10 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| ... | ... | @@ -26,7 +27,6 @@ import org.springframework.context.annotation.Lazy; |
| 26 | 27 | import org.springframework.lang.Nullable; |
| 27 | 28 | import org.springframework.stereotype.Component; |
| 28 | 29 | import org.springframework.util.ObjectUtils; |
| 29 | -import org.springframework.util.StringUtils; | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | import com.genersoft.iot.vmp.utils.DateUtil; |
| ... | ... | @@ -39,7 +39,6 @@ import java.text.ParseException; |
| 39 | 39 | import java.util.ArrayList; |
| 40 | 40 | import java.util.HashSet; |
| 41 | 41 | import java.util.List; |
| 42 | -import java.util.UUID; | |
| 43 | 42 | |
| 44 | 43 | @Component |
| 45 | 44 | @DependsOn("sipLayer") |
| ... | ... | @@ -90,7 +89,6 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 90 | 89 | SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent, boolean registerAgain, boolean isRegister) { |
| 91 | 90 | try { |
| 92 | 91 | Request request; |
| 93 | - String tm = Long.toString(System.currentTimeMillis()); | |
| 94 | 92 | if (!registerAgain ) { |
| 95 | 93 | CallIdHeader callIdHeader = null; |
| 96 | 94 | if(parentPlatform.getTransport().equalsIgnoreCase("TCP")) { |
| ... | ... | @@ -101,8 +99,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 101 | 99 | } |
| 102 | 100 | |
| 103 | 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 | 104 | // 将 callid 写入缓存, 等注册成功可以更新状态 |
| 107 | 105 | String callIdFromHeader = callIdHeader.getCallId(); |
| 108 | 106 | redisCatchStorage.updatePlatformRegisterInfo(callIdFromHeader, PlatformRegisterInfo.getInstance(parentPlatform.getServerGBId(), isRegister)); |
| ... | ... | @@ -122,7 +120,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 122 | 120 | }else { |
| 123 | 121 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 124 | 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 | 126 | transmitRequest(parentPlatform, request, null, okEvent); |
| ... | ... | @@ -156,12 +154,11 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 156 | 154 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 157 | 155 | : udpSipProvider.getNewCallId(); |
| 158 | 156 | |
| 159 | - Request request = headerProviderPlarformProvider.createKeetpaliveMessageRequest( | |
| 157 | + Request request = headerProviderPlarformProvider.createMessageRequest( | |
| 160 | 158 | parentPlatform, |
| 161 | 159 | keepaliveXml.toString(), |
| 162 | - "z9hG4bK-" + UUID.randomUUID().toString().replace("-", ""), | |
| 163 | - UUID.randomUUID().toString().replace("-", ""), | |
| 164 | - null, | |
| 160 | + SipUtils.getNewFromTag(), | |
| 161 | + SipUtils.getNewViaTag(), | |
| 165 | 162 | callIdHeader); |
| 166 | 163 | transmitRequest(parentPlatform, request, errorEvent, okEvent); |
| 167 | 164 | callId = callIdHeader.getCallId(); |
| ... | ... | @@ -223,7 +220,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 223 | 220 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 224 | 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 | 224 | transmitRequest(parentPlatform, request); |
| 228 | 225 | |
| 229 | 226 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -263,26 +260,34 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 263 | 260 | if (channel.getParentId() != null) { |
| 264 | 261 | // 业务分组加上这一项即可,提高兼容性, |
| 265 | 262 | catalogXml.append("<ParentID>" + channel.getParentId() + "</ParentID>\r\n"); |
| 263 | +// catalogXml.append("<ParentID>" + parentPlatform.getDeviceGBId() + "/" + channel.getParentId() + "</ParentID>\r\n"); | |
| 266 | 264 | } |
| 267 | 265 | if (channel.getChannelId().length() == 20 && Integer.parseInt(channel.getChannelId().substring(10, 13)) == 216) { |
| 268 | 266 | // 虚拟组织增加BusinessGroupID字段 |
| 269 | 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 | 275 | if (channel.getParental() == 0) { |
| 273 | 276 | // 通道项 |
| 274 | 277 | catalogXml.append("<Manufacturer>" + channel.getManufacture() + "</Manufacturer>\r\n"); |
| 275 | 278 | catalogXml.append("<Secrecy>" + channel.getSecrecy() + "</Secrecy>\r\n"); |
| 276 | 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 | 281 | if (channel.getChannelType() != 2) { // 业务分组/虚拟组织/行政区划 不设置以下属性 |
| 280 | 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 | 292 | catalogXml.append("</Item>\r\n"); |
| 288 | 293 | } |
| ... | ... | @@ -309,7 +314,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 309 | 314 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 310 | 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 | 318 | transmitRequest(parentPlatform, request, null, eventResult -> { |
| 314 | 319 | int indexNext = index + parentPlatform.getCatalogGroup(); |
| 315 | 320 | sendCatalogResponse(channels, parentPlatform, sn, fromTag, indexNext); |
| ... | ... | @@ -349,7 +354,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 349 | 354 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 350 | 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 | 358 | transmitRequest(parentPlatform, request); |
| 354 | 359 | |
| 355 | 360 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -387,7 +392,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 387 | 392 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 388 | 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 | 396 | transmitRequest(parentPlatform, request); |
| 392 | 397 | |
| 393 | 398 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -437,6 +442,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 437 | 442 | e.printStackTrace(); |
| 438 | 443 | } catch (IllegalAccessException e) { |
| 439 | 444 | e.printStackTrace(); |
| 445 | + } catch (InvalidArgumentException e) { | |
| 446 | + e.printStackTrace(); | |
| 440 | 447 | } |
| 441 | 448 | return true; |
| 442 | 449 | } |
| ... | ... | @@ -470,15 +477,14 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 470 | 477 | CallIdHeader callIdHeader = parentPlatform.getTransport().equalsIgnoreCase("TCP") ? tcpSipProvider.getNewCallId() |
| 471 | 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 | 481 | transmitRequest(parentPlatform, request); |
| 476 | 482 | |
| 477 | 483 | } catch (SipException | ParseException e) { |
| 478 | 484 | e.printStackTrace(); |
| 479 | 485 | return false; |
| 480 | 486 | } catch (InvalidArgumentException e) { |
| 481 | - throw new RuntimeException(e); | |
| 487 | + e.printStackTrace(); | |
| 482 | 488 | } |
| 483 | 489 | return true; |
| 484 | 490 | } |
| ... | ... | @@ -517,13 +523,15 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 517 | 523 | e.printStackTrace(); |
| 518 | 524 | } catch (IllegalAccessException e) { |
| 519 | 525 | e.printStackTrace(); |
| 526 | + } catch (InvalidArgumentException e) { | |
| 527 | + e.printStackTrace(); | |
| 520 | 528 | } |
| 521 | 529 | return true; |
| 522 | 530 | } |
| 523 | 531 | |
| 524 | 532 | private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent, |
| 525 | 533 | SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent, SipSubscribe.Event okEvent ) |
| 526 | - throws NoSuchFieldException, IllegalAccessException, SipException, ParseException { | |
| 534 | + throws NoSuchFieldException, IllegalAccessException, SipException, ParseException, InvalidArgumentException { | |
| 527 | 535 | MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory(); |
| 528 | 536 | String characterSet = parentPlatform.getCharacterSet(); |
| 529 | 537 | // 设置编码, 防止中文乱码 |
| ... | ... | @@ -533,6 +541,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 533 | 541 | return; |
| 534 | 542 | } |
| 535 | 543 | SIPRequest notifyRequest = (SIPRequest)dialog.createRequest(Request.NOTIFY); |
| 544 | + | |
| 545 | + notifyRequest.getCSeqHeader().setSeqNumber(redisCatchStorage.getCSEQ()); | |
| 546 | + | |
| 536 | 547 | ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml"); |
| 537 | 548 | notifyRequest.setContent(catalogXmlContent, contentTypeHeader); |
| 538 | 549 | |
| ... | ... | @@ -665,6 +676,8 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 665 | 676 | e.printStackTrace(); |
| 666 | 677 | } catch (IllegalAccessException e) { |
| 667 | 678 | e.printStackTrace(); |
| 679 | + } catch (InvalidArgumentException e) { | |
| 680 | + e.printStackTrace(); | |
| 668 | 681 | } |
| 669 | 682 | |
| 670 | 683 | return true; |
| ... | ... | @@ -742,7 +755,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 742 | 755 | // callid |
| 743 | 756 | CallIdHeader callIdHeader = parentPlatform.getTransport().equals("TCP") ? tcpSipProvider.getNewCallId() |
| 744 | 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 | 759 | transmitRequest(parentPlatform, request); |
| 747 | 760 | |
| 748 | 761 | } catch (SipException | ParseException | InvalidArgumentException e) { |
| ... | ... | @@ -819,9 +832,9 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 819 | 832 | e.printStackTrace(); |
| 820 | 833 | return false; |
| 821 | 834 | } catch (NoSuchFieldException e) { |
| 822 | - throw new RuntimeException(e); | |
| 835 | + e.printStackTrace(); | |
| 823 | 836 | } catch (IllegalAccessException e) { |
| 824 | - throw new RuntimeException(e); | |
| 837 | + e.printStackTrace(); | |
| 825 | 838 | } |
| 826 | 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 | 130 | StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId); |
| 131 | 131 | if (streamInfo != null) { |
| 132 | 132 | redisCatchStorage.stopPlay(streamInfo); |
| 133 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, streamInfo.getStream()); | |
| 133 | + mediaServerService.closeRTPServer(streamInfo.getMediaServerId(), streamInfo.getStream()); | |
| 134 | 134 | } |
| 135 | 135 | SsrcTransaction ssrcTransactionForPlay = streamSession.getSsrcTransaction(device.getDeviceId(), channelId, "play", null); |
| 136 | 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 | 32 | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; |
| 33 | 33 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 34 | 34 | import com.genersoft.iot.vmp.service.impl.RedisGbPlayMsgListener; |
| 35 | +import com.genersoft.iot.vmp.service.impl.RedisPushStreamResponseListener; | |
| 35 | 36 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 36 | 37 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 37 | 38 | import com.genersoft.iot.vmp.utils.DateUtil; |
| ... | ... | @@ -87,7 +88,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 87 | 88 | private DynamicTask dynamicTask; |
| 88 | 89 | |
| 89 | 90 | @Autowired |
| 90 | - private SIPCommander cmder; | |
| 91 | + private RedisPushStreamResponseListener redisPushStreamResponseListener; | |
| 91 | 92 | |
| 92 | 93 | @Autowired |
| 93 | 94 | private IPlayService playService; |
| ... | ... | @@ -588,7 +589,6 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 588 | 589 | otherWvpPushStream(evt, gbStream, streamPushItem, platform, callIdHeader, mediaServerItem, port, tcpActive, |
| 589 | 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 | 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 | 78 | |
| 79 | 79 | List<DeviceChannel> allChannels = new ArrayList<>(); |
| 80 | 80 | |
| 81 | + // 回复平台 | |
| 82 | +// DeviceChannel deviceChannel = getChannelForPlatform(parentPlatform); | |
| 83 | +// allChannels.add(deviceChannel); | |
| 84 | + | |
| 85 | + // 回复目录 | |
| 81 | 86 | if (catalogs.size() > 0) { |
| 82 | 87 | allChannels.addAll(catalogs); |
| 83 | 88 | } |
| ... | ... | @@ -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 | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.response.impl; |
| 2 | 2 | |
| 3 | 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 | 4 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 7 | 5 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 8 | 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 | 9 | import gov.nist.javax.sip.ResponseEventExt; |
| 11 | -import gov.nist.javax.sip.message.SIPResponse; | |
| 12 | 10 | import gov.nist.javax.sip.stack.SIPDialog; |
| 13 | 11 | import org.slf4j.Logger; |
| 14 | 12 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -22,13 +20,10 @@ import javax.sip.*; |
| 22 | 20 | import javax.sip.address.Address; |
| 23 | 21 | import javax.sip.address.SipURI; |
| 24 | 22 | import javax.sip.header.CSeqHeader; |
| 25 | -import javax.sip.header.CallIdHeader; | |
| 26 | 23 | import javax.sip.header.UserAgentHeader; |
| 27 | 24 | import javax.sip.message.Request; |
| 28 | 25 | import javax.sip.message.Response; |
| 29 | 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 | 49 | @Autowired |
| 55 | 50 | private SipFactory sipFactory; |
| 56 | 51 | |
| 52 | + @Autowired | |
| 53 | + private GitUtil gitUtil; | |
| 54 | + | |
| 57 | 55 | @Override |
| 58 | 56 | public void afterPropertiesSet() throws Exception { |
| 59 | 57 | // 添加消息处理的订阅 |
| ... | ... | @@ -104,7 +102,7 @@ public class InviteResponseProcessor extends SIPResponseProcessorAbstract { |
| 104 | 102 | } |
| 105 | 103 | requestURI.setPort(event.getRemotePort()); |
| 106 | 104 | reqAck.setRequestURI(requestURI); |
| 107 | - UserAgentHeader userAgentHeader = HeaderUtils.createUserAgentHeader(sipFactory); | |
| 105 | + UserAgentHeader userAgentHeader = SipUtils.createUserAgentHeader(sipFactory, gitUtil); | |
| 108 | 106 | reqAck.addHeader(userAgentHeader); |
| 109 | 107 | Address concatAddress = sipFactory.createAddressFactory().createAddress(sipFactory.createAddressFactory().createSipURI(sipConfig.getId(), sipConfig.getIp()+":"+sipConfig.getPort())); |
| 110 | 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 | 26 | |
| 27 | 27 | @Override |
| 28 | 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 | 1 | package com.genersoft.iot.vmp.gb28181.utils; |
| 2 | 2 | |
| 3 | +import com.genersoft.iot.vmp.utils.GitUtil; | |
| 3 | 4 | import gov.nist.javax.sip.address.AddressImpl; |
| 4 | 5 | import gov.nist.javax.sip.address.SipUri; |
| 5 | 6 | import gov.nist.javax.sip.header.Subject; |
| 6 | 7 | |
| 8 | +import javax.sip.PeerUnavailableException; | |
| 9 | +import javax.sip.SipFactory; | |
| 7 | 10 | import javax.sip.header.FromHeader; |
| 8 | 11 | import javax.sip.header.Header; |
| 12 | +import javax.sip.header.UserAgentHeader; | |
| 9 | 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 | 20 | * @author panlinlin |
| ... | ... | @@ -38,4 +46,28 @@ public class SipUtils { |
| 38 | 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 | 203 | return null; |
| 204 | 204 | } |
| 205 | 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 | 206 | if (event != null && !event.equals(CatalogEvent.ADD) && !event.equals(CatalogEvent.UPDATE)) { |
| 213 | 207 | // 除了ADD和update情况下需要识别全部内容, |
| 214 | 208 | return deviceChannel; |
| ... | ... | @@ -217,17 +211,26 @@ public class XmlUtil { |
| 217 | 211 | ChannelType channelType = ChannelType.Other; |
| 218 | 212 | if (channelId.length() <= 8) { |
| 219 | 213 | channelType = ChannelType.CivilCode; |
| 214 | + deviceChannel.setHasAudio(false); | |
| 220 | 215 | }else { |
| 221 | 216 | if (channelId.length() == 20) { |
| 222 | 217 | int code = Integer.parseInt(channelId.substring(10, 13)); |
| 223 | 218 | switch (code){ |
| 224 | 219 | case 215: |
| 225 | 220 | channelType = ChannelType.BusinessGroup; |
| 221 | + deviceChannel.setHasAudio(false); | |
| 226 | 222 | break; |
| 227 | 223 | case 216: |
| 228 | 224 | channelType = ChannelType.VirtualOrganization; |
| 225 | + deviceChannel.setHasAudio(false); | |
| 226 | + break; | |
| 227 | + case 136: | |
| 228 | + case 137: | |
| 229 | + case 138: | |
| 230 | + deviceChannel.setHasAudio(true); | |
| 229 | 231 | break; |
| 230 | 232 | default: |
| 233 | + deviceChannel.setHasAudio(false); | |
| 231 | 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 | 139 | param.put("stream_id", streamId); |
| 140 | 140 | JSONObject jsonObject = zlmresTfulUtils.closeRtpServer(serverItem, param); |
| 141 | 141 | if (jsonObject != null ) { |
| 142 | + System.out.println(jsonObject); | |
| 142 | 143 | if (jsonObject.getInteger("code") == 0) { |
| 143 | 144 | result = jsonObject.getInteger("hit") == 1; |
| 144 | 145 | }else { | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/IGbStreamService.java
| ... | ... | @@ -53,4 +53,6 @@ public interface IGbStreamService { |
| 53 | 53 | * @return |
| 54 | 54 | */ |
| 55 | 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 | 49 | |
| 50 | 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 | 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 | 48 | */ |
| 49 | 49 | private String mediaServerId; |
| 50 | 50 | |
| 51 | + | |
| 52 | + | |
| 51 | 53 | public static MessageForPushChannel getInstance(int type, String app, String stream, String gbId, |
| 52 | 54 | String platFormId, String platFormName, String serverId, |
| 53 | 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 | 145 | if (ssrcTransactions != null && ssrcTransactions.size() > 0) { |
| 146 | 146 | for (SsrcTransaction ssrcTransaction : ssrcTransactions) { |
| 147 | 147 | mediaServerService.releaseSsrc(ssrcTransaction.getMediaServerId(), ssrcTransaction.getSsrc()); |
| 148 | - mediaServerService.closeRTPServer(deviceId, ssrcTransaction.getChannelId(), ssrcTransaction.getStream()); | |
| 148 | + mediaServerService.closeRTPServer(ssrcTransaction.getMediaServerId(), ssrcTransaction.getStream()); | |
| 149 | 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 | 79 | gbStream.setPlatformId(platformId); |
| 80 | 80 | // TODO 修改为批量提交 |
| 81 | 81 | platformGbStreamMapper.add(gbStream); |
| 82 | - DeviceChannel deviceChannelListByStream = getDeviceChannelListByStream(gbStream, catalogId, parentPlatform); | |
| 82 | + DeviceChannel deviceChannelListByStream = getDeviceChannelListByStreamWithStatus(gbStream, catalogId, parentPlatform); | |
| 83 | 83 | deviceChannelList.add(deviceChannelListByStream); |
| 84 | 84 | } |
| 85 | 85 | dataSourceTransactionManager.commit(transactionStatus); //手动提交 |
| ... | ... | @@ -188,4 +188,46 @@ public class GbStreamServiceImpl implements IGbStreamService { |
| 188 | 188 | public int updateGbIdOrName(List<StreamPushItem> streamPushItemForUpdate) { |
| 189 | 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 | 169 | } |
| 170 | 170 | |
| 171 | 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 | 186 | @Override | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -285,6 +285,7 @@ public class PlayServiceImpl implements IPlayService { |
| 285 | 285 | // 超时处理 |
| 286 | 286 | String timeOutTaskKey = UUID.randomUUID().toString(); |
| 287 | 287 | SSRCInfo finalSsrcInfo = ssrcInfo; |
| 288 | + System.out.println("设置超时任务: " + timeOutTaskKey); | |
| 288 | 289 | dynamicTask.startDelay( timeOutTaskKey,()->{ |
| 289 | 290 | |
| 290 | 291 | SIPDialog dialog = streamSession.getDialogByStream(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); |
| ... | ... | @@ -297,7 +298,7 @@ public class PlayServiceImpl implements IPlayService { |
| 297 | 298 | logger.info("[点播超时] 消息未响应 deviceId: {}, channelId: {}", device.getDeviceId(), channelId); |
| 298 | 299 | timeoutCallback.run(0, "点播超时"); |
| 299 | 300 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); |
| 300 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | |
| 301 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); | |
| 301 | 302 | streamSession.remove(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); |
| 302 | 303 | } |
| 303 | 304 | }, userSetting.getPlayTimeout()); |
| ... | ... | @@ -310,6 +311,7 @@ public class PlayServiceImpl implements IPlayService { |
| 310 | 311 | } |
| 311 | 312 | cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> { |
| 312 | 313 | logger.info("收到订阅消息: " + response.toJSONString()); |
| 314 | + System.out.println("停止超时任务: " + timeOutTaskKey); | |
| 313 | 315 | dynamicTask.stop(timeOutTaskKey); |
| 314 | 316 | // hook响应 |
| 315 | 317 | onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId, uuid); |
| ... | ... | @@ -359,7 +361,7 @@ public class PlayServiceImpl implements IPlayService { |
| 359 | 361 | }); |
| 360 | 362 | } |
| 361 | 363 | // 关闭rtp server |
| 362 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | |
| 364 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); | |
| 363 | 365 | // 重新开启ssrc server |
| 364 | 366 | mediaServerService.openRTPServer(mediaServerItem, finalSsrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), false, finalSsrcInfo.getPort()); |
| 365 | 367 | |
| ... | ... | @@ -367,7 +369,7 @@ public class PlayServiceImpl implements IPlayService { |
| 367 | 369 | } |
| 368 | 370 | }, (event) -> { |
| 369 | 371 | dynamicTask.stop(timeOutTaskKey); |
| 370 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, finalSsrcInfo.getStream()); | |
| 372 | + mediaServerService.closeRTPServer(mediaServerItem, finalSsrcInfo.getStream()); | |
| 371 | 373 | // 释放ssrc |
| 372 | 374 | mediaServerService.releaseSsrc(mediaServerItem.getId(), finalSsrcInfo.getSsrc()); |
| 373 | 375 | |
| ... | ... | @@ -471,7 +473,7 @@ public class PlayServiceImpl implements IPlayService { |
| 471 | 473 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| 472 | 474 | }else { |
| 473 | 475 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); |
| 474 | - mediaServerService.closeRTPServer(deviceId, channelId, ssrcInfo.getStream()); | |
| 476 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); | |
| 475 | 477 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); |
| 476 | 478 | } |
| 477 | 479 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| ... | ... | @@ -559,7 +561,7 @@ public class PlayServiceImpl implements IPlayService { |
| 559 | 561 | }); |
| 560 | 562 | } |
| 561 | 563 | // 关闭rtp server |
| 562 | - mediaServerService.closeRTPServer(device.getDeviceId(), channelId, ssrcInfo.getStream()); | |
| 564 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); | |
| 563 | 565 | // 重新开启ssrc server |
| 564 | 566 | mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort()); |
| 565 | 567 | } |
| ... | ... | @@ -619,7 +621,7 @@ public class PlayServiceImpl implements IPlayService { |
| 619 | 621 | cmder.streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), null); |
| 620 | 622 | }else { |
| 621 | 623 | mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc()); |
| 622 | - mediaServerService.closeRTPServer(deviceId, channelId, ssrcInfo.getStream()); | |
| 624 | + mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); | |
| 623 | 625 | streamSession.remove(deviceId, channelId, ssrcInfo.getStream()); |
| 624 | 626 | } |
| 625 | 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 | 9 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 10 | 10 | import org.slf4j.Logger; |
| 11 | 11 | import org.slf4j.LoggerFactory; |
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | |
| 13 | 12 | import org.springframework.data.redis.connection.Message; |
| 14 | 13 | import org.springframework.data.redis.connection.MessageListener; |
| 15 | 14 | import org.springframework.stereotype.Component; |
| ... | ... | @@ -23,9 +22,9 @@ import java.util.*; |
| 23 | 22 | * @Description: 接收redis发送的推流设备列表更新通知 |
| 24 | 23 | */ |
| 25 | 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 | 28 | @Resource |
| 30 | 29 | private IMediaServerService mediaServerService; |
| 31 | 30 | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceChannelMapper.java
| ... | ... | @@ -19,11 +19,11 @@ public interface DeviceChannelMapper { |
| 19 | 19 | @Insert("INSERT INTO device_channel (channelId, deviceId, name, manufacture, model, owner, civilCode, block, " + |
| 20 | 20 | "address, parental, parentId, safetyWay, registerWay, certNum, certifiable, errCode, secrecy, " + |
| 21 | 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 | 23 | "VALUES ('${channelId}', '${deviceId}', '${name}', '${manufacture}', '${model}', '${owner}', '${civilCode}', '${block}'," + |
| 24 | 24 | "'${address}', ${parental}, '${parentId}', ${safetyWay}, ${registerWay}, '${certNum}', ${certifiable}, ${errCode}, '${secrecy}', " + |
| 25 | 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 | 27 | int add(DeviceChannel channel); |
| 28 | 28 | |
| 29 | 29 | @Update(value = {" <script>" + | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/dao/GbStreamMapper.java
| ... | ... | @@ -158,4 +158,10 @@ public interface GbStreamMapper { |
| 158 | 158 | "</foreach>"+ |
| 159 | 159 | "</script>") |
| 160 | 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 | 77 | "1=1 " + |
| 78 | 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 | 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 | 81 | " <if test='mediaServerId != null' > AND st.mediaServerId=#{mediaServerId} </if>" + |
| 82 | 82 | "order by st.createTime desc" + |
| 83 | 83 | " </script>"}) | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java
| ... | ... | @@ -133,7 +133,6 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 133 | 133 | deviceChannel.setStreamId(allChannelMap.get(deviceChannel.getChannelId()).getStreamId()); |
| 134 | 134 | deviceChannel.setHasAudio(allChannelMap.get(deviceChannel.getChannelId()).isHasAudio()); |
| 135 | 135 | } |
| 136 | - | |
| 137 | 136 | channels.add(deviceChannel); |
| 138 | 137 | if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { |
| 139 | 138 | if (subContMap.get(deviceChannel.getParentId()) == null) { |
| ... | ... | @@ -696,7 +695,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { |
| 696 | 695 | return 0; |
| 697 | 696 | } |
| 698 | 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 | 700 | platformCatalog.setBusinessGroupId(platformCatalog.getId()); |
| 702 | 701 | platformCatalog.setParentId(platform.getDeviceGBId()); | ... | ... |
src/main/java/com/genersoft/iot/vmp/utils/GitUtil.java
| ... | ... | @@ -19,9 +19,16 @@ public class GitUtil { |
| 19 | 19 | private String gitUrl; |
| 20 | 20 | @Value("${git.build.time:null}") |
| 21 | 21 | private String buildDate; |
| 22 | + | |
| 23 | + @Value("${git.build.version:null}") | |
| 24 | + private String buildVersion; | |
| 25 | + | |
| 22 | 26 | @Value("${git.commit.id.abbrev:null}") |
| 23 | 27 | private String commitIdShort; |
| 24 | 28 | |
| 29 | + @Value("${git.commit.time:null}") | |
| 30 | + private String commitTime; | |
| 31 | + | |
| 25 | 32 | public String getGitCommitId() { |
| 26 | 33 | return gitCommitId; |
| 27 | 34 | } |
| ... | ... | @@ -41,4 +48,12 @@ public class GitUtil { |
| 41 | 48 | public String getCommitIdShort() { |
| 42 | 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
src/main/resources/application-dev.yml
src/main/resources/application-docker.yml
src/main/resources/banner.txt
web_src/src/components/channelList.vue
| ... | ... | @@ -250,6 +250,7 @@ export default { |
| 250 | 250 | that.loadSnap[deviceId + channelId] = 0; |
| 251 | 251 | that.getSnapErrorEvent(snapId) |
| 252 | 252 | }, 5000) |
| 253 | + itemData.streamId = res.data.data.stream; | |
| 253 | 254 | that.$refs.devicePlayer.openDialog("media", deviceId, channelId, { |
| 254 | 255 | streamInfo: res.data.data, |
| 255 | 256 | hasAudio: itemData.hasAudio | ... | ... |