Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with gsm0338 codec #220

Open
niksabaldun opened this issue Oct 15, 2022 · 2 comments
Open

Problem with gsm0338 codec #220

niksabaldun opened this issue Oct 15, 2022 · 2 comments

Comments

@niksabaldun
Copy link

Hi,

If I try to send a message using gsm0338 codec:

msg = naz.protocol.SubmitSM(
    encoding='gsm0338',
    short_message='SMPPtest',
    log_id=request_id,
    source_addr='some_number',
    destination_addr='some_number',
    validity_period='221017095407208+'
)

it is not encoded correctly, the client receives garbage ('S&ΛJ/Oi' in this case). If I specify ucs2 encoding, then everything is fine.

It is not a server problem. I've tried sending from https://melroselabs.com/tools/smppclientproxy/ via the same server using gsm0338 and the message was encoded correctly.

@niksabaldun niksabaldun changed the title Problem with ucs0338 codec Problem with gsm0338 codec Oct 15, 2022
@niksabaldun
Copy link
Author

OK, there is probably no problem with the codec itself. I've found the following in the Apache Camel docs:

Choosing the value 0 for the alphabet selects the SMSC default alphabet, this usually means GSM 3.38 but it is not guaranteed.

This is an unbelievably loose specification. For this particular SMSC, default encoding is ascii. However, the web SMPP client I used didn't even try to use gsm0338, so I assume it had some way to detect that it should use ascii. How, I have no idea.

@niksabaldun
Copy link
Author

I got this answer from SMSC vendor:

Unfortunately, unlike SMPP 3.3, where data_coding=0 was unambiguously GSM 7-bit default alphabet, for SMPP 3.4 and higher the GSM 7-bit default alphabet is missing in this list, and data_coding=0 may differ for various Short message service centers—it may be ISO-8859-1, ASCII, GSM 7-bit default alphabet, UTF-8 or even configurable per ESME.

This means that Client class should have a parameter for default encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant