summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;