Open dariusmi opened 7 years ago
This is what SMPP protocol specifications 3.4 and 5 (which are the ones covered by this package) explains about data_ _coding field
0x00 <= data_coding <= 0x0E
"Current behabiour"
0x0F <= data_coding <= 0xBF
Reserved
0xC0 <= data_coding <= 0xDF
GSM MWI control - see [GSM 03.38]: The data_coding parameter will evolve to specify Character code settings only. Thus the recommended way to specify GSM MWI control is by specifying the relevant settings in the TLVs ms_msg_wait_facilities and ms_validity
0xE0 <= data_coding <= 0xEF
Reserved
0xF0 <= data_coding <= 0xFF
GSM message class control - see [GSM 03.38]: The data_coding parameter will evolve to specify Character code settings only. Thus the recommended way to specify GSM message class control is by specifying the relevant setting in the TLV dest_addr_subunit
According to previous specification we should focus on 0x00-0x0E
, 0xC0-0xDF
and 0xF0-0xFF
and avoid Reserved groups:
var encoding = consts.ENCODING.SMSC_DEFAULT;
if (this.data_coding <= 0x0E) {
encoding = this.data_coding & 0x0F;
} else if (this.data_coding >= 0xF0) {
// Bit 2 => 0: Default alphabet - 1: 8-bit data
encoding = (this.data_coding & 0x04) ? consts.ENCODING.BINARY : consts.ENCODING.SMSC_DEFAULT;
} else if (this.data_coding >= 0xC0 && this.data_coding <= 0xDF) {
// Text included in the user data is coded in the Default Alphabet.
// Message should be stored (0xDX) or discarded (0xCX) but no encoding info is provided
} else {
// Reserved
}
defs.filters.message.decode() function detects encoding simply
encoding = this.data_coding & 0x0F;
But according documentation this is incorrect when data_coding carriers more information than only encoding ftp://www.3gpp.org/tsg_t/TSG_T/TSGT_04/Docs/PDFs/TP-99127.pdfWhat about to change line
encoding = this.data_coding & 0x0F;
to