From 582eea4ee18a32b1eeb658ec6c39e075c328f9f9 Mon Sep 17 00:00:00 2001
From: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Date: Fri, 29 Apr 2016 17:05:56 -0400
Subject: [PATCH] media: fix video sent when disabled in preferences

When an incoming call is created, the SDP offert contains a vide
media slot and so video is started and sent,
even when it's disabled in preferences.

This patch fixes that by not creating video media slot when disabled.

Tuleap: #625
Change-Id: I21ca19e574622d7a1cdb063c40b204d8bbb94fc9
---
 src/sip/sipvoiplink.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sip/sipvoiplink.cpp b/src/sip/sipvoiplink.cpp
index c17ea35f23..0457584e49 100644
--- a/src/sip/sipvoiplink.cpp
+++ b/src/sip/sipvoiplink.cpp
@@ -339,7 +339,7 @@ transaction_request_cb(pjsip_rx_data *rdata)
 
     call->getSDP().receiveOffer(r_sdp,
         account->getActiveAccountCodecInfoList(MEDIA_AUDIO),
-        account->getActiveAccountCodecInfoList(MEDIA_VIDEO),
+        account->getActiveAccountCodecInfoList(account->isVideoEnabled() ? MEDIA_VIDEO : MEDIA_NONE),
         account->getSrtpKeyExchange()
     );
     auto ice_attrs = Sdp::getIceAttributes(r_sdp);
-- 
GitLab