summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libgsmd/sms.h44
-rw-r--r--src/gsmd/sms_pdu.c4
2 files changed, 46 insertions, 2 deletions
diff --git a/include/libgsmd/sms.h b/include/libgsmd/sms.h
index 4575fd9..7795394 100644
--- a/include/libgsmd/sms.h
+++ b/include/libgsmd/sms.h
@@ -36,6 +36,50 @@ struct lgsm_sms_delete {
enum lgsm_msg_sms_delflg delflg;
};
+/* TP-Status from 3GPP TS 23.040 section 9.2.3.15 */
+enum lgsm_tp_status {
+ /* sms received sucessfully */
+ TP_STATUS_RECEIVED_OK = 0x00,
+ TP_STATUS_UNABLE_TO_CONFIRM_DELIVERY = 0x01,
+ TP_STATUS_REPLACED = 0x02,
+ /* Reserved: 0x03 - 0x0f */
+ /* Values specific to each SC: 0x10 - 0x1f */
+ /* Temporary error, SC still trying to transfer SM: */
+ TP_STATUS_TRY_CONGESTION = 0x20,
+ TP_STATUS_TRY_SME_BUSY = 0x21,
+ TP_STATUS_TRY_NO_RESPONSE_FROM_SME = 0x22,
+ TP_STATUS_TRY_SERVICE_REJECTED = 0x23,
+ TP_STATUS_TRY_QOS_NOT_AVAILABLE = 0x24,
+ TP_STATUS_TRY_SME_ERROR = 0x25,
+ /* Reserved: 0x26 - 0x2f */
+ /* Values specific to each SC: 0x30 - 0x3f */
+ /* Permanent error, SC is not making any more transfer attempts: */
+ TP_STATUS_PERM_REMOTE_PROCEDURE_ERROR = 0x40,
+ TP_STATUS_PERM_INCOMPATIBLE_DEST = 0x41,
+ TP_STATUS_PERM_REJECTED_BY_SME = 0x42,
+ TP_STATUS_PERM_NOT_OBTAINABLE = 0x43,
+ TP_STATUS_PERM_QOS_NOT_AVAILABLE = 0x44,
+ TP_STATUS_PERM_NO_INTERWORKING = 0x45,
+ TP_STATUS_PERM_VALID_PER_EXPIRED = 0x46,
+ TP_STATUS_PERM_DELETED_BY_ORIG_SME = 0x47,
+ TP_STATUS_PERM_DELETED_BY_SC_ADMIN = 0x48,
+ TP_STATUS_PERM_SM_NO_EXIST = 0x49,
+ /* Reserved: 0x4a - 0x4f */
+ /* Values specific to each SC: 0x50 - 0x5f */
+ /* Temporary error, SC is not making any more transfer attempts: */
+ TP_STATUS_TMP_CONGESTION = 0x60,
+ TP_STATUS_TMP_SME_BUSY = 0x61,
+ TP_STATUS_TMP_NO_RESPONSE_FROM_SME = 0x62,
+ TP_STATUS_TMP_SERVICE_REJECTED = 0x63,
+ TP_STATUS_TMP_QOS_NOT_AVAILABLE = 0x64,
+ TP_STATUS_TMP_SME_ERROR = 0x65,
+ /* Reserved: 0x66 - 0x6f */
+ /* Values specific to each SC: 0x70 - 0x7f */
+ /* Reserved: 0x80 - 0xff */
+ TP_STATUS_NONE = 0xFF
+};
+
+
/* Refer to GSM 03.40 subclause 9.2.2.2 */
#define LGSM_SMS_ADDR_MAXLEN 12
#define LGSM_SMS_DATA_MAXLEN 140
diff --git a/src/gsmd/sms_pdu.c b/src/gsmd/sms_pdu.c
index ae7a69d..08a0c1a 100644
--- a/src/gsmd/sms_pdu.c
+++ b/src/gsmd/sms_pdu.c
@@ -221,9 +221,9 @@ int sms_pdu_to_msg(struct gsmd_sms_list *dst,
return 1;
/* TP-MR set it gsmd_sms_list.index*/
- dst->index = (int) src[1];
+ dst->index = (u_int8_t) src[1];
/* TP-STATUS set it to coding_scheme */
- dst->payload.coding_scheme = (int) src[len-1];
+ dst->payload.coding_scheme = (u_int8_t) src[len-1];
/* TP-RA */
i = sms_number_bytelen(src[3], src[2]);
if (len < 13 + i)
personal git repositories of Harald Welte. Your mileage may vary