Commit c9f091d560a17b09bb55284629055ad940c1b90c
Committed by
GitHub
Merge pull request #419 from nikmu/wvp-28181-2.0
目录订阅推送问题,在线事件发送问题
Showing
2 changed files
with
7 additions
and
5 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/event/subscribe/catalog/CatalogEventLister.java
| ... | ... | @@ -153,16 +153,18 @@ public class CatalogEventLister implements ApplicationListener<CatalogEvent> { |
| 153 | 153 | List<ParentPlatform> parentPlatforms = parentPlatformMap.get(gbId); |
| 154 | 154 | if (parentPlatforms != null && parentPlatforms.size() > 0) { |
| 155 | 155 | for (ParentPlatform platform : parentPlatforms) { |
| 156 | - SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(event.getPlatformId()); | |
| 156 | + SubscribeInfo subscribeInfo = subscribeHolder.getCatalogSubscribe(platform.getServerGBId()); | |
| 157 | 157 | if (subscribeInfo == null) continue; |
| 158 | 158 | logger.info("[Catalog事件: {}]平台:{},影响通道{}", event.getType(), platform.getServerGBId(), gbId); |
| 159 | 159 | List<DeviceChannel> deviceChannelList = new ArrayList<>(); |
| 160 | 160 | DeviceChannel deviceChannel = storager.queryChannelInParentPlatform(platform.getServerGBId(), gbId); |
| 161 | 161 | deviceChannelList.add(deviceChannel); |
| 162 | 162 | GbStream gbStream = storager.queryStreamInParentPlatform(platform.getServerGBId(), gbId); |
| 163 | - DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform.getDeviceGBId()); | |
| 164 | - deviceChannelList.add(deviceChannelByStream); | |
| 165 | - sipCommanderFroPlatform.sendNotifyForCatalogOther(event.getType(), platform, deviceChannelList, subscribeInfo, null); | |
| 163 | + if(gbStream != null){ | |
| 164 | + DeviceChannel deviceChannelByStream = gbStreamService.getDeviceChannelListByStream(gbStream, gbStream.getCatalogId(), platform.getDeviceGBId()); | |
| 165 | + deviceChannelList.add(deviceChannelByStream); | |
| 166 | + } | |
| 167 | + sipCommanderFroPlatform.sendNotifyForCatalogAddOrUpdate(event.getType(), platform, deviceChannelList, subscribeInfo, null); | |
| 166 | 168 | } |
| 167 | 169 | } |
| 168 | 170 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
| ... | ... | @@ -327,7 +327,7 @@ public class NotifyRequestProcessor extends SIPRequestProcessorParent implements |
| 327 | 327 | |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | - if (offLineDetector.isOnline(deviceId)) { | |
| 330 | + if (!offLineDetector.isOnline(deviceId)) { | |
| 331 | 331 | publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_MESSAGE); |
| 332 | 332 | } |
| 333 | 333 | } | ... | ... |