From 0f7774dbfade45a7742aec7e05e803ad3fb6044f Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 12 Mar 2026 14:20:16 -0400 Subject: [PATCH] MT#55283 set media label only for out direction Change-Id: I316ebc34f51adf56d3df715c910e3102ab6e4a86 --- daemon/call.c | 19 ++++++++----------- include/call.h | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 6ba065f71..1a7bb9413 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2853,20 +2853,17 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c } __attribute__((nonnull(1, 2))) -static void media_set_siprec_label(struct call_media *other_media, struct call_media *media, - sdp_ng_flags *flags) +static void media_set_siprec_label(struct call_media *media, sdp_ng_flags *flags, unsigned int id) { if (!flags->siprec) return; - if (!media->label.len) { - char buf[64]; - snprintf(buf, sizeof(buf), "%u", other_media->unique_id); - media->label = call_str_cpy_c(buf); - } - // put same label on both sides - if (!other_media->label.len) - other_media->label = media->label; + if (media->label.len) + return; + + char buf[64]; + snprintf(buf, sizeof(buf), "%u", id); + media->label = call_str_cpy_c(buf); } __attribute__((nonnull(1))) @@ -4422,7 +4419,7 @@ static int monologue_subscribe_request1(struct call_media *src_media, struct cal media_init_from_flags(dst_media, flags); media_set_echo(src_media, flags); media_set_echo_reverse(dst_media, flags); - media_set_siprec_label(src_media, dst_media, flags); + media_set_siprec_label(dst_media, flags, src_media->unique_id); media_update_type(dst_media, sp); media_set_protocol(dst_media, src_media, sp, flags); media_gen_media_id(dst_media, flags); diff --git a/include/call.h b/include/call.h index 1a23ac195..2b04997eb 100644 --- a/include/call.h +++ b/include/call.h @@ -523,7 +523,7 @@ struct call_media { const struct extmap_ops *extmap_ops; str media_id; - str label; + str label; // outgoing a=label: struct call_media *bundle; pt_media_ht pt_media; sdes_q sdes_in, sdes_out;