use gsm_bts_by_lac() function to start paging of all bts with same lac

when paging is successfull, the paging_request_stop() function is called
with the current lchan, so the callback function will be called. for all
other bts', the paging_request_stop() function is called without lchan,
so the paging is stopped, but the callback function is not called.

this ensures that only one paging result is received when paging
multiple BTS. (Andreas Eversberg)
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 274d3b6..0630764 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -1016,6 +1016,7 @@
 	u_int8_t mi_type = mi_lv[1] & GSM_MI_TYPE_MASK;
 	char mi_string[MI_SIZE];
 	struct gsm_subscriber *subscr;
+	struct gsm_bts *bts;
 	struct paging_signal_data sig_data;
 	int rc = 0;
 
@@ -1059,8 +1060,22 @@
 	sig_data.lchan	= msg->lchan;
 
 	dispatch_signal(SS_PAGING, S_PAGING_COMPLETED, &sig_data);
+
+	/* Stop paging on the bts we received the paging response */
 	paging_request_stop(msg->trx->bts, subscr, msg->lchan);
 
+	/* Stop paging on all other bts' */
+	bts = NULL;
+	do {
+		bts = gsm_bts_by_lac(msg->trx->bts->network, subscr->lac, bts);
+		if (!bts)
+			break;
+		if (bts == msg->trx->bts)
+			continue;
+		/* Stop paging */
+		paging_request_stop(bts, subscr, NULL);
+	} while (1);
+
 	/* FIXME: somehow signal the completion of the PAGING to
 	 * the entity that requested the paging */
 
@@ -1295,6 +1310,7 @@
 	struct gsm48_hdr *gh = msgb_l3(msg);
 	unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh);
 	struct gsm_subscriber *called_subscr;
+	struct gsm_bts *bts;
 	char called_number[(43-2)*2 + 1] = "\0";
 	struct tlv_parsed tp;
 	u_int8_t num_type;
@@ -1338,12 +1354,17 @@
 	subscr_get(msg->lchan->subscr);
 	call->called_subscr = called_subscr;
 
-	/* start paging of the receiving end of the call */
-	/* FIXME: we're assuming that the receiver is at the same BTS
-	 * than we are, which is obviously a wrong assumption in multi-BTS
-	 * case */
-	paging_request(msg->trx->bts, called_subscr, RSL_CHANNEED_TCH_F,
-			setup_trig_pag_evt, call);
+	/* Start paging subscriber on all BTS in LAC of subscriber */
+	bts = NULL;
+	do {
+		bts = gsm_bts_by_lac(msg->trx->bts->network,
+				     msg->lchan->subscr->lac, bts);
+		if (!bts)
+			break;
+		/* Trigger paging */
+		paging_request(bts, called_subscr, RSL_CHANNEED_TCH_F,
+				setup_trig_pag_evt, call);
+	} while (1);
 
 	/* send a CALL PROCEEDING message to the MO */
 	ret = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,