我已经构建了一个使用 smpp 3.4 发送短消息的应用程序,并且效果很好,但是在某些手机中我收到了以下消息:
无法显示此消息
这是我的函数源代码:
public String sendMsg(JsonObject paramsIN) {
String smsMessage = paramsIN.getString("body");
String smsDestination = paramsIN.getString("to");
String smsSource = paramsIN.getString("from");
String smscNAME = paramsIN.getString("smsc");
SubmitSM request = new SubmitSM();
SubmitSMResp response;
Session session;
try {
request.setSourceAddr(smsSource);
request.setDestAddr(smsDestination);
request.setShortMessage(smsMessage, "UTF-8");
request.setRegisteredDelivery((byte) 3);
request.setDataCoding((byte) 4); // 4
request.assignSequenceNumber(true);
response = ((Session) sd.get(smscNAME)).submit(request);
logger.info("Submit response " + response.debugString());
String messageId = response.getMessageId();
BigInteger bigInt = new BigInteger(messageId, 16);
return bigInt+"";
} catch (WrongLengthOfStringException e) {
logger.error(e);
return null;
} catch (PDUException e) {
logger.error(e);
return null;
} catch (TimeoutException e) {
logger.error(e);
return null;
} catch (WrongSessionStateException e) {
logger.error(e);
return null;
} catch (IOException e) {
logger.error(e);
return null;
}
}
请有人可以帮助我,谢谢