'Problem with concatenated messages in JSMPP

I have a problem sending concatenated messages to my SMSC, here, I will do my best to describe the problem.

When sending concatenated messages, my SMSC waits to receive all the segments of the message and then processes it to the provider and sends back the response, this means that when using the JSMPP java lib, whenever I receive a long message (more that 160 chars for GSM7) I will split the message into segments and submit each segment using the session.submitShortMessage method.

The problem is that this call is synchronous and waits for the SMSC to respond with submit_sm_resp. Therefor I need to use some sort of async mode to submit the messages.

I have no idea on how to do this with the current implementation of the library.

Do you know any way of doing this?

Thanks in advance



Solution 1:[1]

The way you have described SMSC is working in your case seems suspicious to me. I don't know of any SMSC that would only respond back once all segments have been submitted (here I am assuming the communication via smpp protocol). Considering your SMSC implements smpp specification version 3.4, you might need to talk with the team responsible for maintaining this SMSC.

Suppose your (jsmpp) client splits a long text message (more than 140 bytes) into two segments. For each segment, your client sends submit_sm and receives synchronously submit_sm_resp. This is the correct client side behaviour and can be seen one of the examples (SubmitLongMessageExample.java) from jsmpp library.

The example uses optional parameters when submitting the message to the SMSC, providing sequence number, total segments and most importantly, a unique message reference number.

The SMSC, should principally, synchronous respond back for each submitted segment and when it determines that for a unique message reference all segments has been received, it should then process the message and deliver it to the end user (mobile phone).

This behaviour/information can also be found in the specification at https://smpp.org/. If your SMSC does not behave like this, then the standard implementation by jsmpp library cannot help you (and for that matter anyone else)

Solution 2:[2]

You need to use the transciever bind-mode and use an implementation of the MessageReceiverListener onAcceptDeliverSm.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 office.aizaz
Solution 2 Chakib Arrama