From e13d3ea255051f76d75ce4d2ec68c0393c4d1669 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Tue, 12 Aug 2014 11:38:30 +0200 Subject: [PATCH] media: mux RTP and RTCP when using TCP connection Lync uses a single TCP connection for both components. --- src/purple/purple-media.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/purple/purple-media.c b/src/purple/purple-media.c index f43d7294..8fc71e8e 100644 --- a/src/purple/purple-media.c +++ b/src/purple/purple-media.c @@ -236,6 +236,21 @@ on_stream_info_cb(SIPE_UNUSED_PARAMETER PurpleMedia *media, } } +static void +on_candidate_pair_established_cb(SIPE_UNUSED_PARAMETER PurpleMedia *media, + SIPE_UNUSED_PARAMETER const gchar *sessionid, + SIPE_UNUSED_PARAMETER const gchar *participant, + SIPE_UNUSED_PARAMETER PurpleMediaCandidate *local_candidate, + SIPE_UNUSED_PARAMETER PurpleMediaCandidate *remote_candidate, + SIPE_UNUSED_PARAMETER struct sipe_media_call *call) +{ +#if PURPLE_VERSION_CHECK(2,10,12) || PURPLE_VERSION_CHECK(3,0,0) + if (purple_media_candidate_get_protocol(local_candidate) != PURPLE_MEDIA_NETWORK_PROTOCOL_UDP) { + purple_media_set_send_rtcp_mux(media, sessionid, participant, TRUE); + } +#endif +} + struct sipe_backend_media * sipe_backend_media_new(struct sipe_core_public *sipe_public, struct sipe_media_call *call, @@ -262,6 +277,9 @@ sipe_backend_media_new(struct sipe_core_public *sipe_public, G_CALLBACK(on_error_cb), call); g_signal_connect(G_OBJECT(media->m), "state-changed", G_CALLBACK(on_state_changed_cb), call); + g_signal_connect(G_OBJECT(media->m), "candidate-pair-established", + G_CALLBACK(on_candidate_pair_established_cb), call); + /* On error, the pipeline is no longer in PLAYING state and libpurple * will not switch it back to PLAYING, preventing any more calls until -- 2.11.4.GIT