From c959abea2d0e86be806b6c0f8961211858f9ad88 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Tue, 20 May 2014 18:36:40 +0200 Subject: [PATCH] sdpmsg: don't send farsight-send-profile codec property Another instance of a Lync client being picky about SDP parameters. Some versions of Lync AVMCU (conferencing server) reject messages that contain the send profile property added by Farstream, likely because they treat spaces or exclamation marks as illegal characters. (cherry picked from commit c025fe5bfe3295b21d8d2d874301279f686cb8e8) --- src/core/sdpmsg.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/core/sdpmsg.c b/src/core/sdpmsg.c index b4532a09..767497de 100644 --- a/src/core/sdpmsg.c +++ b/src/core/sdpmsg.c @@ -370,15 +370,30 @@ codecs_to_string(GSList *codecs) c->clock_rate); if (params) { - g_string_append_printf(result, "a=fmtp:%d", c->id); + GString *param_str = g_string_new(NULL); + int written_params = 0; + + g_string_append_printf(param_str, "a=fmtp:%d", c->id); for (; params; params = params->next) { struct sipnameval* par = params->data; - g_string_append_printf(result, " %s=%s", + if (sipe_strequal(par->name, "farsight-send-profile")) { + // Lync AVMCU doesn't like this property. + continue; + } + + g_string_append_printf(param_str, " %s=%s", par->name, par->value); + ++written_params; } - g_string_append(result, "\r\n"); + g_string_append(param_str, "\r\n"); + + if (written_params > 0) { + g_string_append(result, param_str->str); + } + + g_string_free(param_str, TRUE); } } -- 2.11.4.GIT