diff --git a/src/bts.cpp b/src/bts.cpp index 2dc8ffb5..dc20259c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -134,6 +134,7 @@ static const struct rate_ctr_desc bts_ctr_description[] = { { "llc:dl_bytes", "RLC encapsulated PDUs"}, { "llc:ul_bytes", "full PDUs received "}, { "pch:requests", "PCH requests sent "}, + { "pch:requests:already", "PCH requests on subscriber already being paged"}, { "pch:requests:timeout", "PCH requests timeout "}, { "rach:requests", "RACH requests received"}, { "rach:requests:11bit", "11BIT_RACH requests received"}, diff --git a/src/bts.h b/src/bts.h index 3f482c9a..3a58c636 100644 --- a/src/bts.h +++ b/src/bts.h @@ -126,6 +126,7 @@ enum { CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_PCH_REQUESTS, + CTR_PCH_REQUESTS_ALREADY, CTR_PCH_REQUESTS_TIMEDOUT, CTR_RACH_REQUESTS, CTR_RACH_REQUESTS_11BIT, diff --git a/src/bts_pch_timer.c b/src/bts_pch_timer.c index 312d85a9..d7211551 100644 --- a/src/bts_pch_timer.c +++ b/src/bts_pch_timer.c @@ -41,7 +41,7 @@ static struct bts_pch_timer *bts_pch_timer_get_by_ptmsi(struct gprs_rlcmac_bts * return NULL; } -static struct bts_pch_timer *bts_pch_timer_get_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi) +struct bts_pch_timer *bts_pch_timer_get_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi) { struct bts_pch_timer *p; @@ -77,10 +77,6 @@ void bts_pch_timer_start(struct gprs_rlcmac_bts *bts, const struct osmo_mobile_i struct bts_pch_timer *p; struct osmo_tdef *tdef; - /* We already have a timer running for this IMSI */ - if (bts_pch_timer_get_by_imsi(bts, imsi)) - return; - p = talloc_zero(bts, struct bts_pch_timer); llist_add_tail(&p->entry, &bts->pch_timer); p->bts = bts; diff --git a/src/bts_pch_timer.h b/src/bts_pch_timer.h index 3e471618..cc5dcb05 100644 --- a/src/bts_pch_timer.h +++ b/src/bts_pch_timer.h @@ -42,6 +42,7 @@ void bts_pch_timer_start(struct gprs_rlcmac_bts *bts, const struct osmo_mobile_i const char *imsi); void bts_pch_timer_stop(struct gprs_rlcmac_bts *bts, const struct GprsMs *ms); void bts_pch_timer_stop_all(struct gprs_rlcmac_bts *bts); +struct bts_pch_timer *bts_pch_timer_get_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi); #ifdef __cplusplus } diff --git a/src/gprs_bssgp_pcu.c b/src/gprs_bssgp_pcu.c index 424a3814..4328e079 100644 --- a/src/gprs_bssgp_pcu.c +++ b/src/gprs_bssgp_pcu.c @@ -320,6 +320,11 @@ static int gprs_bssgp_pcu_rx_paging_ps(struct msgb *msg, const struct tlv_parsed /* FIXME: look if MS is attached a specific BTS and then only page on that one? */ llist_for_each_entry(bts, &the_pcu->bts_list, list) { + if (bts_pch_timer_get_by_imsi(bts, mi_imsi.imsi)) { + LOGP(DBSSGP, LOGL_INFO, "PS-Paging request already pending for IMSI=%s\n", mi_imsi.imsi); + bts_do_rate_ctr_inc(bts, CTR_PCH_REQUESTS_ALREADY); + continue; + } if (gprs_rlcmac_paging_request(bts, &paging_mi, pgroup) < 0) continue; bts_pch_timer_start(bts, &paging_mi, mi_imsi.imsi);