Skip to content
Snippets Groups Projects
Commit 454df2e6 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2588] Use loadAccountOrder in placeCallFirstAccount to load account list

parent c5a61b1d
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
<arg type="s" name="to" direction="in"/> <arg type="s" name="to" direction="in"/>
</method> </method>
<method name="placeCallFirstAccount">
<arg type="s" name="callID" direction="in"/>
<arg type="s" name="to" direction="in"/>
</method>
<method name="refuse"> <method name="refuse">
<arg type="s" name="callID" direction="in"/> <arg type="s" name="callID" direction="in"/>
</method> </method>
......
...@@ -51,18 +51,19 @@ void ...@@ -51,18 +51,19 @@ void
CallManager::placeCallFirstAccount (const std::string& callID, CallManager::placeCallFirstAccount (const std::string& callID,
const std::string& to) const std::string& to)
{ {
if (to == "") { if (to == "") {
_warn("No number entered - Call stopped"); _warn("No number entered - Call stopped");
return; return;
} }
std::vector< std::string > accountIdList = Manager::instance().getAccountList(); std::vector< std::string > accountOrder = Manager::instance().loadAccountOrder();
std::vector< std::string >::iterator iter = accountIdList.begin(); std::vector< std::string >::iterator iter = accountOrder.begin();
Account *account; Account *account;
while(iter != accountIdList.end()) { while(iter != accountOrder.end()) {
account = Manager::instance().getAccount(*iter); account = Manager::instance().getAccount(*iter);
if(account->isEnabled()) { if((*iter != IP2IP_PROFILE) && account->isEnabled()) {
Manager::instance().outgoingCall (*iter, callID, to); Manager::instance().outgoingCall (*iter, callID, to);
return; return;
} }
......
...@@ -424,6 +424,12 @@ class ManagerImpl { ...@@ -424,6 +424,12 @@ class ManagerImpl {
*/ */
void setAccountsOrder (const std::string& order); void setAccountsOrder (const std::string& order);
/**
* Load the accounts order set by the user from the sflphonedrc config file
* @return std::vector<std::string> A vector containing the account ID's
*/
std::vector<std::string> loadAccountOrder ();
/** /**
* Retrieve details about a given account * Retrieve details about a given account
* @param accountID The account identifier * @param accountID The account identifier
...@@ -1212,12 +1218,6 @@ class ManagerImpl { ...@@ -1212,12 +1218,6 @@ class ManagerImpl {
*/ */
short loadAccountMap(); short loadAccountMap();
/**
* Load the accounts order set by the user from the sflphonedrc config file
* @return std::vector<std::string> A vector containing the account ID's
*/
std::vector<std::string> loadAccountOrder ();
/** /**
* Unload the account (delete them) * Unload the account (delete them)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment