From da2662ab27e5655636bfa6338d8d1f083a99f36f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 13 六月 2024 18:10:01 +0800 Subject: [PATCH] 国标28181-支持自动识别网卡监听,可以不再配置SIP.IP --- src/main/java/com/genersoft/iot/vmp/gb28181/session/SSRCFactory.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/session/SSRCFactory.java b/src/main/java/com/genersoft/iot/vmp/gb28181/session/SSRCFactory.java old mode 100644 new mode 100755 index 657bb2f..2422b8a --- a/src/main/java/com/genersoft/iot/vmp/gb28181/session/SSRCFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/session/SSRCFactory.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Set; /** @@ -37,7 +38,8 @@ public void initMediaServerSSRC(String mediaServerId, Set<String> usedSet) { - String ssrcPrefix = sipConfig.getDomain().substring(3, 8); + String sipDomain = sipConfig.getDomain(); + String ssrcPrefix = sipDomain.length() >= 8 ? sipDomain.substring(3, 8) : sipDomain; String redisKey = SSRC_INFO_KEY + userSetting.getServerId() + "_" + mediaServerId; List<String> ssrcList = new ArrayList<>(); for (int i = 1; i < MAX_STREAM_COUNT; i++) { @@ -118,7 +120,7 @@ */ public boolean hasMediaServerSSRC(String mediaServerId) { String redisKey = SSRC_INFO_KEY + userSetting.getServerId() + "_" + mediaServerId; - return redisTemplate.opsForSet().members(redisKey) != null; + return Boolean.TRUE.equals(redisTemplate.hasKey(redisKey)); } } -- Gitblit v1.8.0