From 3ef034a675ac5a8a193e031a55f4a9ff2d0161f6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 8 Sep 2025 15:03:09 -0400 Subject: [PATCH] MT#63317 track extensions by known ID Change-Id: I17f20bc8be60d779d1a3d18616bb518062f74e6b --- daemon/call.c | 9 ++++++++- include/call.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/daemon/call.c b/daemon/call.c index 682a8cd02..d207bf0e4 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2884,8 +2884,9 @@ __attribute__((nonnull(1))) static void media_reset_extmap(struct call_media *media, bool (*exclude)(struct rtp_extension *)) { - // reset basic table + // reset basic tables memset(media->extmap_a, 0, sizeof(media->extmap_a)); + memset(media->extmap_id, 0, sizeof(media->extmap_id)); media->extmap_ops = &extmap_ops_short; if (!exclude) { @@ -2910,6 +2911,9 @@ static void media_reset_extmap(struct call_media *media, else media->extmap_ops = &extmap_ops_long; + if (ext->handler.id < RTP_EXT_NUM) + media->extmap_id[ext->handler.id] = ext; + ele = ele->next; continue; } @@ -2943,6 +2947,9 @@ static void media_init_extmap(struct call_media *media, struct rtp_extension *ex media->extmap_a[ext->id - 1] = ext; else media->extmap_ops = &extmap_ops_long; + + if (ext->handler.id < RTP_EXT_NUM) + media->extmap_id[ext->handler.id] = ext; } __attribute__((nonnull(1, 2))) diff --git a/include/call.h b/include/call.h index b0a40a3c7..5a6f9b814 100644 --- a/include/call.h +++ b/include/call.h @@ -503,6 +503,7 @@ struct call_media { extmap_q extmap; // container struct rtp_extension *extmap_a[14]; // 1-14 -> [0..13] + struct rtp_extension *extmap_id[RTP_EXT_NUM]; extmap_ht extmap_ht; const struct extmap_ops *extmap_ops; ext_name_ht ext_name_ht;