From c551164c89f70e664b498c3a09e615928261e01a Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期六, 01 七月 2023 18:33:42 +0800
Subject: [PATCH] 合并主线

---
 src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java
index 0fc056c..fbc1ee9 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/utils/SipUtils.java
@@ -125,7 +125,7 @@
         strTmp = String.format("%02X", moveSpeed);
         builder.append(strTmp, 0, 2);
         builder.append(strTmp, 0, 2);
-        
+
         //浼樺寲zoom浣庡�嶉�熶笅鐨勫彉鍊嶉�熺巼
         if ((zoomSpeed > 0) && (zoomSpeed <16))
         {
@@ -140,6 +140,26 @@
         return builder.toString();
     }
 
+    public static String getNewCallId() {
+        return (int) Math.floor(Math.random() * 1000000000) + "";
+    }
+
+    public static int getTypeCodeFromGbCode(String deviceId) {
+        if (ObjectUtils.isEmpty(deviceId)) {
+            return 0;
+        }
+        return Integer.parseInt(deviceId.substring(10, 13));
+    }
+
+    /**
+     * 鍒ゆ柇鏄惁鏄墠绔鍥磋澶�
+     * @param deviceId
+     * @return
+     */
+    public static boolean isFrontEnd(String deviceId) {
+        int typeCodeFromGbCode = getTypeCodeFromGbCode(deviceId);
+        return typeCodeFromGbCode > 130 && typeCodeFromGbCode < 199;
+    }
     /**
      * 浠庤姹備腑鑾峰彇璁惧ip鍦板潃鍜岀鍙e彿
      * @param request 璇锋眰
@@ -263,4 +283,4 @@
         }
         return localDateTime.format(DateUtil.formatterISO8601);
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0