From ed1fe4b9388cfa9c1cf691f840afceddce8c7bfd Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Thu, 17 Dec 2020 15:42:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8E=E4=B8=BB=E7=BA=BF=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=EF=BC=8C=E4=BF=AE=E5=A4=8Dzlm=E5=9C=A8docker=E6=97=B6?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMHTTPProxyController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java index 4b2cabd4..f76cdd90 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHTTPProxyController.java @@ -1,10 +1,12 @@ package com.genersoft.iot.vmp.media.zlm; import com.alibaba.fastjson.JSONObject; +import com.genersoft.iot.vmp.conf.MediaServerConfig; import com.genersoft.iot.vmp.storager.IVideoManagerStorager; 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.http.HttpHeaders; import org.springframework.http.HttpRequest; import org.springframework.http.HttpStatus; @@ -27,6 +29,8 @@ public class ZLMHTTPProxyController { @Autowired private IVideoManagerStorager storager; + @Value("${media.port}") + private int mediaHttpPort; @ResponseBody @RequestMapping(value = "/**/**/**", produces = "application/json;charset=UTF-8") @@ -35,11 +39,12 @@ public class ZLMHTTPProxyController { if (storager.getMediaInfo() == null) { return "未接入流媒体"; } + MediaServerConfig mediaInfo = storager.getMediaInfo(); String requestURI = String.format("http://%s:%s%s?%s&%s", - storager.getMediaInfo().getLocalIP(), - storager.getMediaInfo().getHttpPort(), + mediaInfo.getLocalIP(), + mediaHttpPort, request.getRequestURI().replace("/zlm",""), - storager.getMediaInfo().getHookAdminParams(), + mediaInfo.getHookAdminParams(), request.getQueryString() ); // 发送请求 From ae336ae494cdfaba18312c21d7ae5a2b472fa5a9 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Thu, 17 Dec 2020 22:37:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E4=B8=BAjar=E5=90=8E=E8=BF=90=E8=A1=8C=E6=8A=A5=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E4=BE=9D=E8=B5=96=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java index 3ee95f90..f063b49b 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorFactory.java @@ -13,6 +13,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import com.genersoft.iot.vmp.conf.SipConfig; @@ -79,6 +80,7 @@ public class SIPProcessorFactory { private CancelResponseProcessor cancelResponseProcessor; @Autowired + @Lazy private RegisterResponseProcessor registerResponseProcessor; @Autowired From 28d17b04b1fe07aa6f769c6ff3e5782f2bf50228 Mon Sep 17 00:00:00 2001 From: Lawrence <1934378145@qq.com> Date: Fri, 18 Dec 2020 00:43:17 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8A=E7=BA=A7=E6=B3=A8=E5=86=8CExpires?= =?UTF-8?q?=E5=80=BC=E6=A0=B9=E6=8D=AE=E5=A1=AB=E8=A1=A8=E5=80=BC=E5=8F=91?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java index d4321d96..6982144f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java @@ -214,7 +214,7 @@ public class SIPRequestHeaderProvider { .createSipURI(platform.getDeviceGBId(), sipAddress)); request.addHeader(sipFactory.createHeaderFactory().createContactHeader(concatAddress)); - ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(3600); + ExpiresHeader expires = sipFactory.createHeaderFactory().createExpiresHeader(Integer.parseInt(platform.getExpires())); request.addHeader(expires); return request;