From 0e826e3448a21bcb68f52b3e87ecb00d3070d977 Mon Sep 17 00:00:00 2001
From: chenjialing <595168663@qq.com>
Date: 星期三, 15 六月 2022 14:14:29 +0800
Subject: [PATCH] 优化--端口获取失败之时(如zlm连接失败),不进行invite点播消息的发送

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
index 2723da4..75b4114 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
@@ -188,8 +188,8 @@
 					startTime = startTimeFiled.getStartTime();
 					stopTime = startTimeFiled.getStopTime();
 
-					start = Instant.ofEpochMilli(startTime*1000);
-					end = Instant.ofEpochMilli(stopTime*1000);
+					start = Instant.ofEpochSecond(startTime);
+					end = Instant.ofEpochSecond(stopTime);
 				}
 				//  鑾峰彇鏀寔鐨勬牸寮�
 				Vector mediaDescriptions = sdp.getMediaDescriptions(true);
@@ -235,7 +235,7 @@
 				String username = sdp.getOrigin().getUsername();
 				String addressStr = sdp.getOrigin().getAddress();
 
-				logger.info("[涓婄骇鐐规挱]鐢ㄦ埛锛歿}锛� 鍦板潃锛歿}:{}锛� ssrc锛歿}", username, addressStr, port, ssrc);
+				logger.info("[涓婄骇鐐规挱]鐢ㄦ埛锛歿}锛� 閫氶亾锛歿}, 鍦板潃锛歿}:{}锛� ssrc锛歿}", username, channelId, addressStr, port, ssrc);
 				Device device  = null;
 				// 閫氳繃 channel 鍜� gbStream 鏄惁涓簄ull 鍊煎垽鏂潵婧愭槸鐩存挱娴佸悎閫傚浗鏍�
 				if (channel != null) {
@@ -264,10 +264,7 @@
 					}
 					sendRtpItem.setCallId(callIdHeader.getCallId());
 					sendRtpItem.setPlayType("Play".equals(sessionName)?InviteStreamType.PLAY:InviteStreamType.PLAYBACK);
-					byte[] dialogByteArray = SerializeUtils.serialize(evt.getDialog());
-					sendRtpItem.setDialog(dialogByteArray);
-					byte[] transactionByteArray = SerializeUtils.serialize(evt.getServerTransaction());
-					sendRtpItem.setTransaction(transactionByteArray);
+
 					Long finalStartTime = startTime;
 					Long finalStopTime = stopTime;
 					ZLMHttpHookSubscribe.Event hookEvent = (mediaServerItemInUSe, responseJSON)->{
@@ -372,11 +369,12 @@
 							if (mediaServerItem.isRtpEnable()) {
 								streamId = String.format("%s_%s", device.getDeviceId(), channelId);
 							}
-							SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, true, false);
+							SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false);
 							sendRtpItem.setStreamId(ssrcInfo.getStream());
 							// 鍐欏叆redis锛� 瓒呮椂鏃跺洖澶�
 							redisCatchStorage.updateSendRTPSever(sendRtpItem);
 							playService.play(mediaServerItem, ssrcInfo, device, channelId, hookEvent, errorEvent, (code, msg)->{
+								logger.info("[涓婄骇鐐规挱]瓒呮椂, 鐢ㄦ埛锛歿}锛� 閫氶亾锛歿}", username, channelId);
 								redisCatchStorage.deleteSendRTPServer(platform.getServerGBId(), channelId, callIdHeader.getCallId(), null);
 							}, null);
 						}else {

--
Gitblit v1.8.0