msc: mo and mt voice call tests: add lots of missing parts

Both f_mo_call_establish() and f_mt_call_establish() were testing barely half a
voice call setup.  For example, f_mo_call_establish() used to be satisfied with
just two CRCX, but no actual RTP connections being made.

Add numerous MNCC and MGCP messages more closely resembling an actual call.

The main reason is to achieve a state that passes both current osmo-msc master
as well as the upcoming inter-MSC Handover refactoring.

Add log markers to f_*_call_*(): often when a test halts, it is not at all
clear why. With these log markers it is saner to figure out what has happened
and what hasn't.

Change-Id: I162985045bb5e129977a3a797b656e30220990df
diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 6099303..4d71f27 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -1271,12 +1271,12 @@
 }
 
 
-template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := {
+template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid, BIT1 tid_remote := '0'B) := {
 	discriminator := '0011'B,
 	tiOrSkip := {
 		transactionId := {
 			tio := int2bit(tid, 3),
-			tiFlag := '0'B,
+			tiFlag := tid_remote,
 			tIExtension := omit
 		}
 	},
diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn
index f720553..506100f 100644
--- a/library/MGCP_Templates.ttcn
+++ b/library/MGCP_Templates.ttcn
@@ -286,6 +286,22 @@
 		}
 	}
 
+	function f_mgcp_contains_par(MgcpMessage msg, MgcpInfoCode code) return boolean {
+		var MgcpParameterList pars;
+		if (ischosen(msg.command)) {
+			pars := msg.command.params;
+		} else {
+			pars := msg.response.params;
+		}
+		for (var integer i := 0; i < lengthof(pars); i := i + 1) {
+			var MgcpParameter par := pars[i];
+			if (par.code == code) {
+				return true;
+			}
+		}
+		return false;
+	}
+
 	function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring {
 		var MgcpParameterList pars;
 		if (ischosen(msg.command)) {
@@ -317,6 +333,13 @@
 		return f_mgcp_extract_par(msg, code);
 	}
 
+	function f_MgcpCmd_contains_par(MgcpCommand cmd, MgcpInfoCode code) return boolean {
+		var MgcpMessage msg := {
+			command := cmd
+		}
+		return f_mgcp_contains_par(msg, code);
+	}
+
 	function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId {
 		return str2hex(f_MgcpResp_extract_par(resp, "I"));
 	}
diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index a3714b1..f5028d2 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -1874,14 +1874,17 @@
 template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id);
 
 /* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */
-template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := {
+template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?,
+				     template uint32_t ip := ?,
+				     template uint32_t rtp_port := ?,
+				     template uint32_t payload_type := ?) := {
 	msg_type := MNCC_RTP_CREATE,
 	u := {
 		rtp := {
 			callref := call_id,
-			ip := ?,
-			rtp_port := ?,
-			payload_type := ?,
+			ip := ip,
+			rtp_port := rtp_port,
+			payload_type := payload_type,
 			payload_msg_type := ?
 		}
 	}