From aa56bb3c26201df2af46db0c2af4afd5345a6ba9 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 14 Jun 2024 09:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96docker=E5=86=85ip=E5=8F=98?= =?UTF-8?q?=E5=8C=96=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 0b672d33..6d991204 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java @@ -39,10 +39,10 @@ public class SipLayer implements CommandLineRunner { private final Map tcpSipProviderMap = new ConcurrentHashMap<>(); private final Map udpSipProviderMap = new ConcurrentHashMap<>(); + private final List monitorIps = new ArrayList<>(); @Override public void run(String... args) { - List monitorIps = new ArrayList<>(); if (ObjectUtils.isEmpty(sipConfig.getIp())) { try { // 获得本机的所有网络接口 @@ -173,6 +173,9 @@ public class SipLayer implements CommandLineRunner { } public String getLocalIp(String deviceLocalIp) { + if (monitorIps.size() == 1) { + return monitorIps.get(0); + } if (!ObjectUtils.isEmpty(deviceLocalIp)) { return deviceLocalIp; }