Get a short message from PduRequest

I use cloudhopper-smpp to receive SMS via SMPP. After the DefaultSmppSessionHandler executed, PDU requests are accepted by the SessionHandler (in the overridden firePduRequestReceived method).

Are there any helper classes / Utils for retrieving SMS from PduRequest type deliver_sm ? Could not find recipients in PduRequest to access SMS.

+4
source share
1 answer

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); } 
+7
source

All Articles