Commit 912c83dfd31283631e4f7a1bd88d387baa6a16d4

Authored by 648540858
1 parent 97dc926b

添加日志

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
@@ -115,7 +115,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In @@ -115,7 +115,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
115 115
116 // 收流端发送的停止 116 // 收流端发送的停止
117 if (sendRtpItem != null){ 117 if (sendRtpItem != null){
118 - logger.info("[收到bye] 来自{},停止通道:{}, 类型: {}", sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getPlayType()); 118 + logger.info("[收到bye] 来自{},停止通道:{}, 类型: {}, callId: {}", sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getPlayType(), callIdHeader.getCallId());
119 119
120 String streamId = sendRtpItem.getStream(); 120 String streamId = sendRtpItem.getStream();
121 Map<String, Object> param = new HashMap<>(); 121 Map<String, Object> param = new HashMap<>();
@@ -123,7 +123,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In @@ -123,7 +123,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
123 param.put("app",sendRtpItem.getApp()); 123 param.put("app",sendRtpItem.getApp());
124 param.put("stream",streamId); 124 param.put("stream",streamId);
125 param.put("ssrc",sendRtpItem.getSsrc()); 125 param.put("ssrc",sendRtpItem.getSsrc());
126 - logger.info("[收到bye] 停止推流:{}", streamId); 126 + logger.info("[收到bye] 停止推流:{}, 媒体节点: {}", streamId, sendRtpItem.getMediaServerId());
127 MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); 127 MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId());
128 redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), 128 redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(),
129 callIdHeader.getCallId(), null); 129 callIdHeader.getCallId(), null);
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
@@ -581,7 +581,7 @@ public class ZLMHttpHookListener { @@ -581,7 +581,7 @@ public class ZLMHttpHookListener {
581 if (redisCatchStorage.isChannelSendingRTP(inviteInfo.getChannelId())) { 581 if (redisCatchStorage.isChannelSendingRTP(inviteInfo.getChannelId())) {
582 List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByChnnelId( 582 List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServerByChnnelId(
583 inviteInfo.getChannelId()); 583 inviteInfo.getChannelId());
584 - if (sendRtpItems.size() > 0) { 584 + if (!sendRtpItems.isEmpty()) {
585 for (SendRtpItem sendRtpItem : sendRtpItems) { 585 for (SendRtpItem sendRtpItem : sendRtpItems) {
586 ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId()); 586 ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
587 try { 587 try {
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
@@ -289,6 +289,10 @@ public class ZLMServerFactory { @@ -289,6 +289,10 @@ public class ZLMServerFactory {
289 * 调用zlm RESTful API —— stopSendRtp 289 * 调用zlm RESTful API —— stopSendRtp
290 */ 290 */
291 public Boolean stopSendRtpStream(MediaServerItem mediaServerItem, Map<String, Object>param) { 291 public Boolean stopSendRtpStream(MediaServerItem mediaServerItem, Map<String, Object>param) {
  292 + if (mediaServerItem == null) {
  293 + logger.error("[停止RTP推流] 失败: 媒体节点为NULL");
  294 + return false;
  295 + }
292 Boolean result = false; 296 Boolean result = false;
293 JSONObject jsonObject = zlmresTfulUtils.stopSendRtp(mediaServerItem, param); 297 JSONObject jsonObject = zlmresTfulUtils.stopSendRtp(mediaServerItem, param);
294 if (jsonObject == null) { 298 if (jsonObject == null) {
src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java
@@ -269,6 +269,8 @@ public class DeviceServiceImpl implements IDeviceService { @@ -269,6 +269,8 @@ public class DeviceServiceImpl implements IDeviceService {
269 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForCatalog(),30); 269 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForCatalog(),30);
270 // 设置最小值为30 270 // 设置最小值为30
271 dynamicTask.startCron(device.getDeviceId() + "catalog", catalogSubscribeTask, (subscribeCycleForCatalog -1) * 1000); 271 dynamicTask.startCron(device.getDeviceId() + "catalog", catalogSubscribeTask, (subscribeCycleForCatalog -1) * 1000);
  272 +
  273 + catalogSubscribeTask.run();
272 return true; 274 return true;
273 } 275 }
274 276
@@ -302,6 +304,7 @@ public class DeviceServiceImpl implements IDeviceService { @@ -302,6 +304,7 @@ public class DeviceServiceImpl implements IDeviceService {
302 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30); 304 int subscribeCycleForCatalog = Math.max(device.getSubscribeCycleForMobilePosition(),30);
303 // 刷新订阅 305 // 刷新订阅
304 dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog * 1000); 306 dynamicTask.startCron(device.getDeviceId() + "mobile_position" , mobilePositionSubscribeTask, subscribeCycleForCatalog * 1000);
  307 + mobilePositionSubscribeTask.run();
305 return true; 308 return true;
306 } 309 }
307 310