From 4bda14b098bc943324c73a8365c8bcd721beaa5a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 08 九月 2022 15:27:47 +0800
Subject: [PATCH] 修复cseq序号回退

---
 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
index d078cb1..d58f778 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
@@ -436,6 +436,8 @@
             e.printStackTrace();
         } catch (IllegalAccessException e) {
             e.printStackTrace();
+        } catch (InvalidArgumentException e) {
+            e.printStackTrace();
         }
         return true;
     }
@@ -477,7 +479,7 @@
             e.printStackTrace();
             return false;
         } catch (InvalidArgumentException e) {
-            throw new RuntimeException(e);
+            e.printStackTrace();
         }
         return true;
     }
@@ -516,13 +518,15 @@
             e.printStackTrace();
         } catch (IllegalAccessException e) {
             e.printStackTrace();
+        } catch (InvalidArgumentException e) {
+            e.printStackTrace();
         }
         return true;
     }
 
     private void sendNotify(ParentPlatform parentPlatform, String catalogXmlContent,
                                    SubscribeInfo subscribeInfo, SipSubscribe.Event errorEvent,  SipSubscribe.Event okEvent )
-            throws NoSuchFieldException, IllegalAccessException, SipException, ParseException {
+            throws NoSuchFieldException, IllegalAccessException, SipException, ParseException, InvalidArgumentException {
 		MessageFactoryImpl messageFactory = (MessageFactoryImpl) sipFactory.createMessageFactory();
         String characterSet = parentPlatform.getCharacterSet();
  		// 璁剧疆缂栫爜锛� 闃叉涓枃涔辩爜
@@ -532,6 +536,9 @@
             return;
         }
         SIPRequest notifyRequest = (SIPRequest)dialog.createRequest(Request.NOTIFY);
+
+        notifyRequest.getCSeqHeader().setSeqNumber(redisCatchStorage.getCSEQ());
+        
         ContentTypeHeader contentTypeHeader = sipFactory.createHeaderFactory().createContentTypeHeader("Application", "MANSCDP+xml");
         notifyRequest.setContent(catalogXmlContent, contentTypeHeader);
 
@@ -663,6 +670,8 @@
         } catch (NoSuchFieldException e) {
             e.printStackTrace();
         } catch (IllegalAccessException e) {
+            e.printStackTrace();
+        } catch (InvalidArgumentException e) {
             e.printStackTrace();
         }
 
@@ -818,9 +827,9 @@
             e.printStackTrace();
             return false;
         } catch (NoSuchFieldException e) {
-            throw new RuntimeException(e);
+            e.printStackTrace();
         } catch (IllegalAccessException e) {
-            throw new RuntimeException(e);
+            e.printStackTrace();
         }
         return true;
 

--
Gitblit v1.8.0