From 667056b445b8f3611870dd8f79bdcb6c8b075841 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 8 Sep 2025 10:29:09 -0400 Subject: [PATCH] MT#63317 skip PT check when MID is in use Change-Id: Ic9eaaada645a0ecdcd8a9d09bfc86c16b2e5ecb9 --- daemon/call.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index 0b24ac81b..028e5db5a 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2978,6 +2978,11 @@ static bool media_extmap_strip_mask(const str *name, const struct sdp_ng_flags * __attribute__((nonnull(1, 2))) static void media_extmap_accept(struct rtp_extension *ext, const struct sdp_ng_flags *flags) { + if (flags->bundle_accept && ext->handler.id == RTP_EXT_MID) { + ext->accepted = true; + return; + } + if (t_hash_table_is_set(flags->rtpext_mask)) { if (t_hash_table_lookup(flags->rtpext_mask, &ext->name) || t_hash_table_lookup(flags->rtpext_mask, STR_PTR("all"))) @@ -3347,6 +3352,32 @@ static void monologue_bundle_check_consistency(struct call_monologue *ml) { continue; } + // MID extension available? + if (media->extmap_id[RTP_EXT_MID]) { + if (media->media_id.len > 255) { + ilog(LOG_WARN, "Media ID too long, rejecting bundle"); + media->bundle = NULL; + break; + } + if (!bundle->extmap_id[RTP_EXT_MID]) { + ilog(LOG_WARN, "Bundle head does not advertise MID extension, rejecting bundle"); + media->bundle = NULL; + break; + } + if (media->extmap_id[RTP_EXT_MID]->id != bundle->extmap_id[RTP_EXT_MID]->id) { + ilog(LOG_WARN, "Mismatched identifier for MID extension, rejecting bundle"); + media->bundle = NULL; + break; + } + if (media->media_id.len == 0) { + ilog(LOG_WARN, "MID header extension advertised, but no media ID present, " + "rejecting bundle"); + media->bundle = NULL; + break; + } + continue; // skip PT uniqueness test for this media + } + // are PTs unique? for (__auto_type l = media->codecs.codec_prefs.head; l; l = l->next) { __auto_type pt = l->data;