From d1af677fff6ad931d0ba9a8506f516a9ceda79ab Mon Sep 17 00:00:00 2001
From: ZhaoYandong00 <zhaoyandong00@hotmail.com>
Date: 星期一, 08 七月 2024 16:34:29 +0800
Subject: [PATCH] 修复在docker中使用,平台信息IP无法显示主机IP的问题

---
 src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
index 6d99120..afdbb49 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
@@ -82,7 +82,9 @@
 				monitorIps.add(sipConfig.getIp());
 			}
 		}
-		sipConfig.setShowIp(String.join(",", monitorIps));
+		if (ObjectUtils.isEmpty(sipConfig.getShowIp())){
+			sipConfig.setShowIp(String.join(",", monitorIps));
+		}
 		SipFactory.getInstance().setPathName("gov.nist");
 		if (monitorIps.size() > 0) {
 			for (String monitorIp : monitorIps) {
@@ -139,11 +141,11 @@
 	}
 
 	public SipProviderImpl getUdpSipProvider(String ip) {
-		if (ObjectUtils.isEmpty(ip)) {
-			return null;
-		}
 		if (udpSipProviderMap.size() == 1) {
 			return udpSipProviderMap.values().stream().findFirst().get();
+		}
+		if (ObjectUtils.isEmpty(ip)) {
+			return null;
 		}
 		return udpSipProviderMap.get(ip);
 	}
@@ -163,12 +165,12 @@
 	}
 
 	public SipProviderImpl getTcpSipProvider(String ip) {
-		if (ObjectUtils.isEmpty(ip)) {
-			return null;
-		}
 		if (tcpSipProviderMap.size() == 1) {
 			return tcpSipProviderMap.values().stream().findFirst().get();
 		}
+		if (ObjectUtils.isEmpty(ip)) {
+			return null;
+		}
 		return tcpSipProviderMap.get(ip);
 	}
 

--
Gitblit v1.8.0