У меня есть эта ошибка: jsmpp.extra.NegativeResponseException: отрицательный ответ 00000001 (длина сообщения недействительна). В чем проблема? Я использую симулятор SMSC, он возвращает мне идентификатор сообщения, но когда я передаю код своей тестовой группе, они получают сообщение об ошибке. Как я могу решить?
public static void main(String[] args) {
System.out.println("IPHOST "+ args[0] +" port"+ args[1] + " systemId"+ args[2]+
" systemType"+ args[3]+ " password "+ args[4]+" for "+ args[5]+ "mensaje " + args[6]+
"from " + args[7]+ "config " + args[8]);
SMPPSession session = new SMPPSession();
try {
Log.info("Connecting");
String systemId = session.connectAndBind(args[0], Integer.parseInt(args[1]), new BindParameter(BindType.BIND_TX, args[2], args[4], args[3], TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null));
Log.info("Connected with SMSC with system id {}", systemId);
try {
// String messageId = session.submitShortMessage("CMT",
// TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "1616",
// TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN, "593997787786",
// new ESMClass(), (byte)0, (byte)1, TIME_FORMATTER.format(new Date()), null,
// new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0, new GeneralDataCoding(Alphabet.ALPHA_DEFAULT, MessageClass.CLASS1, false), (byte)0,
// "jSMPP simplify SMPP on Java platform".getBytes());
Principal principal= new Principal();
System.out.println(principal.obtenerPropiedad("notif.smpp.S.address.ton"));
String messageId ="";
if(args[8].equals("S")) {
messageId = session.submitShortMessage("CMT",
TypeOfNumber.ALPHANUMERIC,
NumberingPlanIndicator.ISDN,
args[7],
TypeOfNumber.INTERNATIONAL,
NumberingPlanIndicator.ISDN,
args[5],
new ESMClass(64),
(byte)0, (byte)1,null, null,
new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT),
(byte)0, new GeneralDataCoding(245),
(byte)0, args[6].getBytes());
}else if(args[8].equals("C")) {
messageId = session.submitShortMessage("CMT",
TypeOfNumber.INTERNATIONAL,
NumberingPlanIndicator.ISDN,
args[7],
TypeOfNumber.INTERNATIONAL,
NumberingPlanIndicator.ISDN,
args[5],
new ESMClass(64),
(byte)0, (byte)1,null, null,
new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT),
(byte)0, new GeneralDataCoding(245),
(byte)0, args[6].getBytes());
}
Log.info("Message submitted, message_id is {}", messageId);
} catch (PDUException e) {
// Invalid PDU parameter
Log.error("Invalid PDU parameter", e);
} catch (ResponseTimeoutException e) {
// Response timeout
Log.error("Response timeout", e);
} catch (InvalidResponseException e) {
// Invalid response
Log.error("Receive invalid response", e);
} catch (NegativeResponseException e) {
// Receiving negative response (non-zero command_status)
Log.error("Receive negative response", e);
} catch (IOException e) {
Log.error("IO error occurred", e);
}
session.unbindAndClose();
} catch (IOException e) {
Log.error("Failed connect and bind to host", e);
}
}
Полный стек ошибок:
16:00:01.011 [основная] ИНФОРМАЦИЯ com.notificaciones.util.LoggerNotificacionesMDB — подключение 16:00:01.039 [основная] ИНФОРМАЦИЯ com.notificaciones.util.LoggerNotificacionesMDB — подключение к SMSC с идентификатором системы 12545 1 16:00:01.068 [основная ] ОШИБКА com.notificaciones.util.LoggerNotificacionesMDB — получение отрицательного ответа org.jsmpp.extra.NegativeResponseException: отрицательный ответ 00000001 (длина сообщения недействительна) найден в org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.java:284) ~[ notifysat-0.0.1-jar-with-dependenciesVersion2.jar:?] at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:345) ~[notifysat-0.0.1-jar-with-dependenciesVersion2.jar:? ] в org.jsmpp.session.SMPPSession.submitShortMessage(SMPPSession.java:384) ~[notifysat-0.0.1-jar-with-dependenciesVersion2.jar:?] в com.notifysat.Principal.main(Principal.java:117 ) [notifysat-0.0.1-jar-with-dependenciesVersion2.jar:?]
Я использую: jsmpp 2.3.12-SNAPSHOT