From c1a7432b7fe2aee645ccb42d4acd5886528a9396 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Tue, 2 Jun 2015 10:40:54 +0200 Subject: [PATCH] media: send 'encryption' SDP attribute based on policy --- src/core/sipe-media.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/core/sipe-media.c b/src/core/sipe-media.c index 53a0e1a7..42b74443 100644 --- a/src/core/sipe-media.c +++ b/src/core/sipe-media.c @@ -435,7 +435,23 @@ media_stream_to_sdpmedia(struct sipe_media_call_private *call_private, g_free(tmp); } - attributes = sipe_utils_nameval_add(attributes, "encryption", "rejected"); + if (encryption_policy != call_private->sipe_private->server_av_encryption_policy) { + const gchar *encryption = NULL; + switch (encryption_policy) { + case SIPE_ENCRYPTION_POLICY_REJECTED: + encryption = "rejected"; + break; + case SIPE_ENCRYPTION_POLICY_OPTIONAL: + encryption = "optional"; + break; + case SIPE_ENCRYPTION_POLICY_REQUIRED: + default: + encryption = "required"; + break; + } + + attributes = sipe_utils_nameval_add(attributes, "encryption", encryption); + } sdpmedia->attributes = attributes; -- 2.11.4.GIT