linxGnu / gosmpp

Smpp (3.4) Client Library for Go
Apache License 2.0
152 stars 59 forks source link

ShouldSplit and Split behaviour when encoding is GSM7Bit #128

Closed krstdmr closed 8 months ago

krstdmr commented 8 months ago

Hei there, First of all thanks for a such useful library.

We are trying to use gosmpp to communicate with our SMSC and nowadays testing the "split" functionality. The question is simple; when we create a submitSM and set the message given down with encoding GSM7Bit, "ShouldSplit" returns true and Split() function returns 2 multiparts where it shouldn't have been split according to documentation provided down and the length calculators provided. Is it something I am doing wrong/understand wrong or is there any issue? It works as expected in documentation when encoding is UCS2. (70 chars when the text is a single SMS, 67 for each when it is more than 70 chars)

I appreciate any helps!

Input message with length 159 char length: "VZNxHKXA6aqoTpPNFcqkADX3WUY0ljnRNAHBsfv6qLEcTlHmhXjsD09VzuknrxJgIWiCJH9br3gzbFxplHaKtBc3MEi1XLHgqFV3nMzrpnbAZIkxPGPTGgttGzS7y6XeENs20aEO6qdR7xINUfNyLaBMnKiDw21"

Documentation: https://www.etsi.org/deliver/etsi_ts/123000_123099/123040/16.00.00_60/ts_123040v160000p.pdf 33GP TS 23.040 section 9.2.3.24.1 ---> Concatenated Short Messages

Some of the segment calculator links I used (the text above can be tested);

krstdmr commented 8 months ago

Hi @tahseenjamal! I see that you have used splitting functionality in the following example. Do you have any idea about my question above? https://github.com/tahseenjamal/smpp_client/blob/master/main.go

lixianzhong25 commented 8 months ago

Hei there, First of all thanks for a such useful library.

We are trying to use gosmpp to communicate with our SMSC and nowadays testing the "split" functionality. The question is simple; when we create a submitSM and set the message given down with encoding GSM7Bit, "ShouldSplit" returns true and Split() function returns 2 multiparts where it shouldn't have been split according to documentation provided down and the length calculators provided. Is it something I am doing wrong/understand wrong or is there any issue? It works as expected in documentation when encoding is UCS2. (70 chars when the text is a single SMS, 67 for each when it is more than 70 chars)

I appreciate any helps!

Input message with length 159 char length: "VZNxHKXA6aqoTpPNFcqkADX3WUY0ljnRNAHBsfv6qLEcTlHmhXjsD09VzuknrxJgIWiCJH9br3gzbFxplHaKtBc3MEi1XLHgqFV3nMzrpnbAZIkxPGPTGgttGzS7y6XeENs20aEO6qdR7xINUfNyLaBMnKiDw21"

Documentation: https://www.etsi.org/deliver/etsi_ts/123000_123099/123040/16.00.00_60/ts_123040v160000p.pdf 33GP TS 23.040 section 9.2.3.24.1 ---> Concatenated Short Messages

Some of the segment calculator links I used (the text above can be tested);

data/pkg.go -- SM_GSM_MSG_LEN is 140. based on this configuration, length 159 shouild split

krstdmr commented 8 months ago

Yes, I have seen it actually. But I though it as if it could behave as gsm-7bit packed=true by default and it would be split after 160 chars. So, by default gsm-7 bit packed=false and this means that each characters in a message will be carried in an octet (8-bit) which results 140 octet = 140 chars. So, it splits after 140 chars. Is that true what I understand here?

lixianzhong25 commented 8 months ago

Yes, I have seen it actually. But I though it as if it could behave as gsm-7bit packed=true by default and it would be split after 160 chars. So, by default gsm-7 bit packed=false and this means that each characters in a message will be carried in an octet (8-bit) which results 140 octet = 140 chars. So, it splits after 140 chars. Is that true what I understand here?

Yes, you can use SetLongMessageWithEnc() with GSM7BITPACKED

krstdmr commented 8 months ago

Thanks!

bluewithanas commented 5 months ago

hey @krstdmr Did it worked for you? because i am trying the same. my messages when they are greater than 140 octets are not getting split, even though i am calling split function. which are further getting rejected by provider. have you. implemented similar solution around the same??

cc @lixianzhong25

krstdmr commented 5 months ago

Hi @bluewithanas. No, it didn't actually. I have an open PR for this here. But you can refer to my fork in your project like in your go mod file, you can simply put the following in order to refer my changes; replace github.com/linxGnu/gosmpp v0.1.10 => github.com/krstdmr/gosmpp v1.0.2 This is working when the encoding is "data.GSM7BITPACKED". It splits as the standards says. But make sure your SMSC is configured to encode/decode based on GSM7BITPacked. We needed to configure this in our SMSC.