From ecb5b691018c8ff71583833ec9a09d8f2bef81f6 Mon Sep 17 00:00:00 2001 From: 64850858 <648540858@qq.com> Date: Wed, 9 Jun 2021 09:28:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8C=E6=AD=A5=E9=80=9A?= =?UTF-8?q?=E9=81=93=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8DhookIP=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=97=B6?= =?UTF-8?q?=E7=9A=84hookIP=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC=E8=B5=8B?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/conf/MediaConfig.java | 22 ++++++++++++++++--- .../vmanager/gb28181/device/DeviceQuery.java | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index 8ab34bf4..48f1af51 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -14,6 +14,9 @@ public class MediaConfig { @Value("${media.hookIp:${sip.ip}}") private String hookIp; + @Value("${sip.ip}") + private String sipIp; + @Value("${media.sdpIp:${media.ip}}") private String sdpIp; @@ -68,7 +71,12 @@ public class MediaConfig { } public String getHookIp() { - return hookIp; + if (StringUtils.isEmpty(hookIp)){ + return sipIp; + }else { + return hookIp; + } + } public void setHookIp(String hookIp) { @@ -76,7 +84,11 @@ public class MediaConfig { } public String getSdpIp() { - return sdpIp; + if (StringUtils.isEmpty(sdpIp)){ + return ip; + }else { + return sdpIp; + } } public void setSdpIp(String sdpIp) { @@ -84,7 +96,11 @@ public class MediaConfig { } public String getStreamIp() { - return streamIp; + if (StringUtils.isEmpty(streamIp)){ + return ip; + }else { + return streamIp; + } } public void setStreamIp(String streamIp) { diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java index c40a493e..776acbf2 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/device/DeviceQuery.java @@ -149,7 +149,7 @@ public class DeviceQuery { msg.setData(String.format("同步通道失败,错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase())); resultHolder.invokeResult(msg); }); - DeferredResult> result = new DeferredResult>(2*1000L); + DeferredResult> result = new DeferredResult>(15*1000L); result.onTimeout(()->{ logger.warn(String.format("设备通道信息同步超时")); // 释放rtpserver