4

I'm using cloudhopper-smpp for receiving SMS over SMPP. After having implemented a DefaultSmppSessionHandler, PDU-Requests are being received by the SessionHandler (in the overridden firePduRequestReceived method).

Are there any helper-classes/Utils to extract SMS from PduRequest's of type deliver_sm? Couldn't find any getters in PduRequest to access the SMS.

Farhan
  • 1,596
  • 1
  • 19
  • 33

1 Answers1

7

Found the answer.

        if (pduRequest.getCommandId() == SmppConstants.CMD_ID_DELIVER_SM) {
         DeliverSm mo = (DeliverSm) pduRequest;
         int length = mo.getShortMessageLength();
         Address source_address = mo.getSourceAddress();
         Address dest_address = mo.getDestAddress();
         byte[] shortMessage = mo.getShortMessage();
         String SMS= new String(shortMessage);
        }
Farhan
  • 1,596
  • 1
  • 19
  • 33