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

[#3648] Implement save configuration method

parent 92c996dc
No related branches found
No related tags found
No related merge requests found
...@@ -1413,6 +1413,28 @@ bool ManagerImpl::saveConfig (void) { ...@@ -1413,6 +1413,28 @@ bool ManagerImpl::saveConfig (void) {
setConfig(AUDIO, VOLUME_SPKR, getSpkrVolume()); setConfig(AUDIO, VOLUME_SPKR, getSpkrVolume());
setConfig(AUDIO, VOLUME_MICRO, getMicVolume()); setConfig(AUDIO, VOLUME_MICRO, getMicVolume());
AccountMap::iterator iter = _accountMap.begin();
try{
emitter = new Conf::YamlEmitter("/tmp/sequenceEmiter.txt");
// emitter->writeAccount(&accountmap);
// emitter->writeAccount(&accountmap);
emitter->serializeData();
while(iter != _accountMap.end()) {
iter->second->serialize(emitter);
iter++;
}
preferences.serialize(emitter);
delete emitter;
}
catch (Conf::YamlEmitterException &e) {
_error("ConfigTree: %s", e.what());
}
_setupLoaded = _config.saveConfigTree(_path.data()); _setupLoaded = _config.saveConfigTree(_path.data());
return _setupLoaded; return _setupLoaded;
} }
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include "audio/codecs/codecDescriptor.h" // CodecDescriptor class contained by value here #include "audio/codecs/codecDescriptor.h" // CodecDescriptor class contained by value here
#include "audio/mainbuffer.h" #include "audio/mainbuffer.h"
#include "yamlemitter.h"
#include "yamlparser.h" #include "yamlparser.h"
#include "preferences.h" #include "preferences.h"
...@@ -1347,6 +1348,7 @@ private: ...@@ -1347,6 +1348,7 @@ private:
void check_call_configuration (const CallID& id, const std::string& to, Call::CallConfiguration *callConfig); void check_call_configuration (const CallID& id, const std::string& to, Call::CallConfiguration *callConfig);
Conf::YamlParser *parser; Conf::YamlParser *parser;
Conf::YamlEmitter *emitter;
#ifdef TEST #ifdef TEST
bool testCallAccountMap(); bool testCallAccountMap();
......
...@@ -134,6 +134,8 @@ SIPAccount::~SIPAccount() ...@@ -134,6 +134,8 @@ SIPAccount::~SIPAccount()
void SIPAccount::serialize(Conf::YamlEmitter *emitter) { void SIPAccount::serialize(Conf::YamlEmitter *emitter) {
_debug("SipAccount: serialize %s", _accountID.c_str());
Conf::MappingNode accountmap(NULL); Conf::MappingNode accountmap(NULL);
Conf::MappingNode credentialmap(NULL); Conf::MappingNode credentialmap(NULL);
...@@ -152,6 +154,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter) { ...@@ -152,6 +154,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter) {
Conf::ScalarNode interface(_interface); Conf::ScalarNode interface(_interface);
std::stringstream portstr; portstr << _localPort; std::stringstream portstr; portstr << _localPort;
Conf::ScalarNode port(portstr.str()); Conf::ScalarNode port(portstr.str());
Conf::ScalarNode mailbox("97"); Conf::ScalarNode mailbox("97");
Conf::ScalarNode publishAddr(_publishedIpAddress); Conf::ScalarNode publishAddr(_publishedIpAddress);
std::stringstream publicportstr; publicportstr << _publishedPort; std::stringstream publicportstr; publicportstr << _publishedPort;
...@@ -496,6 +499,9 @@ int SIPAccount::registerVoIPLink() ...@@ -496,6 +499,9 @@ int SIPAccount::registerVoIPLink()
_transportType = PJSIP_TRANSPORT_START_OTHER; _transportType = PJSIP_TRANSPORT_START_OTHER;
initStunConfiguration (); initStunConfiguration ();
} }
else {
_stunServerName = pj_str ((char*) _stunServer.data());
}
// In our definition of the // In our definition of the
// ip2ip profile (aka Direct IP Calls), // ip2ip profile (aka Direct IP Calls),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment