From 42a2772d1aa7493bcc4fac3e24ee8eda4eebc23d Mon Sep 17 00:00:00 2001
From: xubinbin <1323875150@qq.com>
Date: 星期二, 12 十二月 2023 17:09:04 +0800
Subject: [PATCH] bugfix:请求头带token, SecurityUtils 获取用户id 一直为0 #1195

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java
old mode 100644
new mode 100755
index 4165004..531505d
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java
@@ -1,8 +1,11 @@
 package com.genersoft.iot.vmp.gb28181.transmit.event.timeout.impl;
 
+import com.genersoft.iot.vmp.conf.SystemInfoTimerTask;
 import com.genersoft.iot.vmp.gb28181.event.SipSubscribe;
 import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
 import com.genersoft.iot.vmp.gb28181.transmit.event.timeout.ITimeoutProcessor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -12,6 +15,8 @@
 
 @Component
 public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor {
+
+    private Logger logger = LoggerFactory.getLogger(TimeoutProcessorImpl.class);
 
     @Autowired
     private SIPProcessorObserver processorObserver;
@@ -26,11 +31,17 @@
 
     @Override
     public void process(TimeoutEvent event) {
-        // TODO Auto-generated method stub
-        CallIdHeader callIdHeader = event.getClientTransaction().getDialog().getCallId();
-        String callId = callIdHeader.getCallId();
-        SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId);
-        SipSubscribe.EventResult<TimeoutEvent> timeoutEventEventResult = new SipSubscribe.EventResult<>(event);
-        errorSubscribe.response(timeoutEventEventResult);
+        try {
+            // TODO Auto-generated method stub
+            CallIdHeader callIdHeader = event.getClientTransaction().getDialog().getCallId();
+            String callId = callIdHeader.getCallId();
+            SipSubscribe.Event errorSubscribe = sipSubscribe.getErrorSubscribe(callId);
+            SipSubscribe.EventResult<TimeoutEvent> timeoutEventEventResult = new SipSubscribe.EventResult<>(event);
+            errorSubscribe.response(timeoutEventEventResult);
+            sipSubscribe.removeErrorSubscribe(callId);
+            sipSubscribe.removeOkSubscribe(callId);
+        } catch (Exception e) {
+            logger.error("[瓒呮椂浜嬩欢澶辫触]: {}", e.getMessage());
+        }
     }
 }

--
Gitblit v1.8.0