diff options
author | Abyss777 <abyss@fox5.ru> | 2018-03-22 09:24:25 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-03-22 09:32:50 +0500 |
commit | 265b1c14a995905da2e216d6002c62bd0d586752 (patch) | |
tree | 93e075a7caf383a5d35d606106959c3633dd8715 /src/org/traccar/smpp | |
parent | d2a130b71e9d8064515b16dff865f476a1aadf15 (diff) | |
download | trackermap-server-265b1c14a995905da2e216d6002c62bd0d586752.tar.gz trackermap-server-265b1c14a995905da2e216d6002c62bd0d586752.tar.bz2 trackermap-server-265b1c14a995905da2e216d6002c62bd0d586752.zip |
Add support for long SMS sending
Diffstat (limited to 'src/org/traccar/smpp')
-rw-r--r-- | src/org/traccar/smpp/SmppClient.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/org/traccar/smpp/SmppClient.java b/src/org/traccar/smpp/SmppClient.java index 0f7d2cf6d..bf395f90e 100644 --- a/src/org/traccar/smpp/SmppClient.java +++ b/src/org/traccar/smpp/SmppClient.java @@ -1,6 +1,6 @@ /* - * Copyright 2017 Anton Tananaev (anton@traccar.org) - * Copyright 2017 Andrey Kunitsyn (andrey@traccar.org) + * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org) + * Copyright 2017 - 2018 Andrey Kunitsyn (andrey@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import com.cloudhopper.smpp.impl.DefaultSmppClient; import com.cloudhopper.smpp.impl.DefaultSmppSessionHandler; import com.cloudhopper.smpp.pdu.SubmitSm; import com.cloudhopper.smpp.pdu.SubmitSmResp; +import com.cloudhopper.smpp.tlv.Tlv; import com.cloudhopper.smpp.type.Address; import com.cloudhopper.smpp.type.RecoverablePduException; import com.cloudhopper.smpp.type.SmppChannelException; @@ -222,7 +223,13 @@ public class SmppClient { if (requestDlr) { submit.setRegisteredDelivery(SmppConstants.REGISTERED_DELIVERY_SMSC_RECEIPT_REQUESTED); } - submit.setShortMessage(textBytes); + + if (textBytes != null && textBytes.length > 255) { + submit.addOptionalParameter(new Tlv(SmppConstants.TAG_MESSAGE_PAYLOAD, textBytes, "message_payload")); + } else { + submit.setShortMessage(textBytes); + } + submit.setSourceAddress(command ? new Address(commandSourceTon, commandSourceNpi, commandSourceAddress) : new Address(sourceTon, sourceNpi, sourceAddress)); submit.setDestAddress(new Address(destTon, destNpi, destAddress)); |