I am using jsmpp for some time, but now need to solve one problem. Actually via protocol description we should be able to send long message using fragments of 153 bytes. With jssmpp it is possible only with fragments of 152 because UDH is 2 16bit length, otherwise smsc response 45 error.
Any suggestion to fragment 7bit long message into 153 bytes via jsmpp
`int totalSegments = getTotalSegmentsForTextMessage(data, Main.splitSimpleLength);
String[] msgId = new String[totalSegments];
Random random = new Random();
OptionalParameter sarMsgRefNum = OptionalParameters.newSarMsgRefNum((short) random.nextInt());
OptionalParameter sarTotalSegments = OptionalParameters.newSarTotalSegments(totalSegments);
for (int i = 0, seqNum = 0; i < totalSegments; i++)
{
seqNum = i + 1;
OptionalParameter sarSegmentSeqnum = OptionalParameters.newSarSegmentSeqnum(seqNum);
msgId[i] = session.submitShortMessage("CMT", sourceAddressTone,
NumberingPlanIndicator.UNKNOWN, sender_, TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.ISDN,
receiver_, new ESMClass(), (byte) 0, (byte) 1, timeFormatter.format(new Date()), null,
registeredDelivery, (byte) 0, dataCoding, (byte) 0, getSegmentData(data, i, Main.splitSimpleLength), sarMsgRefNum, sarSegmentSeqnum, sarTotalSegments);
System.out.println("Message id for segment " + seqNum + " out of totalsegment " + totalSegments + " is " + msgId[i]);
}
response.setIds(msgId);
response.setTotalSegments(totalSegments);`
Hi,
I am using jsmpp for some time, but now need to solve one problem. Actually via protocol description we should be able to send long message using fragments of 153 bytes. With jssmpp it is possible only with fragments of 152 because UDH is 2 16bit length, otherwise smsc response 45 error.
Any suggestion to fragment 7bit long message into 153 bytes via jsmpp
`int totalSegments = getTotalSegmentsForTextMessage(data, Main.splitSimpleLength); String[] msgId = new String[totalSegments];