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 55070447..0b672d33 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java @@ -142,6 +142,9 @@ public class SipLayer implements CommandLineRunner { if (ObjectUtils.isEmpty(ip)) { return null; } + if (udpSipProviderMap.size() == 1) { + return udpSipProviderMap.values().stream().findFirst().get(); + } return udpSipProviderMap.get(ip); } @@ -163,6 +166,9 @@ public class SipLayer implements CommandLineRunner { if (ObjectUtils.isEmpty(ip)) { return null; } + if (tcpSipProviderMap.size() == 1) { + return tcpSipProviderMap.values().stream().findFirst().get(); + } return tcpSipProviderMap.get(ip); }