write default core values in default rc files instead of forcing them when core starts #LINQT-2319
This commit is contained in:
parent
12c12ad2b5
commit
e9f04a8aaf
3 changed files with 27 additions and 24 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
||||||
<section name="app">
|
<section name="app">
|
||||||
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
|
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
|
||||||
|
<entry name="record_aware" overwrite="true">1</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="proxy_default_values">
|
<section name="proxy_default_values">
|
||||||
<entry name="avpf" overwrite="true">1</entry>
|
<entry name="avpf" overwrite="true">1</entry>
|
||||||
|
|
@ -35,11 +36,20 @@
|
||||||
</section>
|
</section>
|
||||||
<section name="sip">
|
<section name="sip">
|
||||||
<entry name="rls_uri" overwrite="true">sips:rls@sip.linphone.org</entry>
|
<entry name="rls_uri" overwrite="true">sips:rls@sip.linphone.org</entry>
|
||||||
|
<entry name="sip_tcp_port" overwrite="true">-2</entry>
|
||||||
|
<entry name="sip_udp_port" overwrite="true">-2</entry>
|
||||||
|
<entry name="sip_tls_port" overwrite="true">-2</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="video">
|
<section name="video">
|
||||||
<entry name="automatically_accept" overwrite="true">1</entry>
|
<entry name="automatically_accept" overwrite="true">1</entry>
|
||||||
<entry name="automatically_initiate" overwrite="true">0</entry>
|
<entry name="automatically_initiate" overwrite="true">0</entry>
|
||||||
<entry name="automatically_accept_direction" overwrite="true">2</entry>
|
<entry name="automatically_accept_direction" overwrite="true">2</entry>
|
||||||
|
<entry name="displaytype" overwrite="true">MSQOGL</entry>
|
||||||
|
<entry name="show_local" overwrite="true">0</entry>
|
||||||
|
</section>
|
||||||
|
<section name="sound">
|
||||||
|
<entry name="mic_gain_db" overwrite="true">0</entry>
|
||||||
|
<entry name="playback_gain_db" overwrite="true">0</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="assistant">
|
<section name="assistant">
|
||||||
<entry name="domain" overwrite="true">sip.linphone.org</entry>
|
<entry name="domain" overwrite="true">sip.linphone.org</entry>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
<config xmlns="http://www.linphone.org/xsds/lpconfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd">
|
||||||
<section name="app">
|
<section name="app">
|
||||||
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
|
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
|
||||||
|
<entry name="record_aware" overwrite="true">1</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="proxy_default_values">
|
<section name="proxy_default_values">
|
||||||
<entry name="avpf" overwrite="true">0</entry>
|
<entry name="avpf" overwrite="true">0</entry>
|
||||||
|
|
@ -30,11 +31,20 @@
|
||||||
<section name="sip">
|
<section name="sip">
|
||||||
<entry name="use_rls_presence" overwrite="true"></entry>
|
<entry name="use_rls_presence" overwrite="true"></entry>
|
||||||
<entry name="rls_uri" overwrite="true"></entry>
|
<entry name="rls_uri" overwrite="true"></entry>
|
||||||
|
<entry name="sip_tcp_port" overwrite="true">-2</entry>
|
||||||
|
<entry name="sip_udp_port" overwrite="true">-2</entry>
|
||||||
|
<entry name="sip_tls_port" overwrite="true">-2</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="video">
|
<section name="video">
|
||||||
<entry name="automatically_accept" overwrite="true">1</entry>
|
<entry name="automatically_accept" overwrite="true">1</entry>
|
||||||
<entry name="automatically_initiate" overwrite="true">0</entry>
|
<entry name="automatically_initiate" overwrite="true">0</entry>
|
||||||
<entry name="automatically_accept_direction" overwrite="true">2</entry>
|
<entry name="automatically_accept_direction" overwrite="true">2</entry>
|
||||||
|
<entry name="displaytype" overwrite="true">MSQOGL</entry>
|
||||||
|
<entry name="show_local" overwrite="true">0</entry>
|
||||||
|
</section>
|
||||||
|
<section name="sound">
|
||||||
|
<entry name="mic_gain_db" overwrite="true">0</entry>
|
||||||
|
<entry name="playback_gain_db" overwrite="true">0</entry>
|
||||||
</section>
|
</section>
|
||||||
<section name="assistant">
|
<section name="assistant">
|
||||||
<entry name="domain" overwrite="true"></entry>
|
<entry name="domain" overwrite="true"></entry>
|
||||||
|
|
|
||||||
|
|
@ -75,30 +75,17 @@ void CoreModel::start() {
|
||||||
linphone::Factory::get()->createCore(Utils::appStringToCoreString(Paths::getConfigFilePath(mConfigPath)),
|
linphone::Factory::get()->createCore(Utils::appStringToCoreString(Paths::getConfigFilePath(mConfigPath)),
|
||||||
Utils::appStringToCoreString(Paths::getFactoryConfigFilePath()), nullptr);
|
Utils::appStringToCoreString(Paths::getFactoryConfigFilePath()), nullptr);
|
||||||
setMonitor(mCore);
|
setMonitor(mCore);
|
||||||
mCore->enableRecordAware(true);
|
|
||||||
mCore->setVideoDisplayFilter("MSQOGL");
|
|
||||||
mCore->usePreviewWindow(true);
|
mCore->usePreviewWindow(true);
|
||||||
// Force capture/display.
|
// Force capture/display.
|
||||||
// Useful if the app was built without video support.
|
// Useful if the app was built without video support.
|
||||||
// (The capture/display attributes are reset by the core in this case.)
|
// (The capture/display attributes are reset by the core in this case.)
|
||||||
auto config = mCore->getConfig();
|
// if (!mCore->videoSupported()) {
|
||||||
if (!mCore->videoSupported()) {
|
// config->setInt("video", "capture", 0);
|
||||||
config->setInt("video", "capture", 0);
|
// config->setInt("video", "display", 0);
|
||||||
config->setInt("video", "display", 0);
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
// TODO : set the real transport type when sdk will be updated
|
mCore->enableVideoPreview(false); // SDK doesn't write the state in configuration if not ready.
|
||||||
// for now, we need to let the OS choose the port to listen on
|
auto config = mCore->getConfig();
|
||||||
// so that the user can be connected to linphone and another softphone
|
|
||||||
// at the same time (otherwise it tries to listen on the same port as
|
|
||||||
// the other software)
|
|
||||||
auto transports = mCore->getTransports();
|
|
||||||
transports->setTcpPort(-2);
|
|
||||||
transports->setUdpPort(-2);
|
|
||||||
transports->setTlsPort(-2);
|
|
||||||
mCore->setTransports(transports);
|
|
||||||
mCore->enableVideoPreview(false); // SDK doesn't write the state in configuration if not ready.
|
|
||||||
config->setInt("video", "show_local", 0); // So : write ourself to turn off camera before starting the core.
|
|
||||||
QString userAgent = ToolModel::computeUserAgent(config);
|
QString userAgent = ToolModel::computeUserAgent(config);
|
||||||
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
|
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
|
||||||
mCore->start();
|
mCore->start();
|
||||||
|
|
@ -114,10 +101,6 @@ void CoreModel::start() {
|
||||||
if (mCore->getLogCollectionUploadServerUrl().empty())
|
if (mCore->getLogCollectionUploadServerUrl().empty())
|
||||||
mCore->setLogCollectionUploadServerUrl(Constants::DefaultUploadLogsServer);
|
mCore->setLogCollectionUploadServerUrl(Constants::DefaultUploadLogsServer);
|
||||||
|
|
||||||
/// These 2 API should not be used as they manage internal gains insterad of those of the soundcard.
|
|
||||||
// Use playback/capture gain from capture graph and call only
|
|
||||||
mCore->setMicGainDb(0.0);
|
|
||||||
mCore->setPlaybackGainDb(0.0);
|
|
||||||
mIterateTimer = new QTimer(this);
|
mIterateTimer = new QTimer(this);
|
||||||
mIterateTimer->setInterval(20);
|
mIterateTimer->setInterval(20);
|
||||||
connect(mIterateTimer, &QTimer::timeout, [this]() { mCore->iterate(); });
|
connect(mIterateTimer, &QTimer::timeout, [this]() { mCore->iterate(); });
|
||||||
|
|
@ -461,7 +444,7 @@ void CoreModel::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
|
||||||
}
|
}
|
||||||
App::postModelAsync([core]() {
|
App::postModelAsync([core]() {
|
||||||
auto accounts = App::getInstance()->getAccountList();
|
auto accounts = App::getInstance()->getAccountList();
|
||||||
if(!accounts) return;
|
if (!accounts) return;
|
||||||
for (int i = 0; i < accounts->rowCount(); ++i) {
|
for (int i = 0; i < accounts->rowCount(); ++i) {
|
||||||
auto accountCore = App::getInstance()->getAccountList()->getAt<AccountCore>(i);
|
auto accountCore = App::getInstance()->getAccountList()->getAt<AccountCore>(i);
|
||||||
emit accountCore->lSetPresence(core->getCallsNb() == 0 ? LinphoneEnums::Presence::Online
|
emit accountCore->lSetPresence(core->getCallsNb() == 0 ? LinphoneEnums::Presence::Online
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue