From 00bab087b2e7afc7735ff1beb1463331f47ce7dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sun, 23 Oct 2016 18:29:40 -0400
Subject: [PATCH] call: wait for CONNECTED state to send messages

In multi-device, we buffer outgoing messages and send them to subcalls
when their SIP session become available.
For this purpose we waited for CallState::ACTIVE which is not enough,
since ConnectionState should be CONNECTED to ensure the SIp session to
be availble.

Change-Id: I2d84fdd4b4340e9ba198f75530212e83be575920
Tuleap: #1154
---
 src/call.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/call.cpp b/src/call.cpp
index 0cedb49e7b..aac915369a 100644
--- a/src/call.cpp
+++ b/src/call.cpp
@@ -168,7 +168,7 @@ Call::setState(CallState call_state, ConnectionState cnx_state, signed code)
             pendingInMessages_.clear();
             pendingOutMessages_.clear();
         }
-    } else if (call_state == CallState::ACTIVE and not pendingOutMessages_.empty()) {
+    } else if (call_state == CallState::ACTIVE and connectionState_ == ConnectionState::CONNECTED and not pendingOutMessages_.empty()) {
         for (const auto& msg : pendingOutMessages_)
             sendTextMessage(msg.first, msg.second);
         pendingOutMessages_.clear();
-- 
GitLab