diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-24 23:59:23 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-24 23:59:23 +1300 |
commit | 1c915fa1360f416ec88f4095664a887ceea2bc15 (patch) | |
tree | 16716caf340a555232abb2f17b2b60cf56b67ceb /src/org/traccar/smpp/ClientSmppSessionHandler.java | |
parent | 8b84c115ff396532159d4b890618a1a7bf2fe4cb (diff) | |
parent | 4fae45e28106aede04c7524d89a45a94c281576c (diff) | |
download | trackermap-server-1c915fa1360f416ec88f4095664a887ceea2bc15.tar.gz trackermap-server-1c915fa1360f416ec88f4095664a887ceea2bc15.tar.bz2 trackermap-server-1c915fa1360f416ec88f4095664a887ceea2bc15.zip |
Merge pull request #3737 from Abyss777/smpp_incoming_improve
Improve incoming SMS handling
Diffstat (limited to 'src/org/traccar/smpp/ClientSmppSessionHandler.java')
-rw-r--r-- | src/org/traccar/smpp/ClientSmppSessionHandler.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/org/traccar/smpp/ClientSmppSessionHandler.java b/src/org/traccar/smpp/ClientSmppSessionHandler.java index 77f75273e..69ef9af41 100644 --- a/src/org/traccar/smpp/ClientSmppSessionHandler.java +++ b/src/org/traccar/smpp/ClientSmppSessionHandler.java @@ -25,6 +25,7 @@ import com.cloudhopper.smpp.impl.DefaultSmppSessionHandler; import com.cloudhopper.smpp.pdu.DeliverSm; import com.cloudhopper.smpp.pdu.PduRequest; import com.cloudhopper.smpp.pdu.PduResponse; +import com.cloudhopper.smpp.util.SmppUtil; public class ClientSmppSessionHandler extends DefaultSmppSessionHandler { @@ -44,16 +45,12 @@ public class ClientSmppSessionHandler extends DefaultSmppSessionHandler { PduResponse response = null; try { if (request instanceof DeliverSm) { - if (request.getOptionalParameters() != null) { - Log.debug("SMS Message Delivered: " - + request.getOptionalParameter(SmppConstants.TAG_RECEIPTED_MSG_ID).getValueAsString() - + ", State: " - + request.getOptionalParameter(SmppConstants.TAG_MSG_STATE).getValueAsByte()); - } else { - String sourceAddress = ((DeliverSm) request).getSourceAddress().getAddress(); - String message = CharsetUtil.decode(((DeliverSm) request).getShortMessage(), - smppClient.mapDataCodingToCharset(((DeliverSm) request).getDataCoding())); - Log.debug("SMS Message Received: " + message.trim() + ", Source Address: " + sourceAddress); + String sourceAddress = ((DeliverSm) request).getSourceAddress().getAddress(); + String message = CharsetUtil.decode(((DeliverSm) request).getShortMessage(), + smppClient.mapDataCodingToCharset(((DeliverSm) request).getDataCoding())); + Log.debug("SMS Message Received: " + message.trim() + ", Source Address: " + sourceAddress); + + if (!SmppUtil.isMessageTypeAnyDeliveryReceipt(((DeliverSm) request).getEsmClass())) { TextMessageEventHandler.handleTextMessage(sourceAddress, message); } } |