优化sip消息

This commit is contained in:
648540858
2022-09-09 17:06:19 +08:00
parent b5fb82934e
commit 221f99c764
10 changed files with 128 additions and 199 deletions

View File

@@ -257,6 +257,7 @@ public class PlayServiceImpl implements IPlayService {
// 超时处理
String timeOutTaskKey = UUID.randomUUID().toString();
SSRCInfo finalSsrcInfo = ssrcInfo;
System.out.println("设置超时任务: " + timeOutTaskKey);
dynamicTask.startDelay( timeOutTaskKey,()->{
SIPDialog dialog = streamSession.getDialogByStream(device.getDeviceId(), channelId, finalSsrcInfo.getStream());
@@ -282,6 +283,7 @@ public class PlayServiceImpl implements IPlayService {
}
cmder.playStreamCmd(mediaServerItem, ssrcInfo, device, channelId, (MediaServerItem mediaServerItemInuse, JSONObject response) -> {
logger.info("收到订阅消息: " + response.toJSONString());
System.out.println("停止超时任务: " + timeOutTaskKey);
dynamicTask.stop(timeOutTaskKey);
// hook响应
onPublishHandlerForPlay(mediaServerItemInuse, response, device.getDeviceId(), channelId, uuid);