From e143fa08ca5c55d74b90a7dcef1a03ac23c86779 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 20 Sep 2024 13:42:17 -0400 Subject: [PATCH] MT#60476 remember received media ICE candidates Change-Id: Ia294aa503f66b401ed564dd04da276fc8a98e857 --- daemon/call.c | 8 ++++++++ include/call.h | 1 + 2 files changed, 9 insertions(+) diff --git a/daemon/call.c b/daemon/call.c index 09060b182..b0fbee564 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2605,6 +2605,13 @@ static void __update_init_subscribers(struct call_media *media, struct stream_pa /* we are now ready to fire up ICE if so desired and requested */ ice_update(media->ice_agent, sp, opmode == OP_OFFER); /* sp == NULL: update in case rtcp-mux changed */ + if (sp) { + // take over and store received ICE candidates + ice_candidates_free(&media->ice_candidates); + media->ice_candidates = sp->ice_candidates; + t_queue_init(&sp->ice_candidates); + } + recording_setup_media(media); t38_gateway_start(media->t38_gateway, flags ? flags->codec_set : str_case_value_ht_null()); audio_player_start(media); @@ -4022,6 +4029,7 @@ void call_media_free(struct call_media **mdp) { t_hash_table_destroy(md->media_subscriptions_ht); t_queue_clear_full(&md->media_subscribers, media_subscription_free); t_queue_clear_full(&md->media_subscriptions, media_subscription_free); + ice_candidates_free(&md->ice_candidates); mutex_destroy(&md->dtmf_lock); g_slice_free1(sizeof(*md), md); *mdp = NULL; diff --git a/include/call.h b/include/call.h index 11538787a..09323dce2 100644 --- a/include/call.h +++ b/include/call.h @@ -493,6 +493,7 @@ struct call_media { struct dtls_fingerprint fingerprint; /* as received */ const struct dtls_hash_func *fp_hash_func; /* outgoing */ str tls_id; + candidate_q ice_candidates; /* slice-alloc'd, as received */ unsigned int media_rec_slot; packet_stream_q streams; /* normally RTP + RTCP */