/** * Create SAR_MESSAGE_REF_NUM TLV instance. * The value will cast automatically into short type. * * @param value is the value. * @return the optional parameter. */ public static OptionalParameter.Short newSarMsgRefNum(int value) { return newSarMsgRefNum((byte)value); }
/** * Create SAR_MESSAGE_REF_NUM TLV instance. * The value will cast automatically into short type. * * @param value is the value. * @return the optional parameter. */ public static OptionalParameter.Short newSarMsgRefNum(int value) { return newSarMsgRefNum((byte)value); }
/** * Create SAR_MESSAGE_REF_NUM TLV instance. * The value will cast automatically into short type. * * @param value is the value. * @return the optional parameter. */ public static OptionalParameter.Short newSarMsgRefNum(int value) { return newSarMsgRefNum((byte)value); }
/** * Create SAR_MESSAGE_REF_NUM TLV instance. * The value will cast automatically into short type. * * @param value is the value. * @return the optional parameter. */ public static OptionalParameter.Short newSarMsgRefNum(int value) { return newSarMsgRefNum((byte)value); }
public static void main(String[] args) { SMPPSession session = new SMPPSession(); try { session.connectAndBind("localhost", 8056, new BindParameter(BindType.BIND_TX, "test", "test", "cp", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, null)); Random random = new Random(); final int totalSegments = 3; OptionalParameter sarMsgRefNum = OptionalParameters.newSarMsgRefNum((short)random.nextInt()); OptionalParameter sarTotalSegments = OptionalParameters.newSarTotalSegments(totalSegments); for (int i = 0; i < totalSegments; i++) { final int seqNum = i + 1; String message = "Message part " + seqNum + " of " + totalSegments + " "; OptionalParameter sarSegmentSeqnum = OptionalParameters.newSarSegmentSeqnum(seqNum); String messageId = submitMessage(session, message, sarMsgRefNum, sarSegmentSeqnum, sarTotalSegments); LOGGER.info("Message submitted, message_id is {}", messageId); } session.unbindAndClose(); } catch (IOException e) { LOGGER.error("Failed connect and bind to host", e); } }