我想通过 jsmpp 发送 USSD 消息。当我发送消息时,我收到此错误
org.jsmpp.extra.NegativeResponseException: Negative response 00000008 found
at org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.java:215)
at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:271)
at org.jsmpp.session.SMPPSession.submitShortMessage(SMPPSession.java:320)
这是我的代码:
int i = 2;
short j = 2;
OptionalParameter op1 = new OptionalParameter.Byte(Tag.USSD_SERVICE_OP, (byte) i);
OptionalParameter op2 = new OptionalParameter.Byte(Tag.ITS_SESSION_INFO, (byte) j);
OptionalParameter[] op = new OptionalParameter[2];
op[0] = op2;
op[1] = op1;
messageId = session.submitShortMessage("USSD", TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN, sourceNumber, TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN, recipient, new ESMClass(142),
(byte) 0, (byte) 1, timeFormatter.format(new Date()), null,
new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE), (byte) 0,
DataCoding.newInstance(0),
(byte) 0, text.getBytes(), op);