From 04866d42792f59b334a13e836237947222b41127 Mon Sep 17 00:00:00 2001 From: Holger Freyther Date: Tue, 31 Mar 2009 04:35:19 +0200 Subject: Proposal for a "channel request" interface... Reuqests for a subscriber a stored within the gsm_subscriber datastructure and it will keep track how many channels are allocated for this user and of which type to decide on policy... e.g. attempt to submit SMS during a phone call and not doing paging but a simple (immediate) assignment of the channel... --- openbsc/include/openbsc/gsm_subscriber.h | 6 ++++++ openbsc/include/openbsc/paging.h | 2 +- openbsc/src/gsm_04_08.c | 2 +- openbsc/src/gsm_subscriber.c | 11 +++++++++++ openbsc/src/paging.c | 4 ++-- 5 files changed, 21 insertions(+), 4 deletions(-) (limited to 'openbsc') diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index 1ca79e2ae..f787aebd5 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -31,6 +31,9 @@ struct gsm_subscriber { u_int8_t classmark2[3]; u_int8_t classmark3_len; u_int8_t classmark3[14]; + + /* pending requests */ + struct llist_head requests; }; enum gsm_subscriber_field { @@ -51,6 +54,9 @@ struct gsm_subscriber *subscr_get_by_imsi(const char *imsi); struct gsm_subscriber *subscr_get_by_extension(const char *ext); int subscr_update(struct gsm_subscriber *s, struct gsm_bts *bts, int reason); void subscr_put_channel(struct gsm_lchan *lchan); +void subscr_get_channel(struct gsm_subscriber *subscr, + struct gsm_network *network, int type, + gsm_cbfn *cbfn, void *param); /* internal */ struct gsm_subscriber *subscr_alloc(void); diff --git a/openbsc/include/openbsc/paging.h b/openbsc/include/openbsc/paging.h index de512d1ae..2f17e243e 100644 --- a/openbsc/include/openbsc/paging.h +++ b/openbsc/include/openbsc/paging.h @@ -33,7 +33,7 @@ void paging_init(struct gsm_bts *bts); /* schedule paging request */ -void paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, +void paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, int type, gsm_cbfn *cbfn, void *data); /* stop paging requests */ diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c index 804c15dee..fd4be2fb8 100644 --- a/openbsc/src/gsm_04_08.c +++ b/openbsc/src/gsm_04_08.c @@ -1333,7 +1333,7 @@ static int gsm48_cc_rx_setup(struct msgb *msg) call->called_subscr = called_subscr; /* Start paging subscriber on all BTS in LAC of subscriber */ - paging_request(msg->trx->bts, called_subscr, RSL_CHANNEED_TCH_F, + subscr_get_channel(called_subscr, msg->trx->bts->network, RSL_CHANNEED_TCH_F, setup_trig_pag_evt, call); /* send a CALL PROCEEDING message to the MO */ diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c index 3f608ec30..3a8179335 100644 --- a/openbsc/src/gsm_subscriber.c +++ b/openbsc/src/gsm_subscriber.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -45,6 +46,8 @@ struct gsm_subscriber *subscr_alloc(void) llist_add_tail(&s->entry, &active_subscribers); s->use_count = 1; + INIT_LLIST_HEAD(&s->requests); + return s; } @@ -131,6 +134,13 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr) return NULL; } +void subscr_get_channel(struct gsm_subscriber *subscr, + struct gsm_network *network, int type, + gsm_cbfn *cbfn, void *param) +{ + paging_request(network, subscr, type, cbfn, param); +} + void subscr_put_channel(struct gsm_lchan *lchan) { /* @@ -141,3 +151,4 @@ void subscr_put_channel(struct gsm_lchan *lchan) */ put_lchan(lchan); } + diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c index df11da0e6..8f15e1640 100644 --- a/openbsc/src/paging.c +++ b/openbsc/src/paging.c @@ -237,13 +237,13 @@ static void _paging_request(struct gsm_bts *bts, struct gsm_subscriber *subscr, bsc_schedule_timer(&bts_entry->work_timer, 1, 0); } -void paging_request(struct gsm_bts *_bts, struct gsm_subscriber *subscr, +void paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, int type, gsm_cbfn *cbfn, void *data) { struct gsm_bts *bts = NULL; do { - bts = gsm_bts_by_lac(_bts->network, subscr->lac, bts); + bts = gsm_bts_by_lac(network, subscr->lac, bts); if (!bts) break; -- cgit v1.2.3