diff --git a/daemon/sdp.c b/daemon/sdp.c index 41e3d89b1..cec248901 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -2068,28 +2068,28 @@ static void insert_codec_parameters(GString *s, struct call_media *cm, } } -void sdp_insert_media_attributes(GString *gs, union sdp_attr_print_arg a, const sdp_ng_flags *flags) { +void sdp_insert_media_attributes(GString *gs, struct call_media *media, const sdp_ng_flags *flags) { // Look up the source media. We copy the source's attributes if there is only one source // media. Otherwise we skip this step. - if (a.cm->media_subscriptions.length != 1) + if (media->media_subscriptions.length != 1) return; - __auto_type sub = a.cm->media_subscriptions.head->data; + __auto_type sub = media->media_subscriptions.head->data; __auto_type sub_m = sub->media; for (__auto_type l = sub_m->generic_attributes.head; l; l = l->next) { __auto_type s = l->data; - if (s->other == ATTR_OTHER_EXTMAP && flags->strip_extmap && !MEDIA_ISSET(a.cm, PASSTHRU)) + if (s->other == ATTR_OTHER_EXTMAP && flags->strip_extmap && !MEDIA_ISSET(media, PASSTHRU)) continue; - append_str_attr_to_gstring(gs, &s->strs.name, &s->strs.value, flags, a.cm->type_id); + append_str_attr_to_gstring(gs, &s->strs.name, &s->strs.value, flags, media->type_id); } } -void sdp_insert_monologue_attributes(GString *gs, union sdp_attr_print_arg a, const sdp_ng_flags *flags) { +void sdp_insert_monologue_attributes(GString *gs, struct call_monologue *ml, const sdp_ng_flags *flags) { // Look up the source monologue. This must be a single source monologue for all medias. If // there's a mismatch or multiple source monologues, we skip this step. - struct call_monologue *source_ml = ml_medias_subscribed_to_single_ml(a.ml); + struct call_monologue *source_ml = ml_medias_subscribed_to_single_ml(ml); if (!source_ml) return; diff --git a/daemon/t38.c b/daemon/t38.c index ab53e19c9..00e168424 100644 --- a/daemon/t38.c +++ b/daemon/t38.c @@ -332,8 +332,8 @@ static int span_log_level_map(int level) { return level; } -void t38_insert_media_attributes(GString *gs, union sdp_attr_print_arg a, const sdp_ng_flags *flags) { - struct t38_gateway *tg = a.cm->t38_gateway; +static void t38_insert_media_attributes(GString *gs, struct call_media *media, const sdp_ng_flags *flags) { + struct t38_gateway *tg = media->t38_gateway; if (!tg) return; diff --git a/include/call.h b/include/call.h index 0cc6fad52..485656e09 100644 --- a/include/call.h +++ b/include/call.h @@ -514,7 +514,7 @@ struct call_media { struct codec_store offered_codecs; sdp_attr_q generic_attributes; /* sdp_attr_new() */ sdp_attr_q all_attributes; /* sdp_attr_new() */ - sdp_attr_print_f *sdp_attr_print; + sdp_media_attr_print_f *sdp_attr_print; codec_handlers_ht codec_handlers; /* int payload type -> struct codec_handler XXX combine this with 'codecs' hash table? */ codec_handlers_q codec_handlers_store; /* storage for struct codec_handler */ @@ -633,7 +633,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; + sdp_monologue_attr_print_f *sdp_attr_print; long long moh_db_id; str moh_blob; diff --git a/include/sdp.h b/include/sdp.h index d8811d2c6..6b4807f37 100644 --- a/include/sdp.h +++ b/include/sdp.h @@ -32,8 +32,8 @@ extern const str rtpe_instance_id; void sdp_init(void); -sdp_attr_print_f sdp_insert_media_attributes; -sdp_attr_print_f sdp_insert_monologue_attributes; +void sdp_insert_media_attributes(GString *, struct call_media *, const sdp_ng_flags *); +void sdp_insert_monologue_attributes(GString *, struct call_monologue *, const sdp_ng_flags *); void sdp_append_str_attr(GString *s, const sdp_ng_flags *flags, enum media_type media_type, const str *name, const char *fmt, ...) diff --git a/include/types.h b/include/types.h index e98f36c34..2138fc60b 100644 --- a/include/types.h +++ b/include/types.h @@ -13,6 +13,9 @@ typedef struct stream_fd stream_fd; typedef struct rtp_payload_type rtp_payload_type; typedef struct sdp_origin sdp_origin; +struct call_monologue; +struct call_media; + struct network_address { str network_type; str address_type; @@ -31,11 +34,8 @@ struct sdp_origin { }; typedef struct sdp_origin sdp_origin; -union sdp_attr_print_arg { - struct call_media *cm; - struct call_monologue *ml; -} __attribute__ ((__transparent_union__)); -typedef void sdp_attr_print_f(GString *, union sdp_attr_print_arg, const sdp_ng_flags *flags); +typedef void sdp_monologue_attr_print_f(GString *, struct call_monologue *, const sdp_ng_flags *flags); +typedef void sdp_media_attr_print_f(GString *, struct call_media *, const sdp_ng_flags *flags); typedef struct ng_parser ng_parser_t; typedef struct ng_parser_ctx ng_parser_ctx_t;