修复设备在事务内注销失败的问题

pull/1270/head
648540858 2024-01-18 10:17:03 +08:00
parent 88721511e7
commit 7f79b92568
1 changed files with 20 additions and 16 deletions

View File

@ -106,6 +106,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
device.getSipTransactionInfo() != null &&
request.getCallIdHeader().getCallId().equals(device.getSipTransactionInfo().getCallId())) {
logger.info(title + "设备:{}, 注册续订: {}",device.getDeviceId(), device.getDeviceId());
if (registerFlag) {
device.setExpires(request.getExpires().getExpires());
device.setIp(remoteAddressInfo.getIp());
device.setPort(remoteAddressInfo.getPort());
@ -120,6 +121,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
device.setRegisterTime(DateUtil.getNow());
SipTransactionInfo sipTransactionInfo = new SipTransactionInfo((SIPResponse)registerOkResponse);
deviceService.online(device, sipTransactionInfo);
}else {
deviceService.offline(deviceId, "主动注销");
}
return;
}
String password = (device != null && !ObjectUtils.isEmpty(device.getPassword()))? device.getPassword() : sipConfig.getPassword();