panlinlin
2021-04-20 ab13017117b18427bb5ee687c9a1b3fd5a94f2ae
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java
@@ -48,17 +48,18 @@
            String platformGbId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser();
            String channelId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(ToHeader.NAME)).getAddress().getURI()).getUser();
            SendRtpItem sendRtpItem =  redisCatchStorage.querySendRTPServer(platformGbId, channelId);
            if (sendRtpItem == null) return;
            String streamId = sendRtpItem.getStreamId();
            Map<String, Object> param = new HashMap<>();
            param.put("vhost","__defaultVhost__");
            param.put("app","rtp");
            param.put("app",sendRtpItem.getApp());
            param.put("stream",streamId);
            System.out.println("停止向上级推流:" + streamId);
            zlmrtpServerFactory.stopSendRtpStream(param);
            redisCatchStorage.deleteSendRTPServer(platformGbId, channelId);
            if (zlmrtpServerFactory.totalReaderCount(streamId) == 0) {
            if (zlmrtpServerFactory.totalReaderCount(sendRtpItem.getApp(), streamId) == 0) {
               System.out.println(streamId + "无其它观看者,通知设备停止推流");
               cmder.streamByeCmd(streamId);
               cmder.streamByeCmd(sendRtpItem.getDeviceId(), channelId);
            }
         }
      } catch (SipException e) {