mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-29 21:47:50 +08:00
Compare commits
No commits in common. "bc1b5797e8e4d4841ef069bd5cc8d61f2fab0437" and "2b4b127e4a7e9356c4cecfee0314319abe200176" have entirely different histories.
bc1b5797e8
...
2b4b127e4a
@ -22,8 +22,6 @@ public class MessageEvent<T> implements Delayed {
|
|||||||
|
|
||||||
private String result;
|
private String result;
|
||||||
|
|
||||||
private boolean keepAlive = false;
|
|
||||||
|
|
||||||
private T t;
|
private T t;
|
||||||
|
|
||||||
private ErrorCallback<T> callback;
|
private ErrorCallback<T> callback;
|
||||||
|
|||||||
@ -3,22 +3,15 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
|
|||||||
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
|
||||||
import gov.nist.javax.sip.message.SIPRequest;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.sip.InvalidArgumentException;
|
|
||||||
import javax.sip.RequestEvent;
|
import javax.sip.RequestEvent;
|
||||||
import javax.sip.SipException;
|
|
||||||
import javax.sip.message.Response;
|
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SIP命令类型: CANCEL请求
|
* SIP命令类型: CANCEL请求
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
|
||||||
@Component
|
@Component
|
||||||
public class CancelRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor {
|
public class CancelRequestProcessor extends SIPRequestProcessorParent implements InitializingBean, ISIPRequestProcessor {
|
||||||
|
|
||||||
@ -41,11 +34,7 @@ public class CancelRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
@Override
|
@Override
|
||||||
public void process(RequestEvent evt) {
|
public void process(RequestEvent evt) {
|
||||||
// TODO 优先级99 Cancel Request消息实现,此消息一般为级联消息,上级给下级发送请求取消指令
|
// TODO 优先级99 Cancel Request消息实现,此消息一般为级联消息,上级给下级发送请求取消指令
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -593,12 +593,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||||||
playService.stopAudioBroadcast(device, deviceChannel);
|
playService.stopAudioBroadcast(device, deviceChannel);
|
||||||
}
|
}
|
||||||
} catch (SdpException e) {
|
} catch (SdpException e) {
|
||||||
log.error("[语音通话] SDP解析异常", e);
|
log.error("[SDP解析异常]", e);
|
||||||
try {
|
|
||||||
responseAck(request, Response.BAD_REQUEST);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException exception) {
|
|
||||||
log.error("[命令发送失败] 来自设备的Invite请求非语音广播 FORBIDDEN: {}", exception.getMessage());
|
|
||||||
}
|
|
||||||
playService.stopAudioBroadcast(device, deviceChannel);
|
playService.stopAudioBroadcast(device, deviceChannel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,11 +63,6 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
|
|||||||
messageHandler.handForDevice(evt, device, element);
|
messageHandler.handForDevice(evt, device, element);
|
||||||
}else {
|
}else {
|
||||||
handMessageEvent(element, null);
|
handMessageEvent(element, null);
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,12 +72,6 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
|
|||||||
IMessageHandler messageHandler = messageHandlerMap.get(cmd);
|
IMessageHandler messageHandler = messageHandlerMap.get(cmd);
|
||||||
if (messageHandler != null) {
|
if (messageHandler != null) {
|
||||||
messageHandler.handForPlatform(evt, parentPlatform, element);
|
messageHandler.handForPlatform(evt, parentPlatform, element);
|
||||||
}else {
|
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,9 +87,7 @@ public abstract class MessageHandlerAbstract extends SIPRequestProcessorParent i
|
|||||||
}else {
|
}else {
|
||||||
subscribe.getCallback().run(ErrorCode.ERROR100.getCode(), ErrorCode.ERROR100.getMsg(), result);
|
subscribe.getCallback().run(ErrorCode.ERROR100.getCode(), ErrorCode.ERROR100.getMsg(), result);
|
||||||
}
|
}
|
||||||
if (!subscribe.isKeepAlive()) {
|
messageSubscribe.removeSubscribe(cmd + sn);
|
||||||
messageSubscribe.removeSubscribe(cmd + sn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class MessageRequestProcessor extends SIPRequestProcessorParent implement
|
|||||||
}else { // 由于上面已经判断都为null则直接返回,所以这里device和parentPlatform必有一个不为null
|
}else { // 由于上面已经判断都为null则直接返回,所以这里device和parentPlatform必有一个不为null
|
||||||
messageHandler.handForPlatform(evt, parentPlatform, rootElement);
|
messageHandler.handForPlatform(evt, parentPlatform, rootElement);
|
||||||
}
|
}
|
||||||
// 存在handler则由handler自行决定回复什么。
|
responseAck(request, Response.OK);
|
||||||
}else {
|
}else {
|
||||||
// 不支持的message
|
// 不支持的message
|
||||||
// 不存在则回复415
|
// 不存在则回复415
|
||||||
|
|||||||
@ -63,11 +63,7 @@ public class DeviceControlQueryMessageHandler extends SIPRequestProcessorParent
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -71,11 +71,7 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -34,11 +34,7 @@ public class AlarmQueryMessageHandler extends SIPRequestProcessorParent implemen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -55,11 +55,7 @@ public class DeviceInfoQueryMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element rootElement) {
|
public void handForDevice(RequestEvent evt, Device device, Element rootElement) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -46,11 +46,7 @@ public class DeviceStatusQueryMessageHandler extends SIPRequestProcessorParent i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -65,11 +65,7 @@ public class RecordInfoQueryMessageHandler extends SIPRequestProcessorParent imp
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
public void handForDevice(RequestEvent evt, Device device, Element element) {
|
||||||
try {
|
|
||||||
responseAck((SIPRequest) evt.getRequest(), Response.OK);
|
|
||||||
} catch (SipException | InvalidArgumentException | ParseException e) {
|
|
||||||
log.error("[命令发送失败] 回复200 OK: {}", e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -7,7 +7,10 @@ import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig;
|
|||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage;
|
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcMessage;
|
||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
|
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcRequest;
|
||||||
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
import com.genersoft.iot.vmp.conf.redis.bean.RedisRpcResponse;
|
||||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
import com.genersoft.iot.vmp.gb28181.bean.BasicParam;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.Device;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.DeviceConfigAware;
|
||||||
|
import com.genersoft.iot.vmp.gb28181.bean.SyncStatus;
|
||||||
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
import com.genersoft.iot.vmp.gb28181.service.IDeviceService;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcController;
|
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcController;
|
||||||
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcMapping;
|
import com.genersoft.iot.vmp.service.redisMsg.dto.RedisRpcMapping;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user