From 07a8ef9e256c70a3a5b15782add81dcad1e2ffc2 Mon Sep 17 00:00:00 2001
From: panlinlin <648540858@qq.com>
Date: 星期五, 14 六月 2024 00:03:57 +0800
Subject: [PATCH] SIP只有一个监听时,直接返回

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java
index bc43a3a..f3f7431 100755
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java
@@ -3,9 +3,9 @@
 import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
 import com.genersoft.iot.vmp.gb28181.transmit.SIPSender;
 import com.genersoft.iot.vmp.gb28181.utils.SipUtils;
+import com.google.common.primitives.Bytes;
 import gov.nist.javax.sip.message.SIPRequest;
 import gov.nist.javax.sip.message.SIPResponse;
-import org.apache.commons.lang3.ArrayUtils;
 import org.dom4j.Document;
 import org.dom4j.DocumentException;
 import org.dom4j.Element;
@@ -171,6 +171,7 @@
 		return getRootElement(evt, "gb2312");
 	}
 	public Element getRootElement(RequestEvent evt, String charset) throws DocumentException {
+
 		if (charset == null) {
 			charset = "gb2312";
 		}
@@ -203,15 +204,14 @@
 				result.add(rawContent[i]);
 			}
 		}
-		Byte[] bytes = new Byte[0];
-		byte[] bytesResult = ArrayUtils.toPrimitive(result.toArray(bytes));
+		byte[] bytesResult = Bytes.toArray(result);
 
 		Document xml;
 		try {
 			xml = reader.read(new ByteArrayInputStream(bytesResult));
 		}catch (DocumentException e) {
-			logger.warn("[xml瑙f瀽寮傚父]锛� 鎰挎枃濡備笅锛� \r\n{}", new String(bytesResult));
-			logger.warn("[xml瑙f瀽寮傚父]锛� 鎰挎枃濡備笅锛� 灏濊瘯鍏煎鎬у鐞�");
+			logger.warn("[xml瑙f瀽寮傚父]锛� 鍘熸枃濡備笅锛� \r\n{}", new String(bytesResult));
+			logger.warn("[xml瑙f瀽寮傚父]锛� 鍘熸枃濡備笅锛� 灏濊瘯鍏煎鎬у鐞�");
 			String[] xmlLineArray = new String(bytesResult).split("\\r?\\n");
 
 			// 鍏煎娴峰悍鐨刟ddress瀛楁甯︽湁<鐮存崲xml缁撴瀯瀵艰嚧鏃犳硶瑙f瀽xml鐨勯棶棰�

--
Gitblit v1.8.0