I use Cloudhopper library to connect to SMSC and submit messages. I split long message in a standard way:
- split text into small chunks of 134 bytes
- generate next reference number
- create UDH 6 bytes with ref number
- send parts one by one
I have several connections open in transceiver mode to SMSC. If I use only one connection to send all the parts, then most of the time the messages are merged correctly both on Android 5.0.1 and iOS 8.4.1, though sometimes quite rarely the concatenated messages have the last part from the wrong message.
If I use different connections to send the parts, then most of the time messages are concatenated in a wrong way, usually the last part belongs to some other message. So it looks like mobiles don't honor the included reference number at all.
I know that if the reference number is the same and there are hanging old parts in the database on mobile then it might concatenate wrongly, but this doesn't seem to be the case in my tests since the reference number is sequential and controlled to be different for wrongly concatenated parts.
What could be the problem or how could I approach it?