| | |
| | | import org.springframework.beans.factory.InitializingBean; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.sip.InvalidArgumentException; |
| | |
| | | String received = viaHeader.getReceived(); |
| | | int rPort = viaHeader.getRPort(); |
| | | // 解析本地地址替代 |
| | | if (StringUtils.isEmpty(received) || rPort == -1) { |
| | | if (ObjectUtils.isEmpty(received) || rPort == -1) { |
| | | received = viaHeader.getHost(); |
| | | rPort = viaHeader.getPort(); |
| | | } |
| | |
| | | } |
| | | device.setKeepaliveTime(DateUtil.getNow()); |
| | | // 回复200 OK |
| | | responseAck(evt, Response.OK); |
| | | responseAck(getServerTransaction(evt), Response.OK); |
| | | if (device.getOnline() == 1) { |
| | | deviceService.updateDevice(device); |
| | | }else { |