SIP只有一个监听时,直接返回

dev/abl支持
panlinlin 2024-06-14 00:03:57 +08:00
parent 70e6d919e9
commit 07a8ef9e25
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}