修复设备在事务内注销失败的问题
parent
88721511e7
commit
7f79b92568
|
@ -106,6 +106,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
|
||||||
device.getSipTransactionInfo() != null &&
|
device.getSipTransactionInfo() != null &&
|
||||||
request.getCallIdHeader().getCallId().equals(device.getSipTransactionInfo().getCallId())) {
|
request.getCallIdHeader().getCallId().equals(device.getSipTransactionInfo().getCallId())) {
|
||||||
logger.info(title + "设备:{}, 注册续订: {}",device.getDeviceId(), device.getDeviceId());
|
logger.info(title + "设备:{}, 注册续订: {}",device.getDeviceId(), device.getDeviceId());
|
||||||
|
if (registerFlag) {
|
||||||
device.setExpires(request.getExpires().getExpires());
|
device.setExpires(request.getExpires().getExpires());
|
||||||
device.setIp(remoteAddressInfo.getIp());
|
device.setIp(remoteAddressInfo.getIp());
|
||||||
device.setPort(remoteAddressInfo.getPort());
|
device.setPort(remoteAddressInfo.getPort());
|
||||||
|
@ -120,6 +121,9 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
|
||||||
device.setRegisterTime(DateUtil.getNow());
|
device.setRegisterTime(DateUtil.getNow());
|
||||||
SipTransactionInfo sipTransactionInfo = new SipTransactionInfo((SIPResponse)registerOkResponse);
|
SipTransactionInfo sipTransactionInfo = new SipTransactionInfo((SIPResponse)registerOkResponse);
|
||||||
deviceService.online(device, sipTransactionInfo);
|
deviceService.online(device, sipTransactionInfo);
|
||||||
|
}else {
|
||||||
|
deviceService.offline(deviceId, "主动注销");
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String password = (device != null && !ObjectUtils.isEmpty(device.getPassword()))? device.getPassword() : sipConfig.getPassword();
|
String password = (device != null && !ObjectUtils.isEmpty(device.getPassword()))? device.getPassword() : sipConfig.getPassword();
|
||||||
|
|
Loading…
Reference in New Issue