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?