Browse Source

默认推流通道始终在线

pull/437/head
648540858 2 years ago
parent
commit
fcf8c40150
  1. 11
      README.md
  2. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeTask.java
  3. 3
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java
  4. 3
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java
  5. 3
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java
  6. 4
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
  7. 1
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java
  8. 3
      src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java

11
README.md

@ -130,5 +130,14 @@ QQ私信一般不回, 精力有限.欢迎大家在群里讨论.觉得项目对
# 致谢 # 致谢
感谢作者[夏楚](https://github.com/xia-chu) 提供这么棒的开源流媒体服务框架 感谢作者[夏楚](https://github.com/xia-chu) 提供这么棒的开源流媒体服务框架,并在开发过程中给予支持与帮助。
感谢作者[dexter langhuihui](https://github.com/langhuihui) 开源这么好用的WEB播放器。
感谢作者[Kyle](https://gitee.com/kkkkk5G) 开源了好用的前端页面
感谢各位大佬的赞助以及对项目的指正与帮助。包括但不限于代码贡献、问题反馈、资金捐赠等各种方式的支持!以下排名不分先后:
[lawrencehj](https://github.com/lawrencehj) @陆丰-创奇科技 [swwhaha](https://github.com/swwheihei)
[hotcoffie](https://github.com/hotcoffie) [xiaomu](https://github.com/nikmu) [TristingChen](https://github.com/TristingChen)
[chenparty](https://github.com/chenparty) [Hotleave](https://github.com/hotleave) [ydwxb](https://github.com/ydwxb)
[ydpd](https://github.com/ydpd) [szy833](https://github.com/szy833) [ydwxb](https://github.com/ydwxb)
ps: 刚增加了这个名单,肯定遗漏了一些大佬,欢迎大佬联系我添加。

2
src/main/java/com/genersoft/iot/vmp/gb28181/task/impl/MobilePositionSubscribeTask.java

@ -56,8 +56,8 @@ public class MobilePositionSubscribeTask implements ISubscribeTask {
* COMPLETED-> Completed Dialog状态-已完成 * COMPLETED-> Completed Dialog状态-已完成
* TERMINATED-> Terminated Dialog状态-终止 * TERMINATED-> Terminated Dialog状态-终止
*/ */
logger.info("取消移动订阅时dialog状态为{}", dialog.getState());
if (dialog != null && dialog.getState().equals(DialogState.CONFIRMED)) { if (dialog != null && dialog.getState().equals(DialogState.CONFIRMED)) {
logger.info("取消移动订阅时dialog状态为{}", dialog.getState());
device.setSubscribeCycleForMobilePosition(0); device.setSubscribeCycleForMobilePosition(0);
sipCommander.mobilePositionSubscribe(device, dialog, eventResult -> { sipCommander.mobilePositionSubscribe(device, dialog, eventResult -> {
ResponseEvent event = (ResponseEvent) eventResult.event; ResponseEvent event = (ResponseEvent) eventResult.event;

3
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java

@ -137,6 +137,9 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
String deviceID = XmlUtil.getText(rootElement, "DeviceID"); String deviceID = XmlUtil.getText(rootElement, "DeviceID");
ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId); ParentPlatform platform = storager.queryParentPlatByServerGBId(platformId);
SubscribeInfo subscribeInfo = new SubscribeInfo(evt, platformId); SubscribeInfo subscribeInfo = new SubscribeInfo(evt, platformId);
if (platform == null) {
return;
}
if (evt.getServerTransaction() == null) { if (evt.getServerTransaction() == null) {
ServerTransaction serverTransaction = platform.getTransport().equals("TCP") ? tcpSipProvider.getNewServerTransaction(evt.getRequest()) ServerTransaction serverTransaction = platform.getTransport().equals("TCP") ? tcpSipProvider.getNewServerTransaction(evt.getRequest())
: udpSipProvider.getNewServerTransaction(evt.getRequest()); : udpSipProvider.getNewServerTransaction(evt.getRequest());

3
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/CatalogNotifyMessageHandler.java

@ -114,7 +114,8 @@ public class CatalogNotifyMessageHandler extends SIPRequestProcessorParent imple
deviceChannel.setLatitude(gbStream.getLatitude()); deviceChannel.setLatitude(gbStream.getLatitude());
deviceChannel.setDeviceId(parentPlatform.getDeviceGBId()); deviceChannel.setDeviceId(parentPlatform.getDeviceGBId());
deviceChannel.setManufacture("wvp-pro"); deviceChannel.setManufacture("wvp-pro");
deviceChannel.setStatus(gbStream.isStatus()?1:0); // deviceChannel.setStatus(gbStream.isStatus()?1:0);
deviceChannel.setStatus(1);
deviceChannel.setParentId(gbStream.getCatalogId()); deviceChannel.setParentId(gbStream.getCatalogId());
deviceChannel.setRegisterWay(1); deviceChannel.setRegisterWay(1);
deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6));

3
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/CatalogQueryMessageHandler.java

@ -125,7 +125,8 @@ public class CatalogQueryMessageHandler extends SIPRequestProcessorParent implem
deviceChannel.setLatitude(gbStream.getLatitude()); deviceChannel.setLatitude(gbStream.getLatitude());
deviceChannel.setDeviceId(parentPlatform.getDeviceGBId()); deviceChannel.setDeviceId(parentPlatform.getDeviceGBId());
deviceChannel.setManufacture("wvp-pro"); deviceChannel.setManufacture("wvp-pro");
deviceChannel.setStatus(gbStream.isStatus()?1:0); // deviceChannel.setStatus(gbStream.isStatus()?1:0);
deviceChannel.setStatus(1);
deviceChannel.setParentId(gbStream.getCatalogId()); deviceChannel.setParentId(gbStream.getCatalogId());
deviceChannel.setRegisterWay(1); deviceChannel.setRegisterWay(1);
deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6)); deviceChannel.setCivilCode(parentPlatform.getDeviceGBId().substring(0,6));

4
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java

@ -396,7 +396,7 @@ public class ZLMHttpHookListener {
} }
} }
if (gbStreams.size() > 0) { if (gbStreams.size() > 0) {
eventPublisher.catalogEventPublishForStream(null, gbStreams, CatalogEvent.ON); // eventPublisher.catalogEventPublishForStream(null, gbStreams, CatalogEvent.ON);
} }
}else { }else {
@ -408,7 +408,7 @@ public class ZLMHttpHookListener {
} }
GbStream gbStream = storager.getGbStream(app, streamId); GbStream gbStream = storager.getGbStream(app, streamId);
if (gbStream != null) { if (gbStream != null) {
eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF); // eventPublisher.catalogEventPublishForStream(null, gbStream, CatalogEvent.OFF);
} }
zlmMediaListManager.removeMedia(app, streamId); zlmMediaListManager.removeMedia(app, streamId);
} }

1
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java

@ -204,6 +204,7 @@ public class ZLMMediaListManager {
if (streamProxyItem == null) { if (streamProxyItem == null) {
result = storager.removeMedia(app, streamId); result = storager.removeMedia(app, streamId);
}else { }else {
// TODO 暂不设置为离线
result =storager.mediaOutline(app, streamId); result =storager.mediaOutline(app, streamId);
} }
return result; return result;

3
src/main/java/com/genersoft/iot/vmp/service/impl/GbStreamServiceImpl.java

@ -100,7 +100,8 @@ public class GbStreamServiceImpl implements IGbStreamService {
deviceChannel.setLatitude(gbStream.getLatitude()); deviceChannel.setLatitude(gbStream.getLatitude());
deviceChannel.setDeviceId(deviceGBId); deviceChannel.setDeviceId(deviceGBId);
deviceChannel.setManufacture("wvp-pro"); deviceChannel.setManufacture("wvp-pro");
deviceChannel.setStatus(gbStream.isStatus()?1:0); // deviceChannel.setStatus(gbStream.isStatus()?1:0);
deviceChannel.setStatus(1);
deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId); deviceChannel.setParentId(catalogId ==null?gbStream.getCatalogId():catalogId);
deviceChannel.setRegisterWay(1); deviceChannel.setRegisterWay(1);
deviceChannel.setCivilCode(deviceGBId.substring(0, 6)); deviceChannel.setCivilCode(deviceGBId.substring(0, 6));

Loading…
Cancel
Save