From 867e800009bf361c3da9306bc5a9e3f1fab43869 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 11 Dec 2022 09:10:11 -0800 Subject: Improve T55 IP identification --- src/main/java/org/traccar/protocol/T55ProtocolDecoder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java index 90382439e..51f06a801 100644 --- a/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/T55ProtocolDecoder.java @@ -379,11 +379,12 @@ public class T55ProtocolDecoder extends BaseProtocolDecoder { } deviceSession = getDeviceSession(channel, remoteAddress, id); sentence = sentence.substring(index); - } else if (remoteAddress instanceof InetSocketAddress) { - String host = ((InetSocketAddress) remoteAddress).getHostString(); - deviceSession = getDeviceSession(channel, remoteAddress, host); } else { deviceSession = getDeviceSession(channel, remoteAddress); + if (deviceSession == null && remoteAddress instanceof InetSocketAddress) { + String host = ((InetSocketAddress) remoteAddress).getHostString(); + deviceSession = getDeviceSession(channel, remoteAddress, host); + } } if (sentence.startsWith("$PGID")) { -- cgit v1.2.3