diff --git a/daemon/call.c b/daemon/call.c index 1cd8748ec..2fb36c191 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2639,8 +2639,11 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c // consume session attributes t_queue_clear_full(&ml->generic_attributes, sdp_attr_free); + t_queue_clear_full(&ml->all_attributes, sdp_attr_free); ml->generic_attributes = flags->generic_attributes; t_queue_init(&flags->generic_attributes); + ml->all_attributes = flags->all_attributes; + t_queue_init(&flags->all_attributes); /* consume sdp session parts */ { @@ -2855,8 +2858,11 @@ static void __media_init_from_flags(struct call_media *other_media, struct call_ * other (unknown type) */ t_queue_clear_full(&other_media->generic_attributes, sdp_attr_free); + t_queue_clear_full(&other_media->all_attributes, sdp_attr_free); other_media->generic_attributes = sp->generic_attributes; t_queue_init(&sp->generic_attributes); + other_media->all_attributes = sp->all_attributes; + t_queue_init(&sp->all_attributes); } // codec and RTP payload types handling @@ -4014,6 +4020,7 @@ void call_media_free(struct call_media **mdp) { codec_handler_free(&md->t38_handler); t38_gateway_put(&md->t38_gateway); t_queue_clear_full(&md->generic_attributes, sdp_attr_free); + t_queue_clear_full(&md->all_attributes, sdp_attr_free); t_queue_clear_full(&md->dtmf_recv, dtmf_event_free); t_queue_clear_full(&md->dtmf_send, dtmf_event_free); t_hash_table_destroy(md->media_subscribers_ht); @@ -4039,6 +4046,7 @@ void __monologue_free(struct call_monologue *m) { sdp_orig_free(m->session_last_sdp_orig); sdp_sessions_clear(&m->last_in_sdp_parsed); t_queue_clear_full(&m->generic_attributes, sdp_attr_free); + t_queue_clear_full(&m->all_attributes, sdp_attr_free); sdp_streams_clear(&m->last_in_sdp_streams); g_slice_free1(sizeof(*m), m); } diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index 29c701ea7..dfd2c0583 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -2040,6 +2040,7 @@ void call_ng_free_flags(sdp_ng_flags *flags) { t_queue_clear_full(&flags->sdes_order, str_free); t_queue_clear_full(&flags->sdes_offerer_pref, str_free); t_queue_clear_full(&flags->generic_attributes, sdp_attr_free); + t_queue_clear_full(&flags->all_attributes, sdp_attr_free); ng_sdp_attr_manipulations_free(flags->sdp_manipulations); } diff --git a/daemon/sdp.c b/daemon/sdp.c index 775b8f08a..e3bcd24ff 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -1686,6 +1686,7 @@ static void sp_free(struct stream_params *s) { ice_candidates_free(&s->ice_candidates); crypto_params_sdes_queue_clear(&s->sdes_params); t_queue_clear_full(&s->generic_attributes, sdp_attr_free); + t_queue_clear_full(&s->all_attributes, sdp_attr_free); g_slice_free1(sizeof(*s), s); } @@ -1847,6 +1848,7 @@ int sdp_streams(const sdp_sessions_q *sessions, sdp_streams_q *streams, sdp_ng_f * in `sdp_create()` */ sdp_attr_append_other(&flags->generic_attributes, &session->attributes); + sdp_attr_append(&flags->all_attributes, &session->attributes.list); /* set only for the first SDP session, to be able to re-use versioning * for all the rest SDP sessions during replacements. See `sdp_version_check()` */ if (!flags->session_sdp_orig.parsed) @@ -1938,6 +1940,7 @@ int sdp_streams(const sdp_sessions_q *sessions, sdp_streams_q *streams, sdp_ng_f } sdp_attr_append_other(&sp->generic_attributes, &media->attributes); + sdp_attr_append(&sp->all_attributes, &media->attributes.list); /* a=sendrecv/sendonly/recvonly/inactive */ SP_SET(sp, SEND); diff --git a/include/call.h b/include/call.h index caee5cddb..fbef5d15c 100644 --- a/include/call.h +++ b/include/call.h @@ -356,6 +356,7 @@ struct stream_params { str format_str; sdes_q sdes_params; // slice-alloc'd sdp_attr_q generic_attributes; /* just some other attributes */ + sdp_attr_q all_attributes; /* all attributes */ str direction[2]; sockfamily_t *desired_family; struct dtls_fingerprint fingerprint; @@ -499,6 +500,7 @@ struct call_media { struct codec_store codecs; sdp_attr_q generic_attributes; /* sdp_attr_new() */ + sdp_attr_q all_attributes; /* sdp_attr_new() */ sdp_attr_print_f *sdp_attr_print; codec_handlers_ht codec_handlers; /* int payload type -> struct codec_handler XXX combine this with 'codecs' hash table? */ @@ -617,6 +619,7 @@ struct call_monologue { /* carry `sdp_session` attributes into resulting call monologue SDP */ sdp_attr_q generic_attributes; + sdp_attr_q all_attributes; sdp_attr_print_f *sdp_attr_print; atomic64 ml_flags; diff --git a/include/call_interfaces.h b/include/call_interfaces.h index d82725a36..c142ef0f6 100644 --- a/include/call_interfaces.h +++ b/include/call_interfaces.h @@ -62,6 +62,7 @@ struct sdp_ng_flags { /* keep session level attributes for internal proper parsing */ sdp_attr_q generic_attributes; // top-level (not part of an m= section) SDP session attributes + sdp_attr_q all_attributes; // top-level (not part of an m= section) SDP session attributes sdp_origin session_sdp_orig; str session_sdp_name;