Commit c2b1c028 authored by Rafaël Carré's avatar Rafaël Carré

Remove unused getRegistrationCount()

sflphone daemon can not work without DBus
parent a5e48b94
......@@ -28,6 +28,7 @@
* as that of the covered work.
*/
#include <cstdlib>
#include <dbusmanager.h>
#include "global.h"
#include "manager.h"
......@@ -38,13 +39,6 @@
#include "networkmanager.h"
DBusManager::DBusManager()
: _connected(false)
, _callManager(NULL)
, _configurationManager(NULL)
, _instanceManager(NULL)
#ifdef USE_NETWORKMANAGER
, _networkManager(NULL)
#endif
{
try {
DBus::_init_threading();
......@@ -62,9 +56,9 @@ DBusManager::DBusManager()
_networkManager = new NetworkManager (systemConnection, "/org/freedesktop/NetworkManager", "");
#endif
_connected = true;
} catch (const DBus::Error &err) {
_error("%s: %s\n", err.name(), err.what());
_error("%s: %s, exiting\n", err.name(), err.what());
::exit(1);
}
}
......
......@@ -54,15 +54,10 @@ class DBusManager
return _configurationManager;
};
bool isConnected() const {
return _connected;
}
void exec();
void exit();
private:
bool _connected;
CallManager* _callManager;
ConfigurationManager* _configurationManager;
Instance* _instanceManager;
......
......@@ -29,18 +29,5 @@
</tp:docstring>
</arg>
</method>
<method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount">
<tp:docstring>
Get the number of connected clients.
</tp:docstring>
<arg type="i" name="count" direction="out">
<tp:docstring>
The number of client currently connected to the core
</tp:docstring>
</arg>
</method>
</interface>
</node>
......@@ -31,10 +31,8 @@
#include <instance.h>
#include "../manager.h"
const char* Instance::SERVER_PATH = "/org/sflphone/SFLphone/Instance";
Instance::Instance (DBus::Connection& connection)
: DBus::ObjectAdaptor (connection, SERVER_PATH)
: DBus::ObjectAdaptor (connection, "/org/sflphone/SFLphone/Instance")
{
count = 0;
}
......@@ -43,7 +41,6 @@ void
Instance::Register (const int32_t& pid UNUSED,
const std::string& name UNUSED)
{
_debug ("Instance::register received");
count++;
}
......@@ -51,7 +48,6 @@ Instance::Register (const int32_t& pid UNUSED,
void
Instance::Unregister (const int32_t& pid UNUSED)
{
_debug ("Instance::unregister received");
count --;
if (count <= 0) {
......@@ -59,10 +55,3 @@ Instance::Unregister (const int32_t& pid UNUSED)
Manager::instance().getDbusManager()->exit();
}
}
int32_t
Instance::getRegistrationCount (void)
{
return count;
}
......@@ -142,6 +142,8 @@ void ManagerImpl::terminate ()
unloadAccountMap();
delete SIPVoIPLink::instance();
delete _dtmfKey;
delete _telephoneTone;
......@@ -209,9 +211,8 @@ bool ManagerImpl::outgoingCall (const std::string& account_id,
std::string to_cleaned(NumberCleaner::clean(to, prefix));
Call::CallConfiguration callConfig;
/* Check what kind of call we are dealing with */
checkCallConfiguration (call_id, to_cleaned, &callConfig);
Call::CallConfiguration callConfig = checkCallConfiguration (call_id, to_cleaned);
associateConfigToCall(call_id, callConfig);
// in any cases we have to detach from current communication
if (hasCurrentCall()) {
......@@ -1684,8 +1685,7 @@ void ManagerImpl::startVoiceMessageNotification (const std::string& accountId,
void ManagerImpl::connectionStatusNotification ()
{
if (_dbus.isConnected())
_dbus.getConfigurationManager()->accountsChanged();
_dbus.getConfigurationManager()->accountsChanged();
}
/**
......@@ -2618,8 +2618,7 @@ std::string ManagerImpl::addAccount (
saveConfig();
if (_dbus.isConnected())
_dbus.getConfigurationManager()->accountsChanged();
_dbus.getConfigurationManager()->accountsChanged();
return accountID.str();
}
......@@ -2640,10 +2639,7 @@ void ManagerImpl::removeAccount (const std::string& accountID)
saveConfig();
_debug ("REMOVE ACCOUNT");
if (_dbus.isConnected())
_dbus.getConfigurationManager()->accountsChanged();
_dbus.getConfigurationManager()->accountsChanged();
}
// ACCOUNT handling
......@@ -2704,8 +2700,6 @@ std::vector<std::string> ManagerImpl::loadAccountOrder (void) const
void ManagerImpl::loadAccountMap(Conf::YamlParser *parser)
{
SIPVoIPLink *link = SIPVoIPLink::instance();
// build a default IP2IP account with default parameters
Account *ip2ip = new SIPAccount(IP2IP_PROFILE);
_accountMap[IP2IP_PROFILE] = ip2ip;
......@@ -2727,7 +2721,7 @@ void ManagerImpl::loadAccountMap(Conf::YamlParser *parser)
// Initialize default UDP transport according to
// IP to IP settings (most likely using port 5060)
link->createDefaultSipUdpTransport();
SIPVoIPLink::instance()->createDefaultSipUdpTransport();
// Force IP2IP settings to be loaded to be loaded
// No registration in the sense of the REGISTER method is performed.
......@@ -2776,8 +2770,6 @@ void ManagerImpl::loadAccountMap(Conf::YamlParser *parser)
void ManagerImpl::unloadAccountMap ()
{
_debug ("Manager: Unload account map");
AccountMap::iterator iter;
for (iter = _accountMap.begin(); iter != _accountMap.end(); ++iter) {
// Avoid removing the IP2IP account twice
......@@ -2786,8 +2778,6 @@ void ManagerImpl::unloadAccountMap ()
}
_accountMap.clear();
delete SIPVoIPLink::instance();
}
bool ManagerImpl::accountExists (const std::string& accountID)
......@@ -2861,8 +2851,6 @@ std::map<std::string, int32_t> ManagerImpl::getAddressbookSettings () const
void ManagerImpl::setAddressbookSettings (
const std::map<std::string, int32_t>& settings)
{
_debug ("Manager: Update addressbook settings");
addressbookPreference.setEnabled (settings.find ("ADDRESSBOOK_ENABLE")->second == 1);
addressbookPreference.setMaxResults (settings.find ("ADDRESSBOOK_MAX_RESULTS")->second);
addressbookPreference.setPhoto (settings.find ("ADDRESSBOOK_DISPLAY_CONTACT_PHOTO")->second == 1);
......@@ -2878,11 +2866,7 @@ void ManagerImpl::setAddressbookSettings (
void ManagerImpl::setAddressbookList (const std::vector<std::string>& list)
{
_debug ("Manager: Set addressbook list");
std::string s = ManagerImpl::serialize (list);
_debug("Manager: New addressbook list: %s", s.c_str());
addressbookPreference.setList (s);
addressbookPreference.setList (ManagerImpl::serialize (list));
saveConfig();
}
......@@ -2921,20 +2905,9 @@ void ManagerImpl::setHookSettings (const std::map<std::string, std::string>& set
// saveConfig();
}
void ManagerImpl::checkCallConfiguration (const std::string& id,
const std::string &to, Call::CallConfiguration *callConfig)
Call::CallConfiguration ManagerImpl::checkCallConfiguration (const std::string& id, const std::string &to)
{
Call::CallConfiguration config;
if (to.find (SIP_SCHEME) == 0 or to.find (SIPS_SCHEME) == 0) {
_debug ("Manager: Sip scheme detected (sip: or sips:), sending IP2IP Call");
config = Call::IPtoIP;
} else
config = Call::Classic;
associateConfigToCall (id, config);
*callConfig = config;
return (to.find (SIP_SCHEME) == 0 or to.find (SIPS_SCHEME) == 0) ? Call::IPtoIP : Call::Classic;
}
bool ManagerImpl::associateConfigToCall (const std::string& callID,
......@@ -3006,17 +2979,12 @@ std::map<std::string, std::string> ManagerImpl::getCallDetails (const std::strin
std::vector<std::string> ManagerImpl::getHistorySerialized(void) const
{
_debug("Manager: Get history serialized");
return _history->get_history_serialized();
}
void ManagerImpl::setHistorySerialized(std::vector<std::string> history)
{
_debug("Manager: Set history serialized");
_history->set_serialized_history (history, preferences.getHistoryLimit());;
_history->set_serialized_history (history, preferences.getHistoryLimit());;
_history->save_history();
}
......@@ -3056,21 +3024,16 @@ std::vector<std::string> ManagerImpl::getConferenceList (void) const
{
std::vector<std::string> v;
vectorFromMapKeys(_conferencemap, v);
return v;
}
std::vector<std::string> ManagerImpl::getParticipantList (const std::string& confID) const
{
ConferenceMap::const_iterator iter_conf = _conferencemap.find (confID);
Conference *conf = NULL;
if (iter_conf != _conferencemap.end())
conf = iter_conf->second;
std::vector<std::string> v;
if (conf) {
const ParticipantSet &participants = conf->getParticipantList();
ConferenceMap::const_iterator iter_conf = _conferencemap.find (confID);
if (iter_conf != _conferencemap.end()) {
const ParticipantSet &participants = iter_conf->second->getParticipantList();
std::copy(participants.begin(), participants.end(), std::back_inserter(v));;
} else
_warn ("Manager: Warning: Did not found conference %s", confID.c_str());
......
......@@ -1227,7 +1227,7 @@ class ManagerImpl
/**
* Check if the call is a classic call or a direct IP-to-IP call
*/
void checkCallConfiguration (const std::string& id, const std::string& to, Call::CallConfiguration *callConfig);
Call::CallConfiguration checkCallConfiguration (const std::string& id, const std::string& to);
Conf::YamlEmitter *emitter;
};
......
......@@ -29,18 +29,5 @@
</tp:docstring>
</arg>
</method>
<method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount">
<tp:docstring>
Get the number of connected clients.
</tp:docstring>
<arg type="i" name="count" direction="out">
<tp:docstring>
The number of client currently connected to the core
</tp:docstring>
</arg>
</method>
</interface>
</node>
......@@ -29,18 +29,5 @@
</tp:docstring>
</arg>
</method>
<method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount">
<tp:docstring>
Get the number of connected clients.
</tp:docstring>
<arg type="i" name="count" direction="out">
<tp:docstring>
The number of client currently connected to the core
</tp:docstring>
</arg>
</method>
</interface>
</node>
......@@ -29,18 +29,5 @@
</tp:docstring>
</arg>
</method>
<method name="getRegistrationCount" tp:name-for-bindings="getRegistrationCount">
<tp:docstring>
Get the number of connected clients.
</tp:docstring>
<arg type="i" name="count" direction="out">
<tp:docstring>
The number of client currently connected to the core
</tp:docstring>
</arg>
</method>
</interface>
</node>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment