aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
index 0a22e30c5..ca6b667cd 100644
--- a/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/PiligrimProtocolDecoder.java
@@ -172,15 +172,13 @@ public class PiligrimProtocolDecoder extends BaseHttpProtocolDecoder {
String[] payloadParts = payload.split("&");
/* LOGGER.info("Payload parts: " + Arrays.toString(payloadParts)); */
String phoneNumber = payloadParts[1].substring(15);
- DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, phoneNumber);
+ DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, phoneNumber.substring(1));
if (deviceSession == null) {
return null;
}
- /* TODO: generalize this process;
- * TODO: use keys for flags in 'positions'.
- */
- String message = payloadParts[2].substring(8).replaceFirst("ALARM KEY; ", "");
+ /* TODO: use keys for flags in 'positions'. */
+ String message = payloadParts[2].substring(8).replaceFirst("[A-Z]* KEY; ", "");
/* LOGGER.info("Phone number: " + phoneNumber); */
/* LOGGER.info("Message: " + message); */