rtp_stream: allow multiple codecs / use codec filter from Assignment

Allow configuring MGW conns with multiple codecs. The new codecs filter
can have multiple results, and MGCP can configure multiple codecs. Get
rid of this bottleneck, that so far limits to a single codec to MGW.

On Assignment Complete, set codec_filter.assignment to the assigned
codec, and use that to set the resulting codec (possibly multiple codecs
in the future) to create the CN side MGW endpoint.

Related: SYS#5066
Change-Id: If9c67b298b30f893ec661f84c9fc622ad01b5ee5
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index 4a484bb..269fd57 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -1822,18 +1822,18 @@
 		return -EINVAL;
 	}
 
-	if (!rtp_cn->codec_known) {
+	if (!rtp_cn->codecs_known) {
 		LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR,
 			      "Cannot RTP CREATE to MNCC, no codec set up for the RTP CN side\n");
 		return -EINVAL;
 	}
 
 	/* Codec */
-	m = codec_mapping_by_mgcp_codec(rtp_cn->codec);
+	m = codec_mapping_by_subtype_name(rtp_cn->codecs.codec[0].subtype_name);
 	if (!m) {
 		LOG_TRANS_CAT(trans, DMNCC, LOGL_ERROR,
 			      "Cannot RTP CREATE to MNCC, cannot resolve codec '%s'\n",
-			      osmo_mgcpc_codec_name(rtp_cn->codec));
+			      sdp_audio_codec_to_str(&rtp_cn->codecs.codec[0]));
 		return -EINVAL;
 	}
 	payload_msg_type = m->mncc_payload_msg_type;
@@ -1841,9 +1841,9 @@
 	/* Payload Type number */
 	mgcp_info = osmo_mgcpc_ep_ci_get_rtp_info(rtp_cn->ci);
 	if (mgcp_info && mgcp_info->ptmap_len)
-		payload_type = map_codec_to_pt(mgcp_info->ptmap, mgcp_info->ptmap_len, rtp_cn->codec);
+		payload_type = map_codec_to_pt(mgcp_info->ptmap, mgcp_info->ptmap_len, m->mgcp);
 	else
-		payload_type = rtp_cn->codec;
+		payload_type = m->mgcp;
 
 	rtp_cn_local = call_leg_local_ip(cl, RTP_TO_CN);
 	if (!rtp_cn_local) {