path: root/openbsc/src/libmsc/gsm_04_11.c
diff options
authorHolger Hans Peter Freyther <>2013-10-08 03:17:30 +0200
committerHolger Hans Peter Freyther <>2014-03-07 19:48:49 +0100
commitf2914cf2fbcaac7e3bf31d099a0fa856cbf16f20 (patch)
treecbfeba7a15598214b797dae2323753d7f09de624 /openbsc/src/libmsc/gsm_04_11.c
parent7e20f64f271264cd620afe2b71b4866689c00df5 (diff)
sms: Kill the sms->sender and use addr/ton/npi throughout the code
This is an incompatible database schema change. Store the type of the address in the database for both the sender and the receiver. Currently it is possible to use SMPP to store a SMS and the NPI and TON will be lost on the delivery of the SMS. The schema is changed to make the delivery always use the right NPI/TON. This patch is not ready for the master branch as there is no upgrade path for the HLR yet.
Diffstat (limited to 'openbsc/src/libmsc/gsm_04_11.c')
1 files changed, 2 insertions, 7 deletions
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 975a263ae..566feb981 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -73,8 +73,6 @@ struct gsm_sms *sms_alloc(void)
void sms_free(struct gsm_sms *sms)
/* drop references to subscriber structure */
- if (sms->sender)
- subscr_put(sms->sender);
if (sms->receiver)
@@ -97,8 +95,7 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver,
sms->receiver = subscr_get(receiver);
strncpy(sms->text, text, sizeof(sms->text)-1);
- sms->sender = subscr_get(sender);
- strncpy(sms->src.addr, sms->sender->extension, sizeof(sms->src.addr)-1);
+ strncpy(sms->src.addr, sender->extension, sizeof(sms->src.addr)-1);
sms->reply_path_req = 0;
sms->status_rep_req = 0;
sms->ud_hdr_ind = 0;
@@ -378,12 +375,10 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
- gsms->sender = subscr_get(conn->subscr);
LOGP(DLSMS, LOGL_INFO, "RX SMS: Sender: %s, MTI: 0x%02x, VPF: 0x%02x, "
"MR: 0x%02x PID: 0x%02x, DCS: 0x%02x, DA: %s, "
"UserDataLength: 0x%02x, UserData: \"%s\"\n",
- subscr_name(gsms->sender), sms_mti, sms_vpf, gsms->msg_ref,
+ subscr_name(conn->subscr), sms_mti, sms_vpf, gsms->msg_ref,
gsms->protocol_id, gsms->data_coding_scheme, gsms->dst.addr,
sms_alphabet == DCS_7BIT_DEFAULT ? gsms->text :