aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-13 13:49:51 +0200
committerHarald Welte (local) <laflocal@hanuman.gnumonks.org>2009-08-13 13:49:51 +0200
commitaa9dc19ca7e64f63863f7622150fd8ea625baf9f (patch)
tree30ee6632438bb5c4d80409216d3981f3ae8171b6 /openbsc
parent3feef255d256f689fa9227ca12f0be0b17cabe89 (diff)
remove FIRST_CONTACT signal, the subscriber flag is sufficient
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/signal.h1
-rw-r--r--openbsc/src/gsm_04_08.c14
-rw-r--r--openbsc/src/gsm_04_11.c12
3 files changed, 4 insertions, 23 deletions
diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h
index 0dc1772dc..1af849684 100644
--- a/openbsc/include/openbsc/signal.h
+++ b/openbsc/include/openbsc/signal.h
@@ -83,7 +83,6 @@ enum signal_lchan {
enum signal_subscr {
S_SUBSCR_ATTACHED,
S_SUBSCR_DETACHED,
- S_SUBSCR_FIRST_CONTACT,
};
typedef int signal_cbfn(unsigned int subsys, unsigned int signal,
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 65940a0f5..98f2d5603 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -329,9 +329,10 @@ static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
switch (subscriber->net->auth_policy) {
case GSM_AUTH_POLICY_CLOSED:
return subscriber->authorized;
+ case GSM_AUTH_POLICY_TOKEN:
+ return (subscriber->flags & GSM_SUBSCRIBER_FIRST_CONTACT);
case GSM_AUTH_POLICY_ACCEPT_ALL:
return 1;
- case GSM_AUTH_POLICY_TOKEN:
default:
return 0;
}
@@ -1152,12 +1153,8 @@ static int mm_rx_id_resp(struct msgb *msg)
/* look up subscriber based on IMSI, create if not found */
if (!lchan->subscr) {
lchan->subscr = subscr_get_by_imsi(net, mi_string);
- }
- if (!lchan->subscr) {
- lchan->subscr = db_create_subscriber(net, mi_string);
- if (lchan->subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
- dispatch_signal(SS_SUBSCR, S_SUBSCR_FIRST_CONTACT, &lchan->subscr);
- }
+ if (!lchan->subscr)
+ lchan->subscr = db_create_subscriber(net, mi_string);
}
if (lchan->loc_operation)
lchan->loc_operation->waiting_for_imsi = 0;
@@ -1254,9 +1251,6 @@ static int mm_rx_loc_upd_req(struct msgb *msg)
if (!subscr) {
subscr = db_create_subscriber(bts->network, mi_string);
}
- if (subscr->flags & GSM_SUBSCRIBER_FIRST_CONTACT) {
- dispatch_signal(SS_SUBSCR, S_SUBSCR_FIRST_CONTACT, &subscr);
- }
break;
case GSM_MI_TYPE_TMSI:
DEBUGPC(DMM, "\n");
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 1dc68d0c3..5070b5413 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -970,18 +970,6 @@ static int subscr_sig_cb(unsigned int subsys, unsigned int signal,
/* Establish a SAPI3 RLL connection for SMS */
rll_establish(lchan, UM_SAPI_SMS, rll_ind_cb, sms);
break;
- case S_SUBSCR_FIRST_CONTACT:
- /* A new subscriber has just been created in the DB */
- subscr = signal_data;
- if (subscr->net->auth_policy == GSM_AUTH_POLICY_TOKEN) {
- if (db_subscriber_alloc_token(subscr, &token)) {
- /* error: probably use already has a token */
- break;
- } else {
- /* FIXME: send sms with token here */
- }
- }
- break;
default:
break;
}