MGCP_Test: Test non LCO crcx

When a CRCX without an LCO option (codec) is sent, then older versions
of osmo-mgw will omit the port number in the SDP part of the response.
Also no default codec is selected and reported back. This testcase
pinpoints the problem.

Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e
Related: OS#2658
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index 1892a42..26a0701 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -307,12 +307,48 @@
 		f_dlcx_ok(ep, call_id);
 	}
 
+	function f_crcx_no_lco(charstring ep_prefix) runs on dummy_CT {
+		var MgcpEndpoint ep := ep_prefix & "2@" & c_mgw_domain;
+		var template MgcpCommand cmd;
+		var MgcpResponse resp;
+		var MgcpCallId call_id := '1234'H;
+
+		f_init(ep);
+
+		/* create the connection on the MGW */
+		cmd := ts_CRCX_no_lco(get_next_trans_id(), ep, "recvonly", call_id);
+		resp := mgcp_transceive_mgw(cmd, tr_CRCX_ACK);
+		extract_conn_id(resp);
+
+		/* clean-up */
+		f_dlcx_ok(ep, call_id);
+
+		/* See also OS#2658: Even when we omit the LCO information, we
+		   expect the MGW to pick a sane payload type for us. This
+		   payload type should be visible in the SDP of the response. */
+		if (resp.sdp.media_list[0].attributes[0].rtpmap.attr_value != "0 PCMU/8000/1") {
+			setverdict(fail, "SDP contains unexpected codec");
+		}
+
+		/* See also OS#2658: We also expect the MGW to assign a port
+		   number to us. */
+		if (isbound(resp.sdp.media_list[0].media_field.ports.port_number) == false) {
+			setverdict(fail, "SDP does not contain a port number");
+		}
+	}
+
 	/* test valid CRCX without SDP */
 	testcase TC_crcx() runs on dummy_CT {
 		f_crcx(c_mgw_ep_rtpbridge);
 		setverdict(pass);
 	}
 
+	/* test valid CRCX without SDP and LCO */
+	testcase TC_crcx_no_lco() runs on dummy_CT {
+		f_crcx_no_lco(c_mgw_ep_rtpbridge);
+		setverdict(pass);
+	}
+
 	/* test valid CRCX without SDP (older method without endpoint prefix) */
 	testcase TC_crcx_noprefix() runs on dummy_CT {
 		f_crcx("");
@@ -881,6 +917,7 @@
 	control {
 		execute(TC_selftest());
 		execute(TC_crcx());
+		execute(TC_crcx_no_lco());
 		execute(TC_crcx_noprefix());
 		execute(TC_crcx_unsupp_mode());
 		execute(TC_crcx_early_bidir_mode());