fiorix / go-smpp

SMPP 3.4 Protocol for the Go programming language
MIT License
218 stars 135 forks source link

GSM7 encoding #75

Closed McSwitch closed 2 years ago

McSwitch commented 6 years ago

Hi all,

Currently there is no support for GSM7 encoding or packing. Since most SMPP providers do not support receiving GSM7 packed (septet to octet conversion) requests, I suggest that we add two new codecs:

GSM7 Packed

Encode and pack messages. That means messages should be split after 140-7 bytes (UDH header), since there is the potential for splitting an escaped character (which consists of two bytes) like { across two parts, we should limit each part to 140-7-1 bytes.

GSM7 Unpacked

Only encode message, since many SMPP providers will not accept GSM7 packed. That means message should be split after 160-7 bytes (UDH header), since there is the potential for splitting an escaped character (which consists of two bytes) like { across two parts, we should limit each part to 160-7-1 bytes.

fiorix commented 6 years ago

If you have evidence of your patch working I have no problem merging it.

McSwitch commented 6 years ago

I have successfully sent GSM7 (unpacked) encoded messages via Infobip and SmsPortal. I have not yet tested GSM7 (packed) against a real-world SMPP provider since most SMPP providers only support octets not septets. But for the sake of completeness I decided to add the GSM7Packed encoding just in-case there is an SMPP provider that does only support septet (packed) transmissions.

If anyone knows of an SMPP provider that does support septet (packed) transmissions so that I may do a real-world test against them, please let me know.

fiorix commented 6 years ago

I've merged the diff, and just now, ran gofmt/goimports on top of it.