aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-12-11 09:10:11 -0800
committerAnton Tananaev <anton@traccar.org>2022-12-11 09:10:11 -0800
commit867e800009bf361c3da9306bc5a9e3f1fab43869 (patch)
treef41a9d0efe615b8e280b0d28904fcdb0764b9d68
parent4b9ff1bd206adb826262acd4e3daf5c962518d7c (diff)
downloadtrackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.tar.gz
trackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.tar.bz2
trackermap-server-867e800009bf361c3da9306bc5a9e3f1fab43869.zip
Improve T55 IP identification
-rw-r--r--src/main/java/org/traccar/protocol/T55ProtocolDecoder.java7
1 files changed, 4 insertions, 3 deletions
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")) {