From 1af77ab5f7c11a4b3d59c1989b51b9fca29679ce Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 18 十月 2022 22:18:49 +0800
Subject: [PATCH] Merge pull request #645 from IKangXu/wvp-28181-2.0

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java
index 67d26d7..991636e 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java
@@ -11,6 +11,7 @@
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
 import com.genersoft.iot.vmp.utils.DateUtil;
+import gov.nist.javax.sip.message.SIPRequest;
 import org.dom4j.DocumentException;
 import org.dom4j.Element;
 import org.slf4j.Logger;
@@ -58,7 +59,7 @@
 
     private boolean taskQueueHandlerRun = false;
 
-    private final ConcurrentLinkedQueue<SipMsgInfo> taskQueue = new ConcurrentLinkedQueue<>();
+    private ConcurrentLinkedQueue<SipMsgInfo> taskQueue = new ConcurrentLinkedQueue<>();
 
     @Qualifier("taskExecutor")
     @Autowired
@@ -81,9 +82,13 @@
                     try {
                         Element rootElementAfterCharset = getRootElement(sipMsgInfo.getEvt(), sipMsgInfo.getDevice().getCharset());
                         if (rootElementAfterCharset == null) {
-                            logger.warn("[ 绉诲姩璁惧浣嶇疆鏁版嵁閫氱煡 ] content cannot be null, {}", sipMsgInfo.getEvt().getRequest());
-                            responseAck(getServerTransaction(sipMsgInfo.getEvt()), Response.BAD_REQUEST);
-                            return;
+                            try {
+                                logger.warn("[ 绉诲姩璁惧浣嶇疆鏁版嵁閫氱煡 ] content cannot be null, {}", sipMsgInfo.getEvt().getRequest());
+                                responseAck((SIPRequest) sipMsgInfo.getEvt().getRequest(), Response.BAD_REQUEST);
+                            } catch (SipException | InvalidArgumentException | ParseException e) {
+                                logger.error("[鍛戒护鍙戦�佸け璐 绉诲姩璁惧浣嶇疆鏁版嵁閫氱煡 鍐呭涓虹┖: {}", e.getMessage());
+                            }
+                            continue;
                         }
                         MobilePosition mobilePosition = new MobilePosition();
                         mobilePosition.setCreateTime(DateUtil.getNow());
@@ -133,7 +138,11 @@
                         }
                         storager.updateChannelPosition(deviceChannel);
                         //鍥炲 200 OK
-                        responseAck(getServerTransaction(sipMsgInfo.getEvt()), Response.OK);
+                        try {
+                            responseAck((SIPRequest) sipMsgInfo.getEvt().getRequest(), Response.OK);
+                        } catch (SipException | InvalidArgumentException | ParseException e) {
+                            logger.error("[鍛戒护鍙戦�佸け璐 绉诲姩璁惧浣嶇疆鏁版嵁鍥炲200: {}", e.getMessage());
+                        }
 
                         // 鍙戦�乺edis娑堟伅銆� 閫氱煡浣嶇疆淇℃伅鐨勫彉鍖�
                         JSONObject jsonObject = new JSONObject();
@@ -147,7 +156,7 @@
                         jsonObject.put("speed", mobilePosition.getSpeed());
                         redisCatchStorage.sendMobilePositionMsg(jsonObject);
 
-                    } catch (DocumentException | SipException | InvalidArgumentException | ParseException e) {
+                    } catch (DocumentException e) {
                         e.printStackTrace();
                     }
 

--
Gitblit v1.8.0