aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@netfilter.org>2009-12-24 14:50:24 +0100
committerHarald Welte <laforge@netfilter.org>2009-12-24 14:50:24 +0100
commit2e6d4684ffd9bb908b6e9e2d16d669f8bb91d899 (patch)
treeb393f9650fe0253516aac7edb274b5dfb9fc0570 /openbsc/src/gsm_subscriber.c
parent844eab1df5fd6d09ec56f21ba59df910af8c8579 (diff)
add (and use) new subscr_name() function to get name or IMSI
Diffstat (limited to 'openbsc/src/gsm_subscriber.c')
-rw-r--r--openbsc/src/gsm_subscriber.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index 74ec983a..69250875 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -34,6 +34,14 @@
extern struct llist_head *subscr_bsc_active_subscriber(void);
+char *subscr_name(struct gsm_subscriber *subscr)
+{
+ if (strlen(subscr->name))
+ return subscr->name;
+
+ return subscr->imsi;
+}
+
struct gsm_subscriber *subscr_get_by_tmsi(struct gsm_network *net,
u_int32_t tmsi)
{
@@ -101,14 +109,14 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
/* Indicate "attached to LAC" */
s->lac = bts->location_area_code;
LOGP(DMM, LOGL_INFO, "Subscriber %s ATTACHED LAC=%u\n",
- s->imsi, s->lac);
+ subscr_name(s), s->lac);
dispatch_signal(SS_SUBSCR, S_SUBSCR_ATTACHED, s);
break;
case GSM_SUBSCRIBER_UPDATE_DETACHED:
/* Only detach if we are currently in this area */
if (bts->location_area_code == s->lac)
s->lac = GSM_LAC_RESERVED_DETACHED;
- LOGP(DMM, LOGL_INFO, "Subscriber %s DETACHED\n", s->imsi);
+ LOGP(DMM, LOGL_INFO, "Subscriber %s DETACHED\n", subscr_name(s));
dispatch_signal(SS_SUBSCR, S_SUBSCR_DETACHED, s);
break;
default: