diff --git a/sflphone-common/src/dbus/callmanager.cpp b/sflphone-common/src/dbus/callmanager.cpp index f3aa16c175cfb378280c2b65f5d94789e2816020..fb41bec4c2f62becde7a9a0c9349d9870cd92498 100644 --- a/sflphone-common/src/dbus/callmanager.cpp +++ b/sflphone-common/src/dbus/callmanager.cpp @@ -18,6 +18,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <vector> + #include "global.h" #include "callmanager.h" @@ -45,6 +47,33 @@ CallManager::placeCall (const std::string& accountID, else Manager::instance().outgoingCall (accountID, callID, to); } +void +CallManager::placeCallFirstAccount (const std::string& callID, + const std::string& to) +{ + if (to == "") { + _warn("No number entered - Call stopped"); + return; + } + + std::vector< std::string > accountIdList = Manager::instance().getAccountList(); + std::vector< std::string >::iterator iter = accountIdList.begin(); + + Account *account; + while(iter != accountIdList.end()) { + account = Manager::instance().getAccount(*iter); + if(account->isEnabled()) { + Manager::instance().outgoingCall (*iter, callID, to); + return; + } + + iter++; + } + + _warn("No enabled account found - Call stopped\n"); + +} + void CallManager::refuse (const std::string& callID) { diff --git a/sflphone-common/src/dbus/callmanager.h b/sflphone-common/src/dbus/callmanager.h index 8c3bab14c0646a373bf83442f2a8035b17ef68e1..c49f9c9c284fdbd33ce19ff253b19bffb106ddc4 100644 --- a/sflphone-common/src/dbus/callmanager.h +++ b/sflphone-common/src/dbus/callmanager.h @@ -53,6 +53,8 @@ class CallManager /* Call related methods */ void placeCall( const std::string& accountID, const std::string& callID, const std::string& to ); + void placeCallFirstAccount( const std::string& callID, const std::string& to ); + void refuse( const std::string& callID ); void accept( const std::string& callID ); void hangUp( const std::string& callID ); diff --git a/sflphone-common/src/dbus/configurationmanager.cpp b/sflphone-common/src/dbus/configurationmanager.cpp index 8b19492e8f9e69c955dfc1783e71584ede4c87a3..7575cc36764dd9e17fefb676520900b28fde9563 100644 --- a/sflphone-common/src/dbus/configurationmanager.cpp +++ b/sflphone-common/src/dbus/configurationmanager.cpp @@ -439,7 +439,7 @@ std::vector<std::string> ConfigurationManager::getCodecDetails (const int32_t& p std::vector<std::string> ConfigurationManager::getActiveCodecList (const std::string& accountID) { - _warn ("Send active codec list for account %s", accountID.c_str ()); + _debug("Send active codec list for account %s", accountID.c_str ()); std::vector< std::string > v; Account *acc; @@ -449,11 +449,9 @@ std::vector<std::string> ConfigurationManager::getActiveCodecList (const std::st acc = Manager::instance ().getAccount (accountID); if (acc != NULL) { - _warn ("Et un compte, un !"); active = acc->getActiveCodecs (); size = active.size(); while (i<size) { - _warn ("Et un codec, un !"); std::stringstream ss; ss << active[i]; v.push_back ( (ss.str()).data()); @@ -468,11 +466,9 @@ std::vector<std::string> ConfigurationManager::getActiveCodecList (const std::st void ConfigurationManager::setActiveCodecList (const std::vector< std::string >& list, const std::string& accountID) { - _debug ("ConfigurationManager::setActiveCodecList received"); + _debug ("ConfigurationManager::setActiveCodecList received"); Account *acc; - unsigned int i=0; - size_t size; // Save the codecs list per account acc = Manager::instance ().getAccount (accountID); diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index f49cbc06689110646c42f8e1ca2971fdb8d6ed28..9b2a1e510a349d72623e19ab983274e87ea02abf 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -380,7 +380,6 @@ std::string SIPVoIPLink::getInterfaceAddrFromName(std::string ifaceName) { struct ifreq ifr; int fd; - int rval = 0; int err; struct sockaddr_in *saddr_in; @@ -1806,7 +1805,6 @@ bool SIPVoIPLink::pjsip_init() { pj_status_t status; int errPjsip = 0; - int port; pjsip_inv_callback inv_cb; pj_str_t accepted; std::string name_mod;