aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
committerHarald Welte <laforge@gnumonks.org>2009-08-08 16:03:15 +0200
commit76042188e09d2ea5f138474ade70e1f74f317aea (patch)
treee5575789a35674ee676ece472b75394d2e283f76 /openbsc/src/gsm_subscriber.c
parent1d014a5dfc45fb09cec28a7327b36ae53458ca8e (diff)
first 'working' SMS implementation
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
Diffstat (limited to 'openbsc/src/gsm_subscriber.c')
-rw-r--r--openbsc/src/gsm_subscriber.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index fe7bb6ac..d91298ee 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -163,6 +163,22 @@ struct gsm_subscriber *subscr_get_by_extension(struct gsm_network *net,
return db_get_subscriber(net, GSM_SUBSCRIBER_EXTENSION, ext);
}
+struct gsm_subscriber *subscr_get_by_id(struct gsm_network *net,
+ unsigned long long id)
+{
+ struct gsm_subscriber *subscr;
+ char buf[32];
+ sprintf(buf, "%llu", id);
+
+ llist_for_each_entry(subscr, &active_subscribers, entry) {
+ if (subscr->id == id)
+ return subscr_get(subscr);
+ }
+
+ return db_get_subscriber(net, GSM_SUBSCRIBER_ID, buf);
+}
+
+
int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
{
/* FIXME: Migrate pending requests from one BSC to another */