From 54d367e53f909560e5064dd462059d70c58cddf8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Thu, 19 Mar 2015 18:13:59 -0400
Subject: [PATCH] sipaccount: properly set IP2IP "registration" state

Refs #68905

Change-Id: I49bdea5f48baadde9957c20ba6432616230d9032
---
 daemon/src/sip/sipaccountbase.cpp | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/daemon/src/sip/sipaccountbase.cpp b/daemon/src/sip/sipaccountbase.cpp
index e6f22b0c5e..6af744aca8 100644
--- a/daemon/src/sip/sipaccountbase.cpp
+++ b/daemon/src/sip/sipaccountbase.cpp
@@ -205,12 +205,7 @@ std::map<std::string, std::string>
 SIPAccountBase::getAccountDetails() const
 {
     auto a = Account::getAccountDetails();
-
-    // note: The IP2IP profile will always have IP2IP as an alias
     a.emplace(Conf::CONFIG_VIDEO_ENABLED, videoEnabled_ ? TRUE_STR : FALSE_STR);
-    a.emplace(Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS, isIP2IP() ? "READY" : mapStateNumberToString(registrationState_));
-
-    // Add sip specific details
 
     addRangeToDetails(a, Conf::CONFIG_ACCOUNT_AUDIO_PORT_MIN, Conf::CONFIG_ACCOUNT_AUDIO_PORT_MAX, audioPortRange_);
 #ifdef RING_VIDEO
@@ -234,7 +229,11 @@ std::map<std::string, std::string>
 SIPAccountBase::getVolatileAccountDetails() const
 {
     auto a = Account::getVolatileAccountDetails();
-    a.emplace(Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS, isIP2IP() ? "READY" : mapStateNumberToString(registrationState_));
+
+    // replace value from Account for IP2IP
+    if (isIP2IP())
+        a[Conf::CONFIG_ACCOUNT_REGISTRATION_STATUS] = "READY";
+
     a.emplace(Conf::CONFIG_TRANSPORT_STATE_CODE,    ring::to_string(transportStatus_));
     a.emplace(Conf::CONFIG_TRANSPORT_STATE_DESC,    transportError_);
     return a;
-- 
GitLab