4

我正在使用cloudhopper-smpp通过 SMPP 接收短信。在实现 a 之后DefaultSmppSessionHandler,SessionHandler 正在接收 PDU 请求(在被覆盖的firePduRequestReceived方法中)。

是否有任何帮助类/实用程序可以从PduRequest类型中提取 SMS deliver_sm?找不到任何PduRequest获取器来访问 SMS。

4

1 回答 1

7

找到了答案。

        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);
        }
于 2013-01-23T09:14:47.427 回答