issue a signal once a subscriber is attached or detached
This commit is contained in:
parent
e34e117ff1
commit
ea5cf30d15
|
@ -38,6 +38,7 @@ enum signal_subsystems {
|
|||
SS_ABISIP,
|
||||
SS_NM,
|
||||
SS_LCHAN,
|
||||
SS_SUBSCR,
|
||||
};
|
||||
|
||||
/* SS_PAGING signals */
|
||||
|
@ -69,6 +70,12 @@ enum signal_lchan {
|
|||
S_LCHAN_UNEXPECTED_RELEASE,
|
||||
};
|
||||
|
||||
/* SS_SUBSCR signals */
|
||||
enum signal_subscr {
|
||||
S_SUBSCR_ATTACHED,
|
||||
S_SUBSCR_DETACHED,
|
||||
};
|
||||
|
||||
typedef int signal_cbfn(unsigned int subsys, unsigned int signal,
|
||||
void *handler_data, void *signal_data);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <openbsc/paging.h>
|
||||
#include <openbsc/debug.h>
|
||||
#include <openbsc/paging.h>
|
||||
#include <openbsc/signal.h>
|
||||
#include <openbsc/db.h>
|
||||
|
||||
LLIST_HEAD(active_subscribers);
|
||||
|
@ -170,11 +171,13 @@ int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason)
|
|||
s->net = bts->network;
|
||||
/* Indicate "attached to LAC" */
|
||||
s->lac = bts->location_area_code;
|
||||
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 = 0;
|
||||
dispatch_signal(SS_SUBSCR, S_SUBSCR_DETACHED, s);
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "subscr_update with unknown reason: %d\n",
|
||||
|
|
Loading…
Reference in New Issue