export the 'trx_is_usable() function and use it from paging

this ensures we don't send paging requests to currently inactive transceivers.
diff --git a/openbsc/include/openbsc/chan_alloc.h b/openbsc/include/openbsc/chan_alloc.h
index fa86630..f564e9e 100644
--- a/openbsc/include/openbsc/chan_alloc.h
+++ b/openbsc/include/openbsc/chan_alloc.h
@@ -61,4 +61,6 @@
 void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts);
 void network_chan_load(struct pchan_load *pl, struct gsm_network *net);
 
+int trx_is_usable(struct gsm_bts_trx *trx);
+
 #endif /* _CHAN_ALLOC_H */
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index abf4de8..8141e47 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -47,7 +47,7 @@
 	return 1;
 }
 
-static int trx_is_usable(struct gsm_bts_trx *trx)
+int trx_is_usable(struct gsm_bts_trx *trx)
 {
 	/* FIXME: How does this behave for BS-11 ? */
 	if (is_ipaccess_bts(trx->bts)) {
diff --git a/openbsc/src/paging.c b/openbsc/src/paging.c
index 820773a..b5dc2d0 100644
--- a/openbsc/src/paging.c
+++ b/openbsc/src/paging.c
@@ -265,6 +265,11 @@
 		bts = gsm_bts_by_lac(network, subscr->lac, bts);
 		if (!bts)
 			break;
+
+		/* skip all currently inactive TRX */
+		if (!trx_is_usable(bts->c0))
+			continue;
+
 		num_pages++;
 
 		/* Trigger paging, pass any error to caller */