diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-15 09:16:09 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-11-15 20:06:50 +0100 |
commit | 9c838ae0692105b3a0e4dc3eb93e32b56924db6e (patch) | |
tree | 7fbedcfc160b266157ea8cf9f9cb67ba1556238d | |
parent | b79c3c97a2772fcee1d78b16af96b81287b2be7f (diff) |
bsc: Implement paging by creating a dummy subscr for the paging
In the future we should avoid using a gsm_subscriber at all
and pass the imsi/tmsi to the paging function directly. For
now we can use the old model for paging and go through the
gsm_subscriber. This has the benefit of load balancing on
the BTS and such.
-rw-r--r-- | openbsc/src/bsc/osmo_bsc_bssap.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/openbsc/src/bsc/osmo_bsc_bssap.c b/openbsc/src/bsc/osmo_bsc_bssap.c index c6bf4f4dd..2985cc51b 100644 --- a/openbsc/src/bsc/osmo_bsc_bssap.c +++ b/openbsc/src/bsc/osmo_bsc_bssap.c @@ -23,7 +23,9 @@ #include <openbsc/osmo_bsc_grace.h> #include <openbsc/osmo_msc_data.h> #include <openbsc/debug.h> +#include <openbsc/gsm_subscriber.h> #include <openbsc/mgcp.h> +#include <openbsc/paging.h> #include <osmocore/gsm0808.h> #include <osmocore/protocol/gsm_08_08.h> @@ -108,6 +110,7 @@ static int bssmap_handle_reset_ack(struct gsm_network *net, static int bssmap_handle_paging(struct gsm_network *net, struct msgb *msg, unsigned int payload_length) { + struct gsm_subscriber *subscr; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; @@ -167,9 +170,18 @@ static int bssmap_handle_paging(struct gsm_network *net, LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } + subscr = subscr_get_or_create(net, mi_string); + if (!subscr) { + LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); + return -1; + } + + subscr->lac = lac; + subscr->tmsi = tmsi; + LOGP(DMSC, LOGL_DEBUG, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - LOGP(DMSC, LOGL_ERROR, "Paging is not implemented...\n"); - return -1; + paging_request(net, subscr, chan_needed, NULL, NULL); + return 0; } /* |