Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.14.2
-
None
Description
As per https://smpp.org/SMPP_v3_4_Issue1_2.pdf, the optional parameter message_payload is used when:
Even though DLRs, do not exceed this length, some vendors would chose to use this optional parameter instead.
The issue CAMEL-9356, tried to solve this but it did not succeed. Not sure if it's a regression, but the deliverSm.shortMessage is never null [1], but it's set to an empty byte array when the message payload optional parameter exists. Thus the message payload is never set as shown in the below snippet:
Snippet from SmppBinding.java
String messagePayload = null; if (deliverSm.getShortMessage() == null && deliverSm.getOptionalParameters() != null) { List<OptionalParameter> oplist = Arrays.asList(deliverSm.getOptionalParameters()); for (OptionalParameter optPara : oplist) { if (OptionalParameter.Tag.MESSAGE_PAYLOAD.code() == optPara.tag && OctetString.class .isInstance(optPara)) { messagePayload = ((OctetString) optPara).getValueAsString(); break; } } }
That being said I would not alter the null checks but I would add additional for the empty body (zero-length). I would like to do a PR for this bug and I would like it to be merged with camel 3.14.X (LTS) which is the version I currently use. Should I do a PR based on this branch?
[1]This is my conclusion after integration tests, using an implementation of jSMPP as the server. jSMPP would set the content to the empty message when sending the deliverSm.(org.jsmpp.DefaultPDUSender#checkShortMessage) .
Attachments
Attachments
Issue Links
- links to