diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/MessageRequestProcessor.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/MessageRequestProcessor.java index c5658c3..04811cf 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/MessageRequestProcessor.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/MessageRequestProcessor.java @@ -57,13 +57,11 @@ public class MessageRequestProcessor implements MessageProcessor { MessageDTO messageDto = XmlUtils.parse(content, MessageDTO.class, GB28181Constant.CHARSET); log.debug("deviceId:{}, 接收到的消息 => {}", deviceId, messageDto); - Response response = null; if(messageDto.getCmdType().equalsIgnoreCase(CmdType.CATALOG)) { + sender.send(senderIp, okResponse(request)); catalogCmdProcessor.process(request, content); } else { - response = SipResponseBuilder.response(request, Response.NOT_IMPLEMENTED, ResponseStatus.NOT_IMPLEMENTED.getMessage()); - } - if(response != null){ + Response response = SipResponseBuilder.response(request, Response.NOT_IMPLEMENTED, ResponseStatus.NOT_IMPLEMENTED.getMessage()); sender.send(senderIp, response); } } diff --git a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/catalog/CatalogCmdProcessor.java b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/catalog/CatalogCmdProcessor.java index b1bcf98..c9c3e28 100644 --- a/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/catalog/CatalogCmdProcessor.java +++ b/gb28181-mocking-service/src/main/java/cn/skcks/docking/gb28181/mocking/core/sip/message/processor/message/request/catalog/CatalogCmdProcessor.java @@ -50,13 +50,11 @@ public class CatalogCmdProcessor { .sumNum(Long.valueOf(catalogDeviceListDTO.getNum())) .build(); - long cSeq = request.getCSeq().getSeqNumber() + 1; FromHeader fromHeader = request.getFromHeader(); - sender.sendRequest((provider, ip, port)->{ CallIdHeader callIdHeader = provider.getNewCallId(); return SipRequestBuilder.createMessageRequest(mockingDevice, - ip, port, cSeq, XmlUtils.toXml(catalogResponseDTO), fromHeader.getTag(), callIdHeader); + ip, port, 1, XmlUtils.toXml(catalogResponseDTO), fromHeader.getTag(), callIdHeader); }); } }