Browse Source

1.解决轮询内存增长过快问题

xingqiao 3 years ago
parent
commit
3c025a5ac0

+ 12 - 6
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/timeout/impl/TimeoutProcessorImpl.java

@@ -26,11 +26,17 @@ public class TimeoutProcessorImpl implements InitializingBean, ITimeoutProcessor
 
     @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) {
+            e.printStackTrace();
+        }
     }
 }