BSSMAP: Ignore RSPI for unknown endpoint/CIC
diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn
index d6c3aed..42f7739 100644
--- a/library/BSSMAP_Emulation.ttcn
+++ b/library/BSSMAP_Emulation.ttcn
@@ -83,6 +83,17 @@
 	return false;
 }
 
+private function f_cic_known(integer cic)
+runs on BSSMAP_Emulation_CT return boolean {
+	var integer i;
+	for (i := 0; i < sizeof(ConnectionTable); i := i+1) {
+		if (ConnectionTable[i].cic == cic) {
+			return true;
+		}
+	}
+	return false;
+}
+
 /* resolve component reference by connection ID */
 private function f_comp_by_conn_id(integer sccp_conn_id)
 runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr {
@@ -380,9 +391,13 @@
 			/* MGCP request from network side (we're BSC/MGW) */
 			/* Extract CIC from local part of endpoint name */
 			var integer cic := f_mgcp_ep_extract_cic(mgcp_req.line.ep);
-			/* Resolve the vc_conn by the CIC */
-			vc_conn := f_comp_by_cic(cic);
-			CLIENT.send(mgcp_req) to vc_conn;
+			if (match(mgcp_req, tr_RSIP) and f_cic_known(cic) == false) {
+				/* ignore RSIP for unknown CIC */
+			} else {
+				/* Resolve the vc_conn by the CIC */
+				vc_conn := f_comp_by_cic(cic);
+				CLIENT.send(mgcp_req) to vc_conn;
+			}
 			}
 		[] MGCP.receive(MgcpResponse:?) -> value mgcp_resp {
 			/* MGCP response from network side (we're MSC) */
diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index 1dacf3a..34bbbc9 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -145,6 +145,12 @@
 
 	template MgcpResponse ts_DLCX_ACK(MgcpTransId trans_id, MgcpConnectionId conn_id, template SDP_Message sdp := omit) := ts_CRCX_ACK(trans_id, conn_id, sdp);
 
+	template MgcpCommand tr_RSIP := {
+		line := t_MgcpCmdLine("RSIP", ?, ?),
+		params := *,
+		sdp := *
+	}
+
 	/* SDP Templates */
 	template SDP_Origin ts_SDP_origin(charstring addr, charstring session_id,
 					  charstring session_version := "1",