From 21eef022b567ad80e577916b79c663593bb1004e Mon Sep 17 00:00:00 2001 From: 648540858 <18010473990@163.com> Date: Fri, 10 Sep 2021 11:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BA=A7=E8=81=94=E7=82=B9?= =?UTF-8?q?=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transmit/request/impl/InviteRequestProcessor.java | 8 ++++++-- .../genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java index fcc14871..3014b2d6 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/InviteRequestProcessor.java @@ -385,7 +385,9 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor { Response response = getMessageFactory().createResponse(statusCode, evt.getRequest()); ServerTransaction serverTransaction = getServerTransaction(evt); serverTransaction.sendResponse(response); - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + if (statusCode >= 200) { + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + } } private void responseAck(RequestEvent evt, int statusCode, String msg) throws SipException, InvalidArgumentException, ParseException { @@ -393,7 +395,9 @@ public class InviteRequestProcessor extends SIPRequestAbstractProcessor { response.setReasonPhrase(msg); ServerTransaction serverTransaction = getServerTransaction(evt); serverTransaction.sendResponse(response); - if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + if (statusCode >= 200) { + if (serverTransaction.getDialog() != null) serverTransaction.getDialog().delete(); + } } /** diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index 35931022..bd564015 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -229,6 +229,7 @@ public class ZLMRTPServerFactory { */ public int totalReaderCount(MediaServerItem mediaServerItem, String app, String streamId) { JSONObject mediaInfo = zlmresTfulUtils.getMediaInfo(mediaServerItem, app, "rtmp", streamId); + if (mediaInfo == null) return 0; return mediaInfo.getInteger("totalReaderCount"); }