diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-29 19:19:09 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-07-29 19:19:09 +0800 |
commit | d657c67c9c6a326f82965dc9d76fcb67ac173053 (patch) | |
tree | 89a4ad0db2d5e7f921e952ef18ad4b299563f64a /openbsc | |
parent | 9ad1f2404fa35ffa0b66a6d6aabfd0b744d1a251 (diff) |
osmo-grace: Handle the grace signal to execute a grace action
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/bsc_msc_grace.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/openbsc/src/bsc_msc_grace.c b/openbsc/src/bsc_msc_grace.c index 29423041b..bd95be2e2 100644 --- a/openbsc/src/bsc_msc_grace.c +++ b/openbsc/src/bsc_msc_grace.c @@ -27,3 +27,34 @@ int bsc_grace_allow_new_connection(struct gsm_network *network) { return network->rf->policy == S_RF_ON; } + +/* + * The place to handle the grace mode. Right now we will send + * USSD messages to the subscriber, in the future we might start + * a timer to have different modes for the grace period. + */ +static int handle_grace(struct gsm_network *network) +{ + return 0; +} + +static int handle_rf_signal(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct rf_signal_data *sig; + + if (subsys != SS_RF) + return -1; + + sig = signal_data; + + if (signal == S_RF_GRACE) + handle_grace(sig->net); + + return 0; +} + +static __attribute__((constructor)) void on_dso_load_grace(void) +{ + register_signal_handler(SS_RF, handle_rf_signal, NULL); +} |