From 9f680a2e9e8560cf5f38acdc30335e51d88b2001 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期五, 26 八月 2022 18:03:09 +0800
Subject: [PATCH] 修复bug以及日志按照,错误/sip/数据库 分割

---
 src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
index c1811bf..29253e7 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/SipLayer.java
@@ -2,8 +2,10 @@
 
 import com.genersoft.iot.vmp.conf.SipConfig;
 import com.genersoft.iot.vmp.gb28181.transmit.ISIPProcessorObserver;
+import com.genersoft.iot.vmp.utils.DateUtil;
 import gov.nist.javax.sip.SipProviderImpl;
 import gov.nist.javax.sip.SipStackImpl;
+import org.apache.commons.lang3.time.DateFormatUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +15,7 @@
 import org.springframework.stereotype.Component;
 
 import javax.sip.*;
+import java.text.DateFormat;
 import java.util.Properties;
 import java.util.TooManyListenersException;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -52,7 +55,9 @@
 		 * 瀹屾暣閰嶇疆鍙傝�� gov.nist.javax.sip.SipStackImpl锛岄渶瑕佷笅杞芥簮鐮�
 		 * gov/nist/javax/sip/SipStackImpl.class
 		 */
-		properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
+		if (logger.isDebugEnabled()) {
+			properties.setProperty("gov.nist.javax.sip.LOG_MESSAGE_CONTENT", "true");
+		}
 		// 鎺ユ敹鎵�鏈塶otify璇锋眰锛屽嵆浣挎病鏈夎闃�
 		properties.setProperty("gov.nist.javax.sip.DELIVER_UNSOLICITED_NOTIFY", "true");
 		// 涓篲NULL _瀵硅瘽妗嗕紶閫抇缁堟鐨刜浜嬩欢
@@ -67,9 +72,10 @@
 		 * 0; public static final int TRACE_MESSAGES = 16; public static final int
 		 * TRACE_EXCEPTION = 17; public static final int TRACE_DEBUG = 32;
 		 */
-		properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "0");
-		properties.setProperty("gov.nist.javax.sip.SERVER_LOG", "sip_server_log");
-		properties.setProperty("gov.nist.javax.sip.DEBUG_LOG", "sip_debug_log");
+		if (logger.isDebugEnabled()) {
+			properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "DEBUG");
+		}
+		properties.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "INFO");
 		sipStack = (SipStackImpl) sipFactory.createSipStack(properties);
 
 		return sipStack;

--
Gitblit v1.8.0