diff options
author | Jan Luebbe <jluebbe@debian.org> | 2009-08-12 15:18:52 +0200 |
---|---|---|
committer | Harald Welte (local) <laflocal@hanuman.gnumonks.org> | 2009-08-13 10:15:09 +0200 |
commit | 336f8ec57a1f33997967b9a5d1e10ec2358ee3d6 (patch) | |
tree | d70f71497005d897e096cbb2a7530b2a1b891f8d /openbsc/src/gsm_04_11.c | |
parent | 06513f26a11cb561d6db6797fa34a3b6db136286 (diff) |
allocate a token for new subscribers
Diffstat (limited to 'openbsc/src/gsm_04_11.c')
-rw-r--r-- | openbsc/src/gsm_04_11.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c index 05e55d4dc..1dc68d0c3 100644 --- a/openbsc/src/gsm_04_11.c +++ b/openbsc/src/gsm_04_11.c @@ -954,6 +954,8 @@ static int subscr_sig_cb(unsigned int subsys, unsigned int signal, struct gsm_lchan *lchan; struct gsm_sms *sms; + u_int32_t token; + switch (signal) { case S_SUBSCR_ATTACHED: /* A subscriber has attached. Check if there are @@ -968,6 +970,18 @@ 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; } |