|  | @@ -143,7 +143,7 @@ public class PlayServiceImpl implements IPlayService {
 | 
	
		
			
				|  |  |                  if (rtpInfo.getBoolean("exist")) {
 | 
	
		
			
				|  |  |                      int localPort = rtpInfo.getInteger("local_port");
 | 
	
		
			
				|  |  |                      if (localPort == 0) {
 | 
	
		
			
				|  |  | -                        logger.warn("[点播],点播时发现rtpServerC存在,但是尚未开始推流");
 | 
	
		
			
				|  |  | +                        logger.warn("[点播],点播时发现rtpServer存在,但是尚未开始推流");
 | 
	
		
			
				|  |  |                          // 此时说明rtpServer已经创建但是流还没有推上来
 | 
	
		
			
				|  |  |                          WVPResult wvpResult = new WVPResult();
 | 
	
		
			
				|  |  |                          wvpResult.setCode(ErrorCode.ERROR100.getCode());
 | 
	
	
		
			
				|  | @@ -228,7 +228,7 @@ public class PlayServiceImpl implements IPlayService {
 | 
	
		
			
				|  |  |                       ZlmHttpHookSubscribe.Event hookEvent, SipSubscribe.Event errorEvent,
 | 
	
		
			
				|  |  |                       InviteTimeOutCallback timeoutCallback) {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        logger.info("[点播开始] deviceId: {}, channelId: {},收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  | +        logger.info("[点播开始] deviceId: {}, channelId: {},收流端口:{}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  |          // 超时处理
 | 
	
		
			
				|  |  |          String timeOutTaskKey = UUID.randomUUID().toString();
 | 
	
		
			
				|  |  |          dynamicTask.startDelay(timeOutTaskKey, () -> {
 | 
	
	
		
			
				|  | @@ -352,30 +352,50 @@ public class PlayServiceImpl implements IPlayService {
 | 
	
		
			
				|  |  |                                  hookEvent.response(mediaServerItemInUse, response);
 | 
	
		
			
				|  |  |                              });
 | 
	
		
			
				|  |  |                          }
 | 
	
		
			
				|  |  | -                        // 关闭rtp server
 | 
	
		
			
				|  |  | -                        mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream(), result->{
 | 
	
		
			
				|  |  | -                            if (result) {
 | 
	
		
			
				|  |  | -                                // 重新开启ssrc server
 | 
	
		
			
				|  |  | -                                mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), false, ssrcInfo.getPort(), true, device.getStreamModeForParam());
 | 
	
		
			
				|  |  | -                            }else {
 | 
	
		
			
				|  |  | -                                try {
 | 
	
		
			
				|  |  | -                                    logger.warn("[停止点播] {}/{}", device.getDeviceId(), channelId);
 | 
	
		
			
				|  |  | -                                    cmder.streamByeCmd(device, channelId, ssrcInfo.getStream(), null, null);
 | 
	
		
			
				|  |  | -                                } catch (InvalidArgumentException | SipException | ParseException | SsrcTransactionNotFoundException e) {
 | 
	
		
			
				|  |  | -                                    logger.error("[命令发送失败] 停止点播, 发送BYE: {}", e.getMessage());
 | 
	
		
			
				|  |  | -                                    throw new ControllerException(ErrorCode.ERROR100.getCode(), "命令发送失败: " + e.getMessage());
 | 
	
		
			
				|  |  | -                                }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                                dynamicTask.stop(timeOutTaskKey);
 | 
	
		
			
				|  |  | -                                // 释放ssrc
 | 
	
		
			
				|  |  | -                                mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                                streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream());
 | 
	
		
			
				|  |  | -                                event.msg = "下级自定义了ssrc,重新设置收流信息失败";
 | 
	
		
			
				|  |  | -                                event.statusCode = 500;
 | 
	
		
			
				|  |  | -                                errorEvent.response(event);
 | 
	
		
			
				|  |  | +                        Boolean result = mediaServerService.updateRtpServerSSRC(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse);
 | 
	
		
			
				|  |  | +                        if (!result) {
 | 
	
		
			
				|  |  | +                            try {
 | 
	
		
			
				|  |  | +                                logger.warn("[停止点播] {}/{}", device.getDeviceId(), channelId);
 | 
	
		
			
				|  |  | +                                cmder.streamByeCmd(device, channelId, ssrcInfo.getStream(), null, null);
 | 
	
		
			
				|  |  | +                            } catch (InvalidArgumentException | SipException | ParseException | SsrcTransactionNotFoundException e) {
 | 
	
		
			
				|  |  | +                                logger.error("[命令发送失败] 停止点播, 发送BYE: {}", e.getMessage());
 | 
	
		
			
				|  |  | +                                throw new ControllerException(ErrorCode.ERROR100.getCode(), "命令发送失败: " + e.getMessage());
 | 
	
		
			
				|  |  |                              }
 | 
	
		
			
				|  |  | -                        });
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            dynamicTask.stop(timeOutTaskKey);
 | 
	
		
			
				|  |  | +                            // 释放ssrc
 | 
	
		
			
				|  |  | +                            mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                            streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream());
 | 
	
		
			
				|  |  | +                            event.msg = "下级自定义了ssrc,重新设置收流信息失败";
 | 
	
		
			
				|  |  | +                            event.statusCode = 500;
 | 
	
		
			
				|  |  | +                            errorEvent.response(event);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  | +//                        // 关闭rtp server
 | 
	
		
			
				|  |  | +//                        mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream(), result->{
 | 
	
		
			
				|  |  | +//                            if (result) {
 | 
	
		
			
				|  |  | +//                                // 重新开启ssrc server
 | 
	
		
			
				|  |  | +//                                mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), false, ssrcInfo.getPort(), true, device.getStreamModeForParam());
 | 
	
		
			
				|  |  | +//                            }else {
 | 
	
		
			
				|  |  | +//                                try {
 | 
	
		
			
				|  |  | +//                                    logger.warn("[停止点播] {}/{}", device.getDeviceId(), channelId);
 | 
	
		
			
				|  |  | +//                                    cmder.streamByeCmd(device, channelId, ssrcInfo.getStream(), null, null);
 | 
	
		
			
				|  |  | +//                                } catch (InvalidArgumentException | SipException | ParseException | SsrcTransactionNotFoundException e) {
 | 
	
		
			
				|  |  | +//                                    logger.error("[命令发送失败] 停止点播, 发送BYE: {}", e.getMessage());
 | 
	
		
			
				|  |  | +//                                    throw new ControllerException(ErrorCode.ERROR100.getCode(), "命令发送失败: " + e.getMessage());
 | 
	
		
			
				|  |  | +//                                }
 | 
	
		
			
				|  |  | +//
 | 
	
		
			
				|  |  | +//                                dynamicTask.stop(timeOutTaskKey);
 | 
	
		
			
				|  |  | +//                                // 释放ssrc
 | 
	
		
			
				|  |  | +//                                mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcInfo.getSsrc());
 | 
	
		
			
				|  |  | +//
 | 
	
		
			
				|  |  | +//                                streamSession.remove(device.getDeviceId(), channelId, ssrcInfo.getStream());
 | 
	
		
			
				|  |  | +//                                event.msg = "下级自定义了ssrc,重新设置收流信息失败";
 | 
	
		
			
				|  |  | +//                                event.statusCode = 500;
 | 
	
		
			
				|  |  | +//                                errorEvent.response(event);
 | 
	
		
			
				|  |  | +//                            }
 | 
	
		
			
				|  |  | +//                        });
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      }
 | 
	
	
		
			
				|  | @@ -519,7 +539,7 @@ public class PlayServiceImpl implements IPlayService {
 | 
	
		
			
				|  |  |          if (device == null) {
 | 
	
		
			
				|  |  |              throw new ControllerException(ErrorCode.ERROR100.getCode(), "设备: " + deviceId + "不存在");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        logger.info("[回放消息] deviceId: {}, channelId: {},收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  | +        logger.info("[回放消息] deviceId: {}, channelId: {},收流端口:{}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  |          PlayBackResult<StreamInfo> playBackResult = new PlayBackResult<>();
 | 
	
		
			
				|  |  |          String playBackTimeOutTaskKey = UUID.randomUUID().toString();
 | 
	
		
			
				|  |  |          dynamicTask.startDelay(playBackTimeOutTaskKey, () -> {
 | 
	
	
		
			
				|  | @@ -689,7 +709,7 @@ public class PlayServiceImpl implements IPlayService {
 | 
	
		
			
				|  |  |              throw new ControllerException(ErrorCode.ERROR400.getCode(), "设备:" + deviceId + "不存在");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          PlayBackResult<StreamInfo> downloadResult = new PlayBackResult<>();
 | 
	
		
			
				|  |  | -        logger.info("[录像下载] deviceId: {}, channelId: {},收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  | +        logger.info("[录像下载] deviceId: {}, channelId: {},收流端口:{}, 收流模式:{}, SSRC: {}, SSRC校验:{}", device.getDeviceId(), channelId, ssrcInfo.getPort(), device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
 | 
	
		
			
				|  |  |          String downLoadTimeOutTaskKey = UUID.randomUUID().toString();
 | 
	
		
			
				|  |  |          dynamicTask.startDelay(downLoadTimeOutTaskKey, () -> {
 | 
	
		
			
				|  |  |              logger.warn(String.format("录像下载请求超时,deviceId:%s ,channelId:%s", deviceId, channelId));
 |