From a3af529d044453c9fc55adef13fa1b5cc26aceac Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 29 Jun 2023 11:09:41 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AA=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81=E9=80=9A=E8=BF=87=E7=9A=84=E8=A1=A8=E5=8D=95=E8=A2=AB?=
=?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web_src/src/components/dialog/catalogEdit.vue | 59 +++++++++----------
1 file changed, 29 insertions(+), 30 deletions(-)
diff --git a/web_src/src/components/dialog/catalogEdit.vue b/web_src/src/components/dialog/catalogEdit.vue
index e2fe59bc..9a5e3a36 100644
--- a/web_src/src/components/dialog/catalogEdit.vue
+++ b/web_src/src/components/dialog/catalogEdit.vue
@@ -12,15 +12,6 @@
>
-
-
-
-
-
-
-
-
-
@@ -63,7 +54,11 @@ export default {
return callback(new Error('行政区划编号必须为2/4/6/8位'));
}
if (this.form.parentId !== this.platformDeviceId && this.form.parentId.length >= value.trim().length) {
- return callback(new Error('行政区划编号长度应该每次两位递增'));
+ if (this.form.parentId.length === 20) {
+ return callback(new Error('业务分组/虚拟组织下不可创建行政区划'));
+ }else {
+ return callback(new Error('行政区划编号长度应该每次两位递增'));
+ }
}
}else {
if (value.trim().length !== 20) {
@@ -122,27 +117,31 @@ export default {
this.level = level;
},
onSubmit: function () {
- console.log("onSubmit");
- console.log(this.form);
- this.$axios({
- method:"post",
- url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
- data: this.form
- }).then((res)=> {
- if (res.data.code === 0) {
- if (this.submitCallback)this.submitCallback(this.form)
- }else {
- this.$message({
- showClose: true,
- message: res.data.msg,
- type: "error",
+ this.$refs["form"].validate((valid) => {
+ if (valid) {
+ this.$axios({
+ method:"post",
+ url:`/api/platform/catalog/${!this.isEdit? "add":"edit"}`,
+ data: this.form
+ }).then((res)=> {
+ if (res.data.code === 0) {
+ if (this.submitCallback)this.submitCallback(this.form)
+ }else {
+ this.$message({
+ showClose: true,
+ message: res.data.msg,
+ type: "error",
+ });
+ }
+ this.close();
+ })
+ .catch((error)=> {
+ console.log(error);
});
- }
- this.close();
- })
- .catch((error)=> {
- console.log(error);
- });
+ } else {
+ return false;
+ }
+ });
},
close: function () {
this.isEdit = false;
From d2c4050454d41e12c1e72fe93af4ac4831a12a07 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Thu, 29 Jun 2023 11:22:32 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8?=
=?UTF-8?q?=E6=8E=A8=E6=B5=81=E7=8A=B6=E6=80=81=E4=BD=9C=E4=B8=BA=E6=8E=A8?=
=?UTF-8?q?=E6=B5=81=E9=80=9A=E9=81=93=E7=8A=B6=E6=80=81=E4=B8=BAfalse?=
=?UTF-8?q?=E4=BB=8D=E7=84=B6=E5=8F=91=E9=80=81=E9=80=9A=E7=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/media/zlm/ZLMHttpHookListener.java | 4 +++-
.../vmp/storager/impl/RedisCatchStorageImpl.java | 16 ++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
index e8432cc2..33c87138 100644
--- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
+++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -387,7 +387,9 @@ public class ZLMHttpHookListener {
}
GbStream gbStream = storager.getGbStream(param.getApp(), param.getStream());
if (gbStream != null) {
- eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF);
+ if (userSetting.isUsePushingAsStatus()) {
+ eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF);
+ }
}
if (type != null) {
// 发送流变化redis消息
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
index e54324fc..ee31e96a 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -576,7 +576,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendStreamChangeMsg(String type, JSONObject jsonObject) {
String key = VideoManagerConstants.WVP_MSG_STREAM_CHANGE_PREFIX + type;
- logger.info("[redis 流变化事件] {}: {}", key, jsonObject.toString());
+ logger.info("[redis 流变化事件] 发送 {}: {}", key, jsonObject.toString());
redisTemplate.convertAndSend(key, jsonObject);
}
@@ -850,14 +850,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendMobilePositionMsg(JSONObject jsonObject) {
String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_MOBILE_POSITION;
- logger.info("[redis发送通知] 移动位置 {}: {}", key, jsonObject.toString());
+ logger.info("[redis发送通知] 发送 移动位置 {}: {}", key, jsonObject.toString());
redisTemplate.convertAndSend(key, jsonObject);
}
@Override
public void sendStreamPushRequestedMsg(MessageForPushChannel msg) {
String key = VideoManagerConstants.VM_MSG_STREAM_PUSH_REQUESTED;
- logger.info("[redis发送通知] 推流被请求 {}: {}/{}", key, msg.getApp(), msg.getStream());
+ logger.info("[redis发送通知] 发送 推流被请求 {}: {}/{}", key, msg.getApp(), msg.getStream());
redisTemplate.convertAndSend(key, JSON.toJSON(msg));
}
@@ -865,7 +865,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
public void sendAlarmMsg(AlarmChannelMessage msg) {
// 此消息用于对接第三方服务下级来的消息内容
String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM;
- logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg));
+ logger.info("[redis发送通知] 发送 报警{}: {}", key, JSON.toJSON(msg));
redisTemplate.convertAndSend(key, JSON.toJSON(msg));
}
@@ -878,7 +878,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendStreamPushRequestedMsgForStatus() {
String key = VideoManagerConstants.VM_MSG_GET_ALL_ONLINE_REQUESTED;
- logger.info("[redis通知]获取所有推流设备的状态");
+ logger.info("[redis通知] 发送 获取所有推流设备的状态");
JSONObject jsonObject = new JSONObject();
jsonObject.put(key, key);
redisTemplate.convertAndSend(key, jsonObject);
@@ -915,7 +915,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendDeviceOrChannelStatus(String deviceId, String channelId, boolean online) {
String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_DEVICE_STATUS;
- logger.info("[redis通知] 推送设备/通道状态, {}/{}-{}", deviceId, channelId, online);
+ logger.info("[redis通知] 发送 推送设备/通道状态, {}/{}-{}", deviceId, channelId, online);
StringBuilder msg = new StringBuilder();
msg.append(deviceId);
if (channelId != null) {
@@ -929,14 +929,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void sendPlatformStartPlayMsg(MessageForPushChannel msg) {
String key = VideoManagerConstants.VM_MSG_STREAM_START_PLAY_NOTIFY;
- logger.info("[redis发送通知] 推流被上级平台观看 {}: {}/{}->{}", key, msg.getApp(), msg.getStream(), msg.getPlatFormId());
+ logger.info("[redis发送通知] 发送 推流被上级平台观看 {}: {}/{}->{}", key, msg.getApp(), msg.getStream(), msg.getPlatFormId());
redisTemplate.convertAndSend(key, JSON.toJSON(msg));
}
@Override
public void sendPlatformStopPlayMsg(MessageForPushChannel msg) {
String key = VideoManagerConstants.VM_MSG_STREAM_STOP_PLAY_NOTIFY;
- logger.info("[redis发送通知] 上级平台停止观看 {}: {}/{}->{}", key, msg.getApp(), msg.getStream(), msg.getPlatFormId());
+ logger.info("[redis发送通知] 发送 上级平台停止观看 {}: {}/{}->{}", key, msg.getApp(), msg.getStream(), msg.getPlatFormId());
redisTemplate.convertAndSend(key, JSON.toJSON(msg));
}
}
From 090d5b8b624798179482817ae7f29e519d85fa54 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: Mon, 3 Jul 2023 16:53:03 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8E=E7=AC=AC?=
=?UTF-8?q?=E4=B8=89=E6=96=B9=E5=AF=B9=E6=8E=A5=E7=9A=84=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../iot/vmp/common/VideoManagerConstants.java | 1 +
.../vmp/vmanager/bean/OtherRtpSendInfo.java | 135 ++++++++++++++
.../iot/vmp/vmanager/rtp/RtpController.java | 165 ++++++++++++++++--
3 files changed, 290 insertions(+), 11 deletions(-)
create mode 100644 src/main/java/com/genersoft/iot/vmp/vmanager/bean/OtherRtpSendInfo.java
diff --git a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
index 8105c0be..6eec845d 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/VideoManagerConstants.java
@@ -153,6 +153,7 @@ public class VideoManagerConstants {
public static final String WVP_STREAM_GB_ID_PREFIX = "memberNo_";
public static final String WVP_STREAM_GPS_MSG_PREFIX = "WVP_STREAM_GPS_MSG_";
+ public static final String WVP_OTHER_SEND_RTP_INFO = "VMP_OTHER_SEND_RTP_INFO_";
/**
* Redis Const
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/bean/OtherRtpSendInfo.java b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/OtherRtpSendInfo.java
new file mode 100644
index 00000000..225e40c4
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/bean/OtherRtpSendInfo.java
@@ -0,0 +1,135 @@
+package com.genersoft.iot.vmp.vmanager.bean;
+
+public class OtherRtpSendInfo {
+
+ /**
+ * 发流IP
+ */
+ private String ip;
+
+ /**
+ * 发流端口
+ */
+ private int port;
+
+ /**
+ * 收流IP
+ */
+ private String receiveIp;
+
+ /**
+ * 收流端口
+ */
+ private int receivePort;
+
+ /**
+ * 会话ID
+ */
+ private String callId;
+
+ /**
+ * 流ID
+ */
+ private String stream;
+
+ /**
+ * 推流应用名
+ */
+ private String pushApp;
+
+ /**
+ * 推流流ID
+ */
+ private String pushStream;
+
+ /**
+ * 推流SSRC
+ */
+ private String pushSSRC;
+
+
+
+ public String getIp() {
+ return ip;
+ }
+
+ public void setIp(String ip) {
+ this.ip = ip;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public String getReceiveIp() {
+ return receiveIp;
+ }
+
+ public void setReceiveIp(String receiveIp) {
+ this.receiveIp = receiveIp;
+ }
+
+ public int getReceivePort() {
+ return receivePort;
+ }
+
+ public void setReceivePort(int receivePort) {
+ this.receivePort = receivePort;
+ }
+
+ public String getCallId() {
+ return callId;
+ }
+
+ public void setCallId(String callId) {
+ this.callId = callId;
+ }
+
+ public String getStream() {
+ return stream;
+ }
+
+ public void setStream(String stream) {
+ this.stream = stream;
+ }
+
+ public String getPushApp() {
+ return pushApp;
+ }
+
+ public void setPushApp(String pushApp) {
+ this.pushApp = pushApp;
+ }
+
+ public String getPushStream() {
+ return pushStream;
+ }
+
+ public void setPushStream(String pushStream) {
+ this.pushStream = pushStream;
+ }
+
+ public String getPushSSRC() {
+ return pushSSRC;
+ }
+
+ public void setPushSSRC(String pushSSRC) {
+ this.pushSSRC = pushSSRC;
+ }
+
+ @Override
+ public String toString() {
+ return "OtherRtpSendInfo{" +
+ "ip='" + ip + '\'' +
+ ", port=" + port +
+ ", receiveIp='" + receiveIp + '\'' +
+ ", receivePort=" + receivePort +
+ ", callId='" + callId + '\'' +
+ ", stream='" + stream + '\'' +
+ '}';
+ }
+}
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
index c8c1625c..5c74fcc9 100644
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
@@ -1,25 +1,42 @@
package com.genersoft.iot.vmp.vmanager.rtp;
+import com.alibaba.fastjson2.JSONObject;
+import com.genersoft.iot.vmp.common.VideoManagerConstants;
+import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.SipConfig;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.VersionInfo;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
-import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem;
+import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe;
+import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory;
+import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForRtpServerTimeout;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
-import com.genersoft.iot.vmp.service.*;
+import com.genersoft.iot.vmp.service.IDeviceChannelService;
+import com.genersoft.iot.vmp.service.IDeviceService;
+import com.genersoft.iot.vmp.service.IMediaServerService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
+import com.genersoft.iot.vmp.vmanager.bean.OtherRtpSendInfo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
@SuppressWarnings("rawtypes")
@Tag(name = "第三方服务对接")
@@ -27,8 +44,13 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/rtp")
public class RtpController {
+ private final static Logger logger = LoggerFactory.getLogger(RtpController.class);
+
@Autowired
- private ZlmHttpHookSubscribe zlmHttpHookSubscribe;
+ private ZLMRTPServerFactory zlmServerFactory;
+
+ @Autowired
+ private ZlmHttpHookSubscribe hookSubscribe;
@Autowired
private IMediaServerService mediaServerService;
@@ -49,11 +71,11 @@ public class RtpController {
private IDeviceChannelService channelService;
@Autowired
- private IStreamPushService pushService;
+ private DynamicTask dynamicTask;
@Autowired
- private IStreamProxyService proxyService;
+ private RedisTemplate