xlab / at

AT is a framework written in Go for communication with AT-compatible devices like Huawei modems via serial port.
MIT License
120 stars 53 forks source link

Issue Decoding message's OA in SMS-DELIVER PDU (Address not set) #33

Open EgosOwn opened 4 months ago

EgosOwn commented 4 months ago

Hello, i think this is not an alphanumeric OA so it should be supported, but it is not properly set. I extract the PDU using AT+CMGR= and do a hex.DecodeString before passing to xlabatSMS.Message.ReadFrom. This approach is working with most SMS, but here is one where the text content is correctly set in the Message instance but the Address (OA) is not.

Warthog's package is able to properly decode this PDU, as is https://www.diafaan.com/sms-tutorials/gsm-modem-tutorial/online-sms-pdu-decoder/

07914150740250F52405C90715F400004250423161226982C8A953076A96DB6F793ACC0611C379D034CC2E8740553888FE06D56025D0DB6C06C55830186C0E7A9B41E6B49B3C7781A0ECFA9C05AA818CEC321E1ACE83DE6E50D95E96E7E9E8B4FB1C024DD16F38C8FDBEEB40683A1D3ED7BD5EE8B9DB15A6D3DD2EBAFD156EDA66F3A533161F8AE92017

Please note the PDU happens to be a spam message so don't open the link that is in it.

I was able to work around using Warthog's package, but i thought i should report the problem.

EgosOwn commented 4 months ago

Oh, it does return this error on ReadFrom, so i guess it is probably user error trying to parse an unsupported format. still confused as the OA is all numeric (shortcode).

sms: unsupported encoding