Browse Source

重启服务时上级平台直接注销再注册

648540858 3 years ago
parent
commit
a6f9c090cb
1 changed files with 5 additions and 10 deletions
  1. 5 10
      src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java

+ 5 - 10
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java

@@ -46,17 +46,12 @@ public class SipPlatformRunner implements CommandLineRunner {
             parentPlatformCatch.setParentPlatform(parentPlatform);
             parentPlatformCatch.setId(parentPlatform.getServerGBId());
             redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
-            if (parentPlatform.isStatus()) {
-                // 设置所有平台离线
-                platformService.offline(parentPlatform);
-                // 取消订阅
-                sipCommanderForPlatform.unregister(parentPlatform, null, (eventResult)->{
-                    platformService.login(parentPlatform);
-                });
-            }else {
+            // 设置所有平台离线
+            platformService.offline(parentPlatform);
+            // 取消订阅
+            sipCommanderForPlatform.unregister(parentPlatform, null, (eventResult)->{
                 platformService.login(parentPlatform);
-            }
-
+            });
         }
     }
 }