diff --git a/daemon/src/account.cpp b/daemon/src/account.cpp index 6c859f213e6c7e1f9a6368f9efec35a28e7da2ca..ce497ce18a134a5cff20ef6acd6ebfed92799a13 100644 --- a/daemon/src/account.cpp +++ b/daemon/src/account.cpp @@ -211,6 +211,22 @@ std::string join_string(const std::vector<std::string> &v) } } +std::vector<std::string> +Account::split_string(std::string s) +{ + std::vector<std::string> list; + std::string temp; + + while (s.find("/", 0) != std::string::npos) { + size_t pos = s.find("/", 0); + temp = s.substr(0, pos); + s.erase(0, pos + 1); + list.push_back(temp); + } + + return list; +} + void Account::setActiveAudioCodecs(const vector<string> &list) { diff --git a/daemon/src/account.h b/daemon/src/account.h index 71bf9c0bf7ea0e69bff1318af43f68804990aee0..b2aabf09c98aa22751ee53c39705dadffbe68c07 100644 --- a/daemon/src/account.h +++ b/daemon/src/account.h @@ -189,6 +189,9 @@ class Account : public Serializable { mailBox_ = mb; } + static std::vector<std::string> + split_string(std::string s); + static const char * const VIDEO_CODEC_ENABLED; static const char * const VIDEO_CODEC_NAME; static const char * const VIDEO_CODEC_PARAMETERS; diff --git a/daemon/src/iax/iaxaccount.cpp b/daemon/src/iax/iaxaccount.cpp index 6010d3b4ee9cfcbd63f5d4e1d3fb1d9a08e7a892..302d4502010d34b1d3142bf27c93e169eb19689c 100644 --- a/daemon/src/iax/iaxaccount.cpp +++ b/daemon/src/iax/iaxaccount.cpp @@ -95,7 +95,7 @@ void IAXAccount::unserialize(const Conf::YamlNode &map) map.getValue(AUDIO_CODECS_KEY, &audioCodecStr_); // Update codec list which one is used for SDP offer - setActiveAudioCodecs(ManagerImpl::split_string(audioCodecStr_)); + setActiveAudioCodecs(split_string(audioCodecStr_)); map.getValue(DISPLAY_NAME_KEY, &displayName_); } diff --git a/daemon/src/managerimpl.cpp b/daemon/src/managerimpl.cpp index 8d950e03e0c729c6e57cdba9f92dca26e3df1ac0..0aa4e7ded4eea8fcf789bac6edc17b09c9d420b4 100644 --- a/daemon/src/managerimpl.cpp +++ b/daemon/src/managerimpl.cpp @@ -1897,21 +1897,6 @@ std::string ManagerImpl::createConfigFile() const return configdir + DIR_SEPARATOR_STR + PROGNAME + ".yml"; } -std::vector<std::string> ManagerImpl::split_string(std::string s) -{ - std::vector<std::string> list; - std::string temp; - - while (s.find("/", 0) != std::string::npos) { - size_t pos = s.find("/", 0); - temp = s.substr(0, pos); - s.erase(0, pos + 1); - list.push_back(temp); - } - - return list; -} - std::string ManagerImpl::getCurrentAudioCodecName(const std::string& id) { std::string accountid = getAccountFromCall(id); @@ -2538,7 +2523,7 @@ std::string ManagerImpl::getNewCallID() std::vector<std::string> ManagerImpl::loadAccountOrder() const { - return split_string(preferences.getAccountOrder()); + return Account::split_string(preferences.getAccountOrder()); } namespace { diff --git a/daemon/src/managerimpl.h b/daemon/src/managerimpl.h index 4cb02aacbf7cbb45f2a7177961131b6e02bea7af..6159442154c817bcacd0e1b9364fc03b9aab82f1 100644 --- a/daemon/src/managerimpl.h +++ b/daemon/src/managerimpl.h @@ -577,8 +577,6 @@ class ManagerImpl { */ void setEchoCancelState(const std::string &state); - static std::vector<std::string> split_string(std::string v); - /** * Ringtone option. * If ringtone is enabled, ringtone on incoming call use custom choice. If not, only standart tone. diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index 53762491fc23431dd2f9449f534e84699ea498c8..4f4e116fec214e32a299695da1677c1e95e47223 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -318,7 +318,7 @@ void SIPAccount::unserialize(const Conf::YamlNode &mapNode) if (not isIP2IP()) mapNode.getValue(MAILBOX_KEY, &mailBox_); mapNode.getValue(AUDIO_CODECS_KEY, &audioCodecStr_); // Update codec list which one is used for SDP offer - setActiveAudioCodecs(ManagerImpl::split_string(audioCodecStr_)); + setActiveAudioCodecs(split_string(audioCodecStr_)); #ifdef SFL_VIDEO YamlNode *videoCodecsNode(mapNode.getValue(VIDEO_CODECS_KEY));