aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-04-12 05:37:29 +0000
committerHolger Freyther <zecke@selfish.org>2009-04-12 05:37:29 +0000
commit4a49e77ff43ae0ec152a351603fbe91ec30efe8c (patch)
treed5801956ecddfae198152083613b571e351dd537 /src/gsm_subscriber.c
parentbab9cd9a2715e416664d08a56bdacefd6e921e4f (diff)
[subscriber] Update the current_bts field on imsi detach and LOC accept
When sending LOCATION UPDATING REQUEST Accept or when getting a IMSI Detach update the gsm_bts of the gsm_subscriber.
Diffstat (limited to 'src/gsm_subscriber.c')
-rw-r--r--src/gsm_subscriber.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gsm_subscriber.c b/src/gsm_subscriber.c
index d4dfea49a..e3cd5eb25 100644
--- a/src/gsm_subscriber.c
+++ b/src/gsm_subscriber.c
@@ -90,8 +90,23 @@ struct gsm_subscriber *subscr_get_by_extension(const char *ext)
return db_get_subscriber(GSM_SUBSCRIBER_EXTENSION, ext);
}
-int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts)
+int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
{
+ /* FIXME: Migrate pending requests from one BSC to another */
+ switch (reason) {
+ case GSM_SUBSCRIBER_UPDATE_ATTACHED:
+ s->current_bts = bts;
+ break;
+ case GSM_SUBSCRIBER_UPDATE_DETACHED:
+ /* Only detach if we are currently attached to this bts */
+ if (bts == s->current_bts)
+ s->current_bts = NULL;
+ break;
+ default:
+ fprintf(stderr, "subscr_update with unknown reason: %d\n",
+ reason);
+ break;
+ };
return db_sync_subscriber(s);
}