public MessageId onAcceptSubmitSm(SubmitSm submitSm, SMPPServerSession source) throws ProcessRequestException { LOGGER.info("Receiving message : {}", new String(submitSm.getShortMessage())); // need message_id to response submit_sm return messageIdGenerator.newMessageId(); }
public MessageId onAcceptSubmitSm(SubmitSm submitSm, SMPPServerSession source) throws ProcessRequestException { MessageId messageId = messageIDGenerator.newMessageId(); LOGGER.info("Receiving submit_sm {}, and return message id {}", new String(submitSm.getShortMessage()), messageId.getValue()); requestCounter.incrementAndGet(); return messageId; }
public void run() { try { Thread.sleep(1000); } catch (InterruptedException e1) { e1.printStackTrace(); } String stringValue = Integer.valueOf(messageId.getValue(), 16).toString(); try { DeliveryReceipt delRec = new DeliveryReceipt(stringValue, 1, 1, new Date(), new Date(), DeliveryReceiptState.DELIVRD, null, new String(submitSm.getShortMessage())); session.deliverShortMessage( "mc", TypeOfNumber.valueOf(submitSm.getDestAddrTon()), NumberingPlanIndicator.valueOf(submitSm.getDestAddrNpi()), submitSm.getDestAddress(), TypeOfNumber.valueOf(submitSm.getSourceAddrTon()), NumberingPlanIndicator.valueOf(submitSm.getSourceAddrNpi()), submitSm.getSourceAddr(), new ESMClass(MessageMode.DEFAULT, MessageType.SMSC_DEL_RECEIPT, GSMSpecificFeature.DEFAULT), (byte)0, (byte)0, new RegisteredDelivery(0), DataCodings.ZERO, delRec.toString().getBytes()); LOGGER.debug("Sending delivery receipt for message id " + messageId + ":" + stringValue); } catch (Exception e) { LOGGER.error("Failed sending delivery_receipt for message id " + messageId + ":" + stringValue, e); } } }
byte smLength = reader.readByte(); req.setShortMessage(reader.readBytes(smLength)); StringValidator.validateString(req.getShortMessage(), StringParameter.SHORT_MESSAGE); req.setOptionalParameters(readOptionalParameters(reader));
StringValidator.validateString(req.getShortMessage(), StringParameter.SHORT_MESSAGE); req.setOptionalParameters(readOptionalParameters(reader));
StringValidator.validateString(req.getShortMessage(), StringParameter.SHORT_MESSAGE); req.setOptionalParametes(readOptionalParameters(reader));
StringValidator.validateString(req.getShortMessage(), StringParameter.SHORT_MESSAGE); req.setOptionalParameters(readOptionalParameters(reader));