调整获取监听信息的逻辑

pull/1524/head
648540858 2024-06-18 10:00:32 +08:00
parent 1909c7f71f
commit afe80a7be1
1 changed files with 6 additions and 6 deletions

View File

@ -139,12 +139,12 @@ public class SipLayer implements CommandLineRunner {
}
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 +163,12 @@ public class SipLayer implements CommandLineRunner {
}
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);
}