目录推送

This commit is contained in:
shikong 2023-09-13 14:08:46 +08:00
parent 2fa97835fe
commit 90b716e404
2 changed files with 3 additions and 7 deletions

View File

@ -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);
}
}

View File

@ -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);
});
}
}