From 5ac0f773023a9c1c70524f1b63d2afc7d837a31f Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 6 Mar 2018 13:52:44 +0500 Subject: Implement additional way to detect SMPP delivery receipts --- src/org/traccar/smpp/ClientSmppSessionHandler.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/smpp/ClientSmppSessionHandler.java') diff --git a/src/org/traccar/smpp/ClientSmppSessionHandler.java b/src/org/traccar/smpp/ClientSmppSessionHandler.java index 69ef9af41..3585f8376 100644 --- a/src/org/traccar/smpp/ClientSmppSessionHandler.java +++ b/src/org/traccar/smpp/ClientSmppSessionHandler.java @@ -50,7 +50,14 @@ public class ClientSmppSessionHandler extends DefaultSmppSessionHandler { smppClient.mapDataCodingToCharset(((DeliverSm) request).getDataCoding())); Log.debug("SMS Message Received: " + message.trim() + ", Source Address: " + sourceAddress); - if (!SmppUtil.isMessageTypeAnyDeliveryReceipt(((DeliverSm) request).getEsmClass())) { + boolean isDeliveryReceipt = false; + if (smppClient.getDetectDlrByOpts()) { + isDeliveryReceipt = request.getOptionalParameters() != null; + } else { + isDeliveryReceipt = SmppUtil.isMessageTypeAnyDeliveryReceipt(((DeliverSm) request).getEsmClass()); + } + + if (!isDeliveryReceipt) { TextMessageEventHandler.handleTextMessage(sourceAddress, message); } } -- cgit v1.2.3