Browse Source

MT#55283 add `all_attributes` lists

Store all received SDP attributes, not just the generic ones.

Change-Id: I1d4646ef2127e13cf8aab44b9c3a1410428b7873
rfuchs/test
Richard Fuchs 1 year ago
committed by Donat Zenichev
parent
commit
33da0186de
5 changed files with 16 additions and 0 deletions
  1. +8
    -0
      daemon/call.c
  2. +1
    -0
      daemon/call_interfaces.c
  3. +3
    -0
      daemon/sdp.c
  4. +3
    -0
      include/call.h
  5. +1
    -0
      include/call_interfaces.h

+ 8
- 0
daemon/call.c View File

@ -2639,8 +2639,11 @@ static void __call_monologue_init_from_flags(struct call_monologue *ml, struct c
// consume session attributes // consume session attributes
t_queue_clear_full(&ml->generic_attributes, sdp_attr_free); 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; ml->generic_attributes = flags->generic_attributes;
t_queue_init(&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 */ /* consume sdp session parts */
{ {
@ -2855,8 +2858,11 @@ static void __media_init_from_flags(struct call_media *other_media, struct call_
* other (unknown type) * other (unknown type)
*/ */
t_queue_clear_full(&other_media->generic_attributes, sdp_attr_free); 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; other_media->generic_attributes = sp->generic_attributes;
t_queue_init(&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 // codec and RTP payload types handling
@ -4014,6 +4020,7 @@ void call_media_free(struct call_media **mdp) {
codec_handler_free(&md->t38_handler); codec_handler_free(&md->t38_handler);
t38_gateway_put(&md->t38_gateway); t38_gateway_put(&md->t38_gateway);
t_queue_clear_full(&md->generic_attributes, sdp_attr_free); 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_recv, dtmf_event_free);
t_queue_clear_full(&md->dtmf_send, dtmf_event_free); t_queue_clear_full(&md->dtmf_send, dtmf_event_free);
t_hash_table_destroy(md->media_subscribers_ht); 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_orig_free(m->session_last_sdp_orig);
sdp_sessions_clear(&m->last_in_sdp_parsed); sdp_sessions_clear(&m->last_in_sdp_parsed);
t_queue_clear_full(&m->generic_attributes, sdp_attr_free); 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); sdp_streams_clear(&m->last_in_sdp_streams);
g_slice_free1(sizeof(*m), m); g_slice_free1(sizeof(*m), m);
} }


+ 1
- 0
daemon/call_interfaces.c View File

@ -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_order, str_free);
t_queue_clear_full(&flags->sdes_offerer_pref, 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->generic_attributes, sdp_attr_free);
t_queue_clear_full(&flags->all_attributes, sdp_attr_free);
ng_sdp_attr_manipulations_free(flags->sdp_manipulations); ng_sdp_attr_manipulations_free(flags->sdp_manipulations);
} }


+ 3
- 0
daemon/sdp.c View File

@ -1686,6 +1686,7 @@ static void sp_free(struct stream_params *s) {
ice_candidates_free(&s->ice_candidates); ice_candidates_free(&s->ice_candidates);
crypto_params_sdes_queue_clear(&s->sdes_params); crypto_params_sdes_queue_clear(&s->sdes_params);
t_queue_clear_full(&s->generic_attributes, sdp_attr_free); 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); 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()` * in `sdp_create()`
*/ */
sdp_attr_append_other(&flags->generic_attributes, &session->attributes); 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 /* 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()` */ * for all the rest SDP sessions during replacements. See `sdp_version_check()` */
if (!flags->session_sdp_orig.parsed) 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_other(&sp->generic_attributes, &media->attributes);
sdp_attr_append(&sp->all_attributes, &media->attributes.list);
/* a=sendrecv/sendonly/recvonly/inactive */ /* a=sendrecv/sendonly/recvonly/inactive */
SP_SET(sp, SEND); SP_SET(sp, SEND);


+ 3
- 0
include/call.h View File

@ -356,6 +356,7 @@ struct stream_params {
str format_str; str format_str;
sdes_q sdes_params; // slice-alloc'd sdes_q sdes_params; // slice-alloc'd
sdp_attr_q generic_attributes; /* just some other attributes */ sdp_attr_q generic_attributes; /* just some other attributes */
sdp_attr_q all_attributes; /* all attributes */
str direction[2]; str direction[2];
sockfamily_t *desired_family; sockfamily_t *desired_family;
struct dtls_fingerprint fingerprint; struct dtls_fingerprint fingerprint;
@ -499,6 +500,7 @@ struct call_media {
struct codec_store codecs; struct codec_store codecs;
sdp_attr_q generic_attributes; /* sdp_attr_new() */ sdp_attr_q generic_attributes; /* sdp_attr_new() */
sdp_attr_q all_attributes; /* sdp_attr_new() */
sdp_attr_print_f *sdp_attr_print; sdp_attr_print_f *sdp_attr_print;
codec_handlers_ht codec_handlers; /* int payload type -> struct codec_handler codec_handlers_ht codec_handlers; /* int payload type -> struct codec_handler
XXX combine this with 'codecs' hash table? */ XXX combine this with 'codecs' hash table? */
@ -617,6 +619,7 @@ struct call_monologue {
/* carry `sdp_session` attributes into resulting call monologue SDP */ /* carry `sdp_session` attributes into resulting call monologue SDP */
sdp_attr_q generic_attributes; sdp_attr_q generic_attributes;
sdp_attr_q all_attributes;
sdp_attr_print_f *sdp_attr_print; sdp_attr_print_f *sdp_attr_print;
atomic64 ml_flags; atomic64 ml_flags;


+ 1
- 0
include/call_interfaces.h View File

@ -62,6 +62,7 @@ struct sdp_ng_flags {
/* keep session level attributes for internal proper parsing */ /* 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 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; sdp_origin session_sdp_orig;
str session_sdp_name; str session_sdp_name;


Loading…
Cancel
Save