Commit 6ba8ab22b54e83d0e0edabb9d0fdc8870b86e98f
1 parent
e8090bc8
修复推流生成通道未通知上级平台的问题,添加注册时清楚脏数据。
Showing
2 changed files
with
10 additions
and
3 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| ... | ... | @@ -90,8 +90,13 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen |
| 90 | 90 | AddressImpl address = (AddressImpl) fromHeader.getAddress(); |
| 91 | 91 | SipUri uri = (SipUri) address.getURI(); |
| 92 | 92 | String deviceId = uri.getUser(); |
| 93 | - Device device = redisCatchStorage.getDevice(deviceId); | |
| 94 | - AuthorizationHeader authorhead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); | |
| 93 | + Device deviceInRedis = redisCatchStorage.getDevice(deviceId); | |
| 94 | + Device device = storager.queryVideoDevice(deviceId); | |
| 95 | + if (deviceInRedis != null && device == null) { | |
| 96 | + // redis 存在脏数据 | |
| 97 | + redisCatchStorage.clearCatchByDeviceId(deviceId); | |
| 98 | + } | |
| 99 | + AuthorizationHeader authorhead = (AuthorizationHeader) request.getHeader(AuthorizationHeader.NAME); | |
| 95 | 100 | // 校验密码是否正确 |
| 96 | 101 | if (authorhead != null) { |
| 97 | 102 | passwordCorrect = new DigestServerAuthenticationHelper().doAuthenticatePlainTextPassword(request, | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| ... | ... | @@ -814,9 +814,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { |
| 814 | 814 | streamPushItem.setCatalogId(parentPlatform.getCatalogId()); |
| 815 | 815 | streamPushItem.setPlatformId(parentPlatform.getServerGBId()); |
| 816 | 816 | String stream = streamPushItem.getStream(); |
| 817 | - StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, parentPlatform.getServerGBId()); | |
| 817 | + StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, | |
| 818 | + parentPlatform.getServerGBId()); | |
| 818 | 819 | if (streamProxyItems == null) { |
| 819 | 820 | platformGbStreamMapper.add(streamPushItem); |
| 821 | + eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); | |
| 820 | 822 | } |
| 821 | 823 | } |
| 822 | 824 | } | ... | ... |