Browse Source

修复启动报错

pull/446/head
648540858 3 years ago
parent
commit
c3b47fa734
  1. 2
      src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java
  2. 3
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java
  3. 4
      src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java

2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/SIPProcessorObserver.java

@ -72,7 +72,7 @@ public class SIPProcessorObserver implements ISIPProcessorObserver {
@Override
@Async
public void processRequest(RequestEvent requestEvent) {
logger.info("\n收到请求:\n{}", requestEvent.getRequest());
logger.debug("\n收到请求:\n{}", requestEvent.getRequest());
String method = requestEvent.getRequest().getMethod();
ISIPRequestProcessor sipRequestProcessor = requestProcessorMap.get(method);
if (sipRequestProcessor == null) {

3
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java

@ -40,8 +40,7 @@ public class ZLMHttpHookSubscribe {
private Map<HookType, Map<JSONObject, ZLMHttpHookSubscribe.Event>> allSubscribes = new ConcurrentHashMap<>();
public void addSubscribe(HookType type, JSONObject hookResponse, ZLMHttpHookSubscribe.Event event) {
allSubscribes.computeIfAbsent(type, k -> new ConcurrentHashMap<>())
.put(hookResponse, event);
allSubscribes.computeIfAbsent(type, k -> new ConcurrentHashMap<>()).put(hookResponse, event);
}
public ZLMHttpHookSubscribe.Event getSubscribe(HookType type, JSONObject hookResponse) {

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

@ -67,7 +67,7 @@ public class ZLMRunner implements CommandLineRunner {
}
mediaServerService.syncCatchFromDatabase();
// 订阅 zlm启动事件, 新的zlm也会从这里进入系统
hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_started,null,
hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_started,new JSONObject(),
(MediaServerItem mediaServerItem, JSONObject response)->{
ZLMServerConfig zlmServerConfig = JSONObject.toJavaObject(response, ZLMServerConfig.class);
if (zlmServerConfig !=null ) {
@ -79,7 +79,7 @@ public class ZLMRunner implements CommandLineRunner {
});
// 订阅 zlm保活事件, 当zlm离线时做业务的处理
hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_keepalive,null,
hookSubscribe.addSubscribe(ZLMHttpHookSubscribe.HookType.on_server_keepalive,new JSONObject(),
(MediaServerItem mediaServerItem, JSONObject response)->{
String mediaServerId = response.getString("mediaServerId");
if (mediaServerId !=null ) {

Loading…
Cancel
Save