allocate a token for new subscribers
This commit is contained in:
parent
06513f26a1
commit
336f8ec57a
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue