Android Device cannot receive message from SMPPGW

53 Views Asked by At

I have implement a function to send sms using Cloud Hopper.

public static SubmitSmResp sendShortMessage(String sourceAddress, byte[] textBytes, String destinationAddress) {
    SubmitSmResp submitResponse = null;
    try {

        // set encoding for sending SMS
        submit.setDataCoding(SmppConstants.DATA_CODING_JIS);

        submit.setShortMessage(textBytes);
        submit.setSourceAddress(new Address((byte) 0x05, (byte) 0x01, sourceAddress));
        submit.setDestAddress(new Address((byte) 0x01, (byte) 0x01, destinationAddress));

        // submit message to SMSC for delivery with a timeout of 10000ms
        submitResponse = session.submit(submit, 10000);
        if (submitResponse.getCommandStatus() == SmppConstants.STATUS_OK) {
            System.out.println("SMS submitted, message id {}" + submitResponse.getMessageId());
        } else {
            throw new IllegalStateException(submitResponse.getResultMessage());
        }
    } catch (RecoverablePduException | UnrecoverablePduException | SmppTimeoutException |
            SmppChannelException | InterruptedException e) {
        throw new IllegalStateException(e);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return submitResponse;
}

But when i insert my sim card to ios device, i can receive message from smppgw. Then i insert my sim card to android device, the submitResponse.getCommandStatus() == SmppConstants.STATUS_OK is TRUE, but i cannot receive my sms. Finally, i insert my sim card back to my ios device, the i got message when i send from android device. Does anyone know how to fix this problem?

1

There are 1 best solutions below

0
On

It doesn't sound like an SMPP client problem. I mean, as long as you receive submit_sm_resp with status OK whe you send your submit_sm, it means the message was accepted by the SMSC/SMPPGW. Sounds more like an SMSC issue or a terminal issue, as the problem is at the delivery from SMSC to the terminal.

A simple explanation could be that the Android terminal has some problems/missing signal/not registered to the network and that's the reason the SMSC doesn't deliver the sms. As soon as you change the terminal, the sim becomes online and the SMSC delivers the previous sms