Browse Source

Merge remote-tracking branch 'origin/wvp-28181-2.0' into wvp-28181-2.0

648540858 2 years ago
parent
commit
cef04a8b5a
1 changed files with 7 additions and 4 deletions
  1. 7 4
      src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java

+ 7 - 4
src/main/java/com/genersoft/iot/vmp/conf/SipPlatformRunner.java

@@ -48,10 +48,13 @@ public class SipPlatformRunner implements CommandLineRunner {
             parentPlatformCatch.setParentPlatform(parentPlatform);
             parentPlatformCatch.setId(parentPlatform.getServerGBId());
             redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
-            // 取消订阅
-            sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
-                platformService.login(parentPlatform);
-            });
+            if (parentPlatformCatchOld != null) {
+                // 取消订阅
+                sipCommanderForPlatform.unregister(parentPlatform, parentPlatformCatchOld.getSipTransactionInfo(), null, (eventResult)->{
+                    platformService.login(parentPlatform);
+                });
+            }
+
             // 设置所有平台离线
             platformService.offline(parentPlatform, true);
         }