bts_pch_timer: Fix timer working only for MI type IMSI

This commit actually addresses 2 errors:

1- gprs_bssgp_pcu_rx_paging_ps() called gprs_rlcmac_paging_request()
with MI which can be either TMSI or IMSI, and the later always called
bts_pch_timer_start() passing mi->imsi regardless of the MI type. Hence,
trash was being accessed & stored into bts_pch_timer structures if MI
type used for paging was TMSI.

2- When the MS received the PS paging on CCCH and requests an UL TBF, it
will send some data. If one phase access is used for whatever reason,
the IMSI may not be yet available in the GprsMs object since we never
received it (and we'd only have it by means of PktResourceReq). Hence,
let's better first try to match the paging by TLLI/TMSI if set in both
places, and otherwise use the IMSI.

Related: OS#5297
Change-Id: Iedffb7c6978a3faf0fc26ce2181dde9791a8b6f4
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index 35bbfc4..cd9c7bc 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -806,15 +806,17 @@
 static void test_bts_pch_timer(void)
 {
 	struct gprs_rlcmac_bts *bts = bts_alloc(the_pcu, 0);
-	const char *imsi1 = "1234";
-	const char *imsi2 = "5678";
+	struct osmo_mobile_identity mi_imsi1, mi_imsi2;
+	mi_imsi1.type = mi_imsi2.type = GSM_MI_TYPE_IMSI;
+	OSMO_STRLCPY_ARRAY(mi_imsi1.imsi, "1234");
+	OSMO_STRLCPY_ARRAY(mi_imsi2.imsi, "5678");
 
 	fprintf(stderr, "Testing bts_pch_timer dealloc on bts dealloc\n");
 	log_set_category_filter(osmo_stderr_target, DPCU, 1, LOGL_DEBUG);
 
 	fprintf(stderr, "Starting PCH timer for 2 IMSI\n");
-	bts_pch_timer_start(bts, imsi1);
-	bts_pch_timer_start(bts, imsi2);
+	bts_pch_timer_start(bts, &mi_imsi1, mi_imsi1.imsi);
+	bts_pch_timer_start(bts, &mi_imsi2, mi_imsi2.imsi);
 
 	fprintf(stderr, "Deallocating BTS, expecting the PCH timer to be stopped and deallocated\n");
 	talloc_free(bts);