summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-08-03 16:03:18 -0500
committerBrandon Bayer <bbayer@multitech.com>2016-08-03 16:03:18 -0500
commite4fc2ab6cca31a901fe4df9605332b9d940ad8c2 (patch)
tree6cb6583f08ce9b62f682902eb33a09ddbf14753b /src
parent41abe2c0e76ede64a043f710f217caaca16763b6 (diff)
downloadsms-utils-e4fc2ab6cca31a901fe4df9605332b9d940ad8c2.tar.gz
sms-utils-e4fc2ab6cca31a901fe4df9605332b9d940ad8c2.tar.bz2
sms-utils-e4fc2ab6cca31a901fe4df9605332b9d940ad8c2.zip
fix:decode: add support for decoding GSM PDU encoding 011.0.2bb
Discovered in portal case #5072165 https://support.multitech.com/support/case.html?action=view&id=72165
Diffstat (limited to 'src')
-rw-r--r--src/pdu.h1
-rw-r--r--src/pdu_decode.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/pdu.h b/src/pdu.h
index 60243ec..9e399c9 100644
--- a/src/pdu.h
+++ b/src/pdu.h
@@ -52,6 +52,7 @@ enum {
//PDU data formats (how the data was represented before encoding)
enum {
PDU_ALPHABET_DEFAULT = 0, //GSM 7-bit, (supposedly CDMA 8-bit but haven't seen it)
+ PDU_ALPHABET_DEFAULT2 = 1, //GSM 7-bit (used with some shortcodes)
PDU_ALPHABET_CDMA_DEFAULT = 2, //no GSM, CDMA 7-bit
PDU_ALPHABET_EIGHT = 4, //GSM 8-bit, CDMA 16-bit unicode
PDU_ALPHABET_CDMA_EIGHT = 8, //GSM 16-bit, CDMA 8-bit (what CDMA radios are actually using)
diff --git a/src/pdu_decode.c b/src/pdu_decode.c
index 5acb07b..ebe939e 100644
--- a/src/pdu_decode.c
+++ b/src/pdu_decode.c
@@ -194,7 +194,9 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe
}
- if (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT) {
+ if (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT ||
+ pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT2)
+ {
log_debug("data coding alphabet is default (7-bit)");
} else if (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI) {
log_debug("data coding alphabet is default (7-bit) multi-part");
@@ -214,6 +216,7 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe
// VERIFY DATA LENGTH AND GET NUMBER OF OCTETS (ACTUAL DATA BYTES IN PDU STRING)
// -----------------------------------------------------------------------------
if ((pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT) ||
+ (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT2) ||
(pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI)) {
if (pdu->user_data_len > PDU_UD_7BIT_MAX) {
log_warning("pdu contains invalid user-data-len: 0x%02X",
@@ -277,6 +280,7 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe
// ---------------------------------------------------------
// GSM 7-BIT & LVW2 7-BIT MULTI-PART
if ((pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT) ||
+ (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT2) ||
(pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI)) {
// Keep UDH for concatenated SMS.
// Otherwise it is impossible to process correctly concatenated SMS.
@@ -345,6 +349,7 @@ int pdu_decode_user_data(const char *pdu_str, struct pdu_info *pdu, int *nr_octe
// (includes LVW2 multi-part)
// ---------------------------------------------------------------------
if ((pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT) ||
+ (pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT2) ||
(pdu->data_coding.general.alphabet == PDU_ALPHABET_DEFAULT_MULTI)) {
int read = user_data_start_index;
int store = user_data_start_index;