From 2bf7cdc2df8482b775c05e783e49f3bb7ec58da5 Mon Sep 17 00:00:00 2001 From: ljm <1271952916@qq.com> Date: Thu, 20 Oct 2022 16:04:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90zlm=E5=BF=83=E8=B7=B3hook=E3=80=91?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=9F=A5=E8=AF=A2redis=E4=BA=86=20=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=B9=9F=E4=B8=8D=E9=9C=80=E8=A6=81=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E5=BA=94=E8=AF=A5=E6=81=A2=E5=A4=8Dzlm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/MediaServerServiceImpl.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java index 7c5b1499..cdaa7e6d 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java @@ -644,19 +644,13 @@ public class MediaServerServiceImpl implements IMediaServerService { MediaServerItem mediaServerItem = getOne(mediaServerId); if (mediaServerItem == null) { // 缓存不存在,从数据库查询,如果数据库不存在则是错误的 - MediaServerItem mediaServerItemFromDatabase = getOneFromDatabase(mediaServerId); - if (mediaServerItemFromDatabase == null) { - return; - } - // zlm连接重试 - logger.warn("[更新ZLM 保活信息]失败,未找到流媒体信息,尝试重连zlm"); -// reloadZlm(); - mediaServerItem = getOne(mediaServerId); + mediaServerItem = getOneFromDatabase(mediaServerId); if (mediaServerItem == null) { - // zlm连接重试 logger.warn("[更新ZLM 保活信息]失败,未找到流媒体信息"); return; } + // zlm连接重试 + logger.warn("[更新ZLM 保活信息]尝试链接默认zml"); } final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); dynamicTask.stop(zlmKeepaliveKey); From d6fe626b1cea8d206a4b9679c07d555e3de2ea9a Mon Sep 17 00:00:00 2001 From: ljm <1271952916@qq.com> Date: Sat, 22 Oct 2022 09:48:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90zlm=E5=BF=83=E8=B7=B3hook=E3=80=91?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=9F=A5=E8=AF=A2redis=E4=BA=86=20=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=B9=9F=E4=B8=8D=E9=9C=80=E8=A6=81=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20=E6=95=B0=E6=8D=AE=E5=BA=93=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E8=AF=9D=E5=BA=94=E8=AF=A5=E6=81=A2=E5=A4=8Dzlm=20?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=B2=A1=E6=9C=89=E7=9A=84=E8=AF=9D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E9=87=8D=E6=96=B0=E5=8A=A0=E8=BD=BD=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/service/impl/MediaServerServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java index cdaa7e6d..77631b08 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java @@ -650,7 +650,12 @@ public class MediaServerServiceImpl implements IMediaServerService { return; } // zlm连接重试 - logger.warn("[更新ZLM 保活信息]尝试链接默认zml"); + logger.warn("[更新ZLM 保活信息]尝试链接zml id {}", mediaServerId); + SsrcConfig ssrcConfig = new SsrcConfig(mediaServerItem.getId(), null, sipConfig.getDomain()); + mediaServerItem.setSsrcConfig(ssrcConfig); + String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId(); + RedisUtil.set(key, mediaServerItem); + clearRTPServer(mediaServerItem); } final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId(); dynamicTask.stop(zlmKeepaliveKey);