From d799f104208f86af4c0743789725cc903992a356 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 30 Jan 2024 10:22:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=B5=81=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=88=99=E5=85=B3=E9=97=AD=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E8=AF=B7=E6=B1=82=E7=9A=84=E5=AE=9E=E6=97=B6=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/mocking/service/device/DeviceProxyService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java index 95606f8..f4cb15b 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/service/device/DeviceProxyService.java @@ -404,6 +404,10 @@ public class DeviceProxyService { @SneakyThrows public void pullLiveStream2Rtp(SIPRequest request,Runnable sendOkResponse,String callId, MockingDevice device, String rtpAddr, int rtpPort, String ssrc){ + String liveCache = CacheUtil.getKey("INVITE", "LIVE", device.getGbDeviceId()); + // 关闭已存在的实时流 bye 订阅(如果存在) + subscribe.getByeSubscribe().delPublisher(liveCache); + ScheduledFuture schedule = trying(request); Retryer> retryer = RetryerBuilder.>newBuilder() .retryIfResult(resp -> { @@ -474,6 +478,8 @@ public class DeviceProxyService { }); Flow.Subscriber subscriber = zlmByeSubscriber(key,request,device); + liveCache = CacheUtil.getKey("INVITE", "LIVE", device.getGbDeviceId()); + RedisUtil.StringOps.set(liveCache, key); subscribe.getByeSubscribe().addPublisher(key); subscribe.getByeSubscribe().addSubscribe(key, subscriber); } catch (Exception e) {