Skip to content

Commit

Permalink
Adding comment
Browse files Browse the repository at this point in the history
  • Loading branch information
linxGnu committed Jan 23, 2024
1 parent f949840 commit 3c44160
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pdu/ShortMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import (
"github.com/linxGnu/gosmpp/errors"
)

var (
ref = uint32(0)
)
var ref = uint32(0)

// ShortMessage message.
type ShortMessage struct {
Expand Down Expand Up @@ -147,7 +145,15 @@ func (c *ShortMessage) split() (multiSM []*ShortMessage, err error) {
return
}

// reserve 6 bytes for concat message UDH
// Reserve 6 bytes for concat message UDH
//
// Good references:
// - https://help.goacoustic.com/hc/en-us/articles/360043843154--How-character-encoding-affects-SMS-message-length

This comment has been minimized.

Copy link
@krstdmr

krstdmr Jan 31, 2024

Contributor

Hi @linxGnu. Thanks for adding this link. However I see there is one more point to discuss here. In the link, she mentions about a padding bit when GSM7-Bit is used packed=true in terms gosmpp lib. When I test the code, it adds the padding bit to the end of the message bits which causes not to be decoded by SMSC in our case. But When I little bit modified the codes and when we add the one padding bit to the beginning of the message bits, then it is decoded as expected by the SMSC. I am still working on the case and testing, but I am curious about your opinions here?

Please see the reference here, page 74 about where to add the fill bits when 7-bit coding is used, (padding bit in our case)

You can also test how it is decoded by these web sites and can compare with the one split and decoded by gosmpp;
https://www.smsdeliverer.com/online-sms-pdu-encoder.aspx

This comment has been minimized.

Copy link
@krstdmr

krstdmr Feb 7, 2024

Contributor

Here is the related PR;
#136

// - https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding
//
// Limitation is 160 GSM-7 characters and we also need 6 bytes for UDH
// -> 134 octets per segment
// -> this leaves 153 GSM-7 characters per segment.
segments, err := splitter.EncodeSplit(c.message, data.SM_GSM_MSG_LEN-6)
if err != nil {
return nil, err
Expand Down

0 comments on commit 3c44160

Please sign in to comment.