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 9e1494b..ec21621 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 @@ -118,6 +118,8 @@ public class DeviceProxyService { return startSendRtpResp; }); } catch (Exception e) { + Optional.ofNullable(zlmStreamChangeHookService.getUnregistHandler().remove(callId)) + .ifPresent(ZlmStreamChangeHookService.ZlmStreamChangeHookHandler::handler); throw new RuntimeException(e); } }); @@ -174,6 +176,8 @@ public class DeviceProxyService { return startSendRtpResp; }); } catch (Exception e) { + Optional.ofNullable(zlmStreamChangeHookService.getUnregistHandler().remove(callId)) + .ifPresent(ZlmStreamChangeHookService.ZlmStreamChangeHookHandler::handler); throw new RuntimeException(e); } });