MGCP_Test: Make sure PT in RTP-Stream and MGCP match up

At the moment the RTP stream emulation is left in its default
configuration, this means that the payload type that appears in the RTP
stream is always 0. This may mismatch the payload type that is
configured with MGCP.

If nothing else is set, we should make sure that whan we create and modify
flows, the RTP emulation is always reconfigured to use the payload-type that
we set in the flow parameters. The other rtp-emulation parameters should
be set to their defaults.

- Make sure f_flow_modify and f_flow_create set the rtp flow parameters
  properly.

Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e
Related:OS#3384
diff --git a/mgw/MGCP_Test.ttcn b/mgw/MGCP_Test.ttcn
index d816a71..659d5f1 100644
--- a/mgw/MGCP_Test.ttcn
+++ b/mgw/MGCP_Test.ttcn
@@ -58,6 +58,7 @@
 	private function f_init(template MgcpEndpoint ep := omit) runs on dummy_CT {
 		var Result res;
 		var uint32_t ssrc;
+
 		if (initialized == false) {
 			initialized := true;
 
@@ -243,7 +244,8 @@
 		HostPort mgw,	/* mgw side */
 		uint7_t pt,
 		charstring codec,
-		MgcpConnectionId mgcp_conn_id optional
+		MgcpConnectionId mgcp_conn_id optional,
+		RtpemConfig rtp_cfg optional
 	}
 
 	/* Create an RTP flow (bidirectional, or receive-only) */
@@ -256,6 +258,15 @@
 		/* bind local RTP emulation socket */
 		f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
 
+		/* configure rtp-emulation */
+		if (ispresent(flow.rtp_cfg)) {
+			f_rtpem_configure(pt, flow.rtp_cfg);
+		} else {
+			var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;
+			rtp_cfg.tx_payload_type := flow.pt
+			f_rtpem_configure(pt, rtp_cfg);
+		}
+
 		if (one_phase) {
 			/* Connect flow to MGW using a CRCX that also contains an SDP
 			 * part that tells the MGW where we are listening for RTP streams
@@ -299,6 +310,15 @@
 		/* rebind local RTP emulation socket to the new address */
 		f_rtpem_bind(pt, flow.em.hostname, flow.em.portnr);
 
+		/* reconfigure rtp-emulation */
+		if (ispresent(flow.rtp_cfg)) {
+			f_rtpem_configure(pt, flow.rtp_cfg);
+		} else {
+			var RtpemConfig rtp_cfg := c_RtpemDefaultCfg;
+			rtp_cfg.tx_payload_type := flow.pt
+			f_rtpem_configure(pt, rtp_cfg);
+		}
+
 		/* connect MGW side RTP socket to the emulation-side RTP socket using SDP */
 		cmd := ts_MDCX(get_next_trans_id(), ep, mode, call_id, flow.mgcp_conn_id);
 		cmd.sdp := ts_SDP(flow.em.hostname, flow.em.hostname, "23", "42",