From 613399cc6d14cfe5b8a245d462629ecee5deb2db Mon Sep 17 00:00:00 2001
From: xiaoQQya <xiaoQQya@126.com>
Date: 星期二, 17 十月 2023 17:49:31 +0800
Subject: [PATCH] fix(play): 修复单端口推流下级自定义 ssrc 时, 流注册后接口仍然超时的问题
---
src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java | 66 +++++++++++++++------------------
1 files changed, 30 insertions(+), 36 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
old mode 100644
new mode 100755
index d09e565..72641be
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/server/ServerController.java
@@ -2,43 +2,37 @@
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
-import com.genersoft.iot.vmp.VManageBootstrap;
import com.genersoft.iot.vmp.common.SystemAllInfo;
import com.genersoft.iot.vmp.common.VersionPo;
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.media.zlm.SendRtpPortManager;
import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.dto.IHookSubscribe;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.*;
import com.genersoft.iot.vmp.service.bean.MediaServerLoad;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
-import com.genersoft.iot.vmp.utils.SpringBeanFactory;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
-import com.genersoft.iot.vmp.vmanager.bean.ResourceBaceInfo;
+import com.genersoft.iot.vmp.vmanager.bean.ResourceBaseInfo;
import com.genersoft.iot.vmp.vmanager.bean.ResourceInfo;
import com.genersoft.iot.vmp.vmanager.bean.SystemConfigInfo;
-import gov.nist.javax.sip.SipStackImpl;
-
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
-import javax.sip.ListeningPoint;
-import javax.sip.ObjectInUseException;
-import javax.sip.SipProvider;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
@SuppressWarnings("rawtypes")
@Tag(name = "鏈嶅姟鎺у埗")
-@CrossOrigin
+
@RestController
@RequestMapping("/api/server")
public class ServerController {
@@ -77,10 +71,10 @@
@Autowired
- private ThreadPoolTaskExecutor taskExecutor;
+ private IRedisCatchStorage redisCatchStorage;
@Autowired
- private IRedisCatchStorage redisCatchStorage;
+ private SendRtpPortManager sendRtpPortManager;
@GetMapping(value = "/media_server/list")
@@ -158,25 +152,25 @@
@GetMapping(value = "/restart")
@ResponseBody
public void restart() {
- taskExecutor.execute(()-> {
- try {
- Thread.sleep(3000);
- SipProvider up = (SipProvider) SpringBeanFactory.getBean("udpSipProvider");
- SipStackImpl stack = (SipStackImpl) up.getSipStack();
- stack.stop();
- Iterator listener = stack.getListeningPoints();
- while (listener.hasNext()) {
- stack.deleteListeningPoint((ListeningPoint) listener.next());
- }
- Iterator providers = stack.getSipProviders();
- while (providers.hasNext()) {
- stack.deleteSipProvider((SipProvider) providers.next());
- }
- VManageBootstrap.restart();
- } catch (InterruptedException | ObjectInUseException e) {
- throw new ControllerException(ErrorCode.ERROR100.getCode(), e.getMessage());
- }
- });
+// taskExecutor.execute(()-> {
+// try {
+// Thread.sleep(3000);
+// SipProvider up = (SipProvider) SpringBeanFactory.getBean("udpSipProvider");
+// SipStackImpl stack = (SipStackImpl) up.getSipStack();
+// stack.stop();
+// Iterator listener = stack.getListeningPoints();
+// while (listener.hasNext()) {
+// stack.deleteListeningPoint((ListeningPoint) listener.next());
+// }
+// Iterator providers = stack.getSipProviders();
+// while (providers.hasNext()) {
+// stack.deleteSipProvider((SipProvider) providers.next());
+// }
+// VManageBootstrap.restart();
+// } catch (InterruptedException | ObjectInUseException e) {
+// throw new ControllerException(ErrorCode.ERROR100.getCode(), e.getMessage());
+// }
+// });
};
@Operation(summary = "鑾峰彇绯荤粺淇℃伅淇℃伅")
@@ -261,13 +255,13 @@
@Operation(summary = "鑾峰彇璐熻浇淇℃伅")
public ResourceInfo getResourceInfo() {
ResourceInfo result = new ResourceInfo();
- ResourceBaceInfo deviceInfo = deviceService.getOverview();
+ ResourceBaseInfo deviceInfo = deviceService.getOverview();
result.setDevice(deviceInfo);
- ResourceBaceInfo channelInfo = channelService.getOverview();
+ ResourceBaseInfo channelInfo = channelService.getOverview();
result.setChannel(channelInfo);
- ResourceBaceInfo pushInfo = pushService.getOverview();
+ ResourceBaseInfo pushInfo = pushService.getOverview();
result.setPush(pushInfo);
- ResourceBaceInfo proxyInfo = proxyService.getOverview();
+ ResourceBaseInfo proxyInfo = proxyService.getOverview();
result.setProxy(proxyInfo);
return result;
--
Gitblit v1.8.0