From 602961bc5dbf4f5a791c28231d70cab26b9c86e3 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 5 Feb 2024 04:19:39 +0100 Subject: [PATCH] msc_vlr_tests: allow more detail for assigned codec An upcoming test needs to model assignment of a specific AMR variant. Use sdp_codec_from_str(), which adds the ability to add specific AMR modes to Assignment Complete messages. Change-Id: I37680b9bef5ff989b1fcb0816eedae09282d9351 --- tests/msc_vlr/msc_vlr_tests.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 062d8a35b..4ca987bce 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -1059,12 +1059,20 @@ void ms_sends_security_mode_complete(uint8_t utran_encryption) g_msub = NULL; } -void ms_sends_assignment_complete(const char *sdp_codec_name) +void ms_sends_assignment_complete(const char *sdp_codec_str) { + const struct codec_mapping *m; + struct sdp_audio_codec codec; struct ran_msg ran_dec; - const struct codec_mapping *m = codec_mapping_by_subtype_name(sdp_codec_name); + + sdp_audio_codec_from_str(&codec, sdp_codec_str); + codec_mapping_foreach (m) { + if (!m->has_gsm0808_speech_codec) + continue; + if (!sdp_audio_codec_cmp(&m->sdp, &codec, true, false)) + break; + } OSMO_ASSERT(m); - OSMO_ASSERT(m->has_gsm0808_speech_codec); ran_dec = (struct ran_msg){ .msg_type = RAN_MSG_ASSIGNMENT_COMPLETE,