fix paging: add timeout to discard unsuccessful paging

Currently, if there is no reply from the BSS / RNC, a subscriber will remain as
"already paged" forever, and is never going to be paged again. Even on IMSI
Detach, the pending request will keep a ref count on the vlr_subscr.

Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the
'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' /
'T3113' in OsmoBSC, but to not confuse the two, give this a different name.)

Add test_ms_timeout_paging() test to verify the timeout works.

I hit this while testing Paging across multiple hNodeB, when a UE lost
connection to the hNodeB. I noticed that no matter how long I wait, no Paging
is sent out anymore, and found this embarrassing issue. Good grief...

The choice of 10 seconds is taken from https://osmocom.org/issues/2756

Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 6349fe0..1b0bff9 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -344,6 +344,7 @@
 	GSM_AUTH_POLICY_REGEXP, /* accept IMSIs matching given regexp */
 };
 
+#define MSC_PAGING_RESPONSE_TIMER_DEFAULT 10
 
 struct gsm_tz {
 	int override; /* if 0, use system's time zone instead. */
@@ -408,6 +409,7 @@
 	unsigned int num_bts;
 	struct llist_head bts_list;
 
+	unsigned int paging_response_timer;
 
 	/* timer to expire old location updates */
 	struct osmo_timer_list subscr_expire_timer;
diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h
index b625608..1b365a9 100644
--- a/include/osmocom/msc/vlr.h
+++ b/include/osmocom/msc/vlr.h
@@ -157,6 +157,7 @@
 	struct {
 		/* pending requests */
 		bool is_paging;
+		struct osmo_timer_list paging_response_timer;
 		/* list of struct subscr_request */
 		struct llist_head requests;
 		uint8_t lac;