msc_vlr_tests: confirm crcx by RAN/CN side separately

Upcoming patch 'do CN CRCX first' changes the ordering of MGCP. To
properly show the change in behavior in the msc_vlr_test_call, first
clarify which side is expected to do MGCP when.

Related: SYS#5066
Change-Id: I972e7426006e5b62f81ccfe4fa224ee9eed7a7ac
diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c
index 646633c..2300319 100644
--- a/tests/msc_vlr/msc_vlr_tests.c
+++ b/tests/msc_vlr/msc_vlr_tests.c
@@ -85,8 +85,8 @@
 bool cc_to_mncc_tx_confirmed = false;
 uint32_t cc_to_mncc_tx_got_callref = 0;
 
-enum rtp_direction expecting_crcx = -1;
-bool got_crcx = false;
+bool expecting_crcx[2] = {};
+bool got_crcx[2] = {};
 
 extern int ran_dec_dtap_undup_pdisc_ctr_bin(uint8_t pdisc);
 
@@ -651,8 +651,8 @@
 
 	osmo_gettimeofday_override = false;
 
-	expecting_crcx = -1;
-	got_crcx = false;
+	memset(expecting_crcx, 0, sizeof(expecting_crcx));
+	memset(got_crcx, 0, sizeof(got_crcx));
 
 	bssap_assignment_expected = false;
 	bssap_assignment_sent = false;
@@ -846,9 +846,14 @@
 
 void expect_crcx(enum rtp_direction towards)
 {
-	OSMO_ASSERT(expecting_crcx == -1);
-	expecting_crcx = towards;
-	got_crcx = false;
+	OSMO_ASSERT(!expecting_crcx[towards]);
+	expecting_crcx[towards] = true;
+	got_crcx[towards] = false;
+}
+
+bool crcx_scheduled(enum rtp_direction towards)
+{
+	return got_crcx[towards];
 }
 
 /* override, requires '-Wl,--wrap=call_leg_ensure_ci' */
@@ -863,9 +868,9 @@
 		log("MGW <--CRCX to %s-- MSC: callref=0x%x codecs=%s", rtp_direction_name(dir), call_id,
 		    codecs_if_known ? sdp_audio_codecs_to_str(codecs_if_known) : "unset");
 
-		OSMO_ASSERT(expecting_crcx == dir);
-		expecting_crcx = -1;
-		got_crcx = true;
+		OSMO_ASSERT(expecting_crcx[dir]);
+		expecting_crcx[dir] = false;
+		got_crcx[dir] = true;
 
 		call_leg_ensure_rtp_alloc(cl, dir, call_id, for_trans);
 		if (codecs_if_known)