Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18110

camel-smpp - DeliverSM handle message payload optional parameter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.14.2
    • 3.14.4, 3.18.0
    • camel-smpp
    • 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

        1. image-2022-05-13-16-24-24-522.png
          272 kB
          Gerasimos Kalouris

        Issue Links

          Activity

            People

              Unassigned Unassigned
              memas.kal Gerasimos Kalouris
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: