优化录像结束发送BYE判断

This commit is contained in:
648540858 2022-05-13 21:10:02 +08:00
parent 98e6cf5bae
commit 95642d0bb8

View File

@ -657,8 +657,11 @@ public class SIPCommander implements ISIPCommander {
// 添加流注销的订阅注销了后向设备发送bye
subscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_stream_changed, subscribeKey,
(MediaServerItem mediaServerItemForEnd, JSONObject jsonForEnd)->{
logger.info("[录像]下载结束, 发送BYE");
streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), callIdHeader.getCallId());
ClientTransaction transaction = streamSession.getTransaction(device.getDeviceId(), channelId, ssrcInfo.getStream(), callIdHeader.getCallId());
if (transaction != null) {
logger.info("[录像]下载结束, 发送BYE");
streamByeCmd(device.getDeviceId(), channelId, ssrcInfo.getStream(), callIdHeader.getCallId());
}
});
});