sungsilnom / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

Can't concatenate messages #106

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi.

I am trying to use jsmpp-2.1.0.

When my message is too long, I am getting it in to 3 different messages and it 
never gets concatenated in to one.

The SMSC that I connect to demands to use a User Data Header (UDH) but I can't 
get the desired result. Here is my code, where msgRefNum, totalSegments and 
segmentSeqNum are processed from my application and passed as an input:

...
            ESMClass esmClass = new ESMClass();
            OptionalParameter sarMsgRefNum = OptionalParameters.newSarMsgRefNum(msgRefNum);
            OptionalParameter sarTotalSegments = OptionalParameters.newSarTotalSegments(totalSegments);
            OptionalParameter sarSegmentSeqnum = OptionalParameters.newSarSegmentSeqnum(segmentSeqNum);

messageId = session.submitShortMessage(serviceType, sourceAddrTon, 
sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi, destinationAddr, esmClass, 
protocolId, priorityFlag, scheduleDeliveryTime, validityPeriod, 
registeredDelivery, replaceIfPresentFlag, dataCoding, smDefaultMsgId, 
shortMessage.getBytes("UTF-8"), sarMsgRefNum, sarSegmentSeqnum, 
sarTotalSegments);

I believe that I might need to ser the ESM Class to a special value (to 
indicate that there is a UDH) and I need to append some bytes to the message 
with the sarMsgRefNum, sarSegmentSeqnum and sarTotalSegments, but I don't have 
any examples on how to do this.

Can you help me?
Thanks in advance,
Daniel

Original issue reported on code.google.com by danielvf...@gmail.com on 23 Jun 2011 at 3:09