From 573adfad30144e6554add6949744c3503dc8b4af Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 8 Aug 2025 16:00:43 -0400 Subject: [PATCH] MT#63317 split out siprec label setting Change-Id: I9ce03bda9b83249321d5fd59cd85fa74dd99affa --- daemon/call.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 8a8c6de7e..4ce35892e 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2839,23 +2839,21 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c #endif } -__attribute__((nonnull(2, 3))) -static void __update_media_label(struct call_media *media, struct call_media *other_media, +__attribute__((nonnull(1, 2))) +static void media_set_siprec_label(struct call_media *other_media, struct call_media *media, sdp_ng_flags *flags) { - if (!media) + if (!flags->siprec) return; - if (flags->siprec && flags->opmode == OP_SUBSCRIBE_REQ) { - 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) { + 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; } __attribute__((nonnull(1, 2))) @@ -2923,7 +2921,6 @@ __attribute__((nonnull(1, 3, 4))) static void __media_init_from_flags(struct call_media *other_media, struct call_media *media, struct stream_params *sp, sdp_ng_flags *flags) { - __update_media_label(media, other_media, flags); __update_media_protocol(media, other_media, sp, flags); __update_media_id(media, other_media, sp, flags); __endpoint_loop_protect(sp, other_media); @@ -3670,6 +3667,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_init_from_flags(src_media, dst_media, sp, flags); codec_store_populate(&dst_media->codecs, &src_media->codecs,