diff --git a/daemon/call.c b/daemon/call.c index 63ba93bcb..e5becbbc9 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2411,6 +2411,7 @@ static void __call_free(void *p) { g_queue_clear_full(&md->codecs_prefs_recv, (GDestroyNotify) payload_type_free); g_queue_clear_full(&md->codecs_prefs_send, (GDestroyNotify) payload_type_free); codec_handlers_free(md); + g_queue_clear_full(&md->sdp_attributes, free); g_slice_free1(sizeof(*md), md); } diff --git a/daemon/sdp.c b/daemon/sdp.c index 23eef3385..d8729e03d 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -1513,6 +1513,14 @@ static void insert_codec_parameters(struct sdp_chopper *chop, struct call_media } } +static void insert_sdp_attributes(struct sdp_chopper *chop, struct call_media *cm) { + for (GList *l = cm->sdp_attributes.head; l; l = l->next) { + str *s = l->data; + chopper_append_printf(chop, "a=" STR_FORMAT "\r\n", + STR_FMT(s)); + } +} + static int replace_media_port(struct sdp_chopper *chop, struct sdp_media *media, struct packet_stream *ps) { str *port = &media->port; unsigned int p; @@ -2118,7 +2126,10 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu chopper_append_c(chop, "\r\n"); } - insert_codec_parameters(chop, call_media); + if (call_media->protocol && call_media->protocol->rtp) + insert_codec_parameters(chop, call_media); + + insert_sdp_attributes(chop, call_media); ps_rtcp = NULL; if (ps->rtcp_sibling) { diff --git a/include/call.h b/include/call.h index d6a3d6798..da33d994c 100644 --- a/include/call.h +++ b/include/call.h @@ -322,6 +322,8 @@ struct call_media { GHashTable *codec_names_send; // codec name -> GQueue of int payload types; storage container GQueue codecs_prefs_send; // storage container + GQueue sdp_attributes; // str_sprintf() + GHashTable *codec_handlers; // int payload type -> struct codec_handler // XXX combine this with 'codecs_recv' hash table? GQueue codec_handlers_store; // storage for struct codec_handler