path: root/openbsc/src/libmsc/gsm_04_11.c
diff options
authorAlexander Chemeris <>2014-03-08 21:57:07 +0100
committerAlexander Chemeris <>2014-03-12 21:24:49 +0400
commitaf9683a3730ef7396adebf2dbd56d4ec8ca6b906 (patch)
tree4ac410b96189e13d5fe0ecaa1b80ff6c39909079 /openbsc/src/libmsc/gsm_04_11.c
parent5ab70da57ae8976a9c55e63de95fabdb057470e6 (diff)
sms,db: Update DB scheme to support more features in our SMSC.
Do not store delivered messages in the DB. In a production system we should not store messages longer than needed, as it will quickly bloat our DB. In case one wants to store messages for debug purposes, we could add one of the following capabilities later: - hexdump to a log file - send to an SMPP entry on delivery - send to Wireshark sms,db: Store SMS Message Reference in the DB, since we need it to generate SMS-STATUS-REPORT. 03.40 (TP-MR) The SMS-STATUS-REPORT also contains a TP-Message-Reference field. The value sent to the MS will be the sameas the TP-Message-Reference value generated by the MS in the earlier SMS-SUBMIT or SMS-COMMAND to whichthe status report relates. sms,db: Add a 'type' filed to gsm_sms structure to be able diffrentiate normal DELIVER/SUBMIT messages from STATUS-REP messages.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_11.c')
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 8bb650e..01cf695 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -92,6 +92,7 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver,
if (!sms)
return NULL;
+ sms->type = GSM_SMS_DELIVER;
sms->receiver = subscr_get(receiver);
strncpy(sms->text, text, sizeof(sms->text)-1);
@@ -299,6 +300,9 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
if (!gsms)
+ /* This is a normal SMS */
+ gsms->type = GSM_SMS_DELIVER;
/* invert those fields where 0 means active/present */
sms_mti = *smsp & 0x03;
sms_mms = !!(*smsp & 0x04);