opentelecoms-org / jsmpp

SMPP implemented in Java
Apache License 2.0
232 stars 163 forks source link

how I should receive multipart messages ? #148

Closed dainvse04984 closed 3 years ago

dainvse04984 commented 3 years ago

I create smpp server and my client send a long sms with 3 segment. how my smpp server can concat 3 segment to a long message and send to other system ?

pmoerenhout commented 3 years ago

Did the client use the optional headers to indicate the segments or did it fill the user data headers ? You should have an aggregation layer to collect all messages with the same reference. When all parts are received they should be concatenated and forward to the destination if the destination can handle longer messages.

dainvse04984 commented 3 years ago

jsmpp server support aggregation layer or I have to create it ? I don't no how to create an aggregation layer to collect all messages. So you have an idea for this ?

Did the client use the optional headers to indicate the segments or did it fill the user data headers ? You should have an aggregation layer to collect all messages with the same reference. When all parts are received they should be concatenated and forward to the destination if the destination can handle longer messages.

pmoerenhout commented 3 years ago

I could image a hashmap for the reference id, and store all message. When all message are collected, a new message can be created. Your server, where does it send the received long message to? Another SMPP link, or an application?

pmoerenhout commented 3 years ago

Do you an example of the incoming message(s). I can write an aggregator which will concatenate the messages...

dainvse04984 commented 3 years ago

Do you an example of the incoming message(s). I can write an aggregator which will concatenate the messages...

I have an idea. that i store segment into redis cache. and when get all segment I will concatenate and send to other system. But I can't appreciate risk if i use it. If you have better idea. I hope you can suggest me. thanks

dainvse04984 commented 3 years ago

Do you an example of the incoming message(s). I can write an aggregator which will concatenate the messages... I receive 4 part of segment. client using udh

Screen Shot 2021-03-18 at 19 39 06
pmoerenhout commented 3 years ago

OK, hard to parse, but I see no optionalParameters, so the segmentation info is in the user data headers. I have some code to extract it. I will put it together, and come back...

pmoerenhout commented 3 years ago

I have made an example in https://github.com/pmoerenhout/pduutils/tree/master/src/main/java/com/github/pmoerenhout/pduutils/jsmpp which parses the user data header of an deliver_sm to a segment. These segments should then be match and the data combined when all segments are collected.

dainvse04984 commented 3 years ago

I have made an example in https://github.com/pmoerenhout/pduutils/tree/master/src/main/java/com/github/pmoerenhout/pduutils/jsmpp which parses the user data header of an deliver_sm to a segment. These segments should then be match and the data combined when all segments are collected.

I got your example code and It's work. Thank you very much 💕

pmoerenhout commented 3 years ago

Great! I have updated the code to also look at the SMPP OptionalParameters headers to check if SAR information is included.

dainvse04984 commented 3 years ago

Great! I have updated the code to also look at the SMPP OptionalParameters headers to check if SAR information is included.

Thank for your update. I'm just a newbie in telecom service and this's my first time I've worked with smpp. So you can give me your contact (Telegram, whatsapp,...) ? I have some question about smpp server-client and I hope you can explain it for me :D