From 6ef9aab8dff58d434b1cc367ce0b08ae4db77959 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 (cherry picked from commit 0f7774dbfade45a7742aec7e05e803ad3fb6044f) --- 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 7ea352198..809f42028 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2849,20 +2849,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))) @@ -4435,7 +4432,7 @@ static int monologue_subscribe_request1(struct call_monologue *src_ml, struct ca 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 dfe736682..cb1c2c142 100644 --- a/include/call.h +++ b/include/call.h @@ -509,7 +509,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;