aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/gsm_04_11.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-04-17 19:35:26 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-04-22 09:09:34 +0200
commitf3f051c010cd78c68af23b1e1cd342d14834c509 (patch)
treeb7d9e5a77b06a2f66de955b752b01a98e29f12ad /openbsc/src/libmsc/gsm_04_11.c
parentfef4059ac3050f05307447c439565e655f56dbe8 (diff)
sms: Kill the sms->sender and use addr/ton/npi throughout the codezecke/features/sms-smpp
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')
-rw-r--r--openbsc/src/libmsc/gsm_04_11.c9
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 2fc250bc8..262312f50 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)
subscr_put(sms->receiver);
#ifdef BUILD_SMPP
@@ -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;
@@ -376,12 +373,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,
gsms->user_data_len,
sms_alphabet == DCS_7BIT_DEFAULT ? gsms->text :