MSC_ConnectionHandler: Add 5s guard timer
diff --git a/ipa/MSC_ConnectionHandler.ttcn b/ipa/MSC_ConnectionHandler.ttcn
index 4426cfd..6a9a57f 100644
--- a/ipa/MSC_ConnectionHandler.ttcn
+++ b/ipa/MSC_ConnectionHandler.ttcn
@@ -70,11 +70,15 @@
 /* main function processing various incoming events */
 function main(integer connection_id, integer e1_timeslot) runs on MSC_ConnHdlr {
 	var MgcpResponse mgcp_rsp;
+	timer T := 5.0;
 
 	g_sccp_conn_id := connection_id;
 	g_call_id := f_mgcp_alloc_call_id();
 	g_ep_name := hex2str(int2hex(e1_timeslot, 1)) & "@mgw";
 
+	/* we just accepted an incoming SCCP connection, start guard timer */
+	T.start;
+
 	while (true) {
 		var PDU_BSSAP bssap;
 		alt {
@@ -135,6 +139,14 @@
 		[] BSSAP.receive(PDU_BSSAP:?) -> value bssap {
 			log("Received unhandled SCCP-CO: ", bssap);
 			}
+
+		/* Guard timer has expired, close connection */
+		[] T.timeout {
+			BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ);
+			setverdict(inconc);
+			self.stop;
+			}
+
 		}
 	}
 }