From 8cfff8db97b7e51578424b6a202ae80cd56923a2 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 28 Jan 2022 16:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E7=A9=BA=E6=8C=87=E9=92=88=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java | 1 + .../iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java index d65e6305..ee237c0c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/SIPRequestHeaderProvider.java @@ -225,6 +225,7 @@ public class SIPRequestHeaderProvider { public Request createInfoRequest(Device device, StreamInfo streamInfo, String content, Long cseq) throws PeerUnavailableException, ParseException, InvalidArgumentException { Request request = null; + if (streamInfo == null) return null; Dialog dialog = streamSession.getDialog(streamInfo.getDeviceID(), streamInfo.getChannelId()); SipURI requestLine = sipFactory.createAddressFactory().createSipURI(device.getDeviceId(), diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index cb4cbd74..29f8c058 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -1589,6 +1589,9 @@ public class SIPCommander implements ISIPCommander { content.append("CSeq: " + cseq + "\r\n"); content.append("PauseTime: now\r\n"); Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq); + if (request == null) { + return; + } logger.info(request.toString()); ClientTransaction clientTransaction = null; if ("TCP".equals(device.getTransport())) { @@ -1617,6 +1620,7 @@ public class SIPCommander implements ISIPCommander { content.append("CSeq: " + cseq + "\r\n"); content.append("Range: npt=now-\r\n"); Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq); + if (request == null) return; logger.info(request.toString()); ClientTransaction clientTransaction = null; if ("TCP".equals(device.getTransport())) { @@ -1645,6 +1649,7 @@ public class SIPCommander implements ISIPCommander { content.append("Range: npt=" + Math.abs(seekTime) + "-\r\n"); Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq); + if (request == null) return; logger.info(request.toString()); ClientTransaction clientTransaction = null; if ("TCP".equals(device.getTransport())) { @@ -1672,6 +1677,7 @@ public class SIPCommander implements ISIPCommander { content.append("CSeq: " + cseq + "\r\n"); content.append("Scale: " + String.format("%.1f",speed) + "\r\n"); Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString(), cseq); + if (request == null) return; logger.info(request.toString()); ClientTransaction clientTransaction = null; if ("TCP".equals(device.getTransport())) {