write default core values in default rc files instead of forcing them when core starts #LINQT-2319

This commit is contained in:
Gaelle Braud 2026-01-09 15:26:09 +01:00
parent 12c12ad2b5
commit e9f04a8aaf
3 changed files with 27 additions and 24 deletions

View file

@ -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">
<section name="app">
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
<entry name="record_aware" overwrite="true">1</entry>
</section>
<section name="proxy_default_values">
<entry name="avpf" overwrite="true">1</entry>
@ -35,11 +36,20 @@
</section>
<section name="sip">
<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 name="video">
<entry name="automatically_accept" overwrite="true">1</entry>
<entry name="automatically_initiate" overwrite="true">0</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 name="assistant">
<entry name="domain" overwrite="true">sip.linphone.org</entry>

View file

@ -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">
<section name="app">
<entry name="auto_download_incoming_files_max_size" overwrite="true">10000000</entry>
<entry name="record_aware" overwrite="true">1</entry>
</section>
<section name="proxy_default_values">
<entry name="avpf" overwrite="true">0</entry>
@ -30,11 +31,20 @@
<section name="sip">
<entry name="use_rls_presence" 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 name="video">
<entry name="automatically_accept" overwrite="true">1</entry>
<entry name="automatically_initiate" overwrite="true">0</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 name="assistant">
<entry name="domain" overwrite="true"></entry>

View file

@ -75,30 +75,17 @@ void CoreModel::start() {
linphone::Factory::get()->createCore(Utils::appStringToCoreString(Paths::getConfigFilePath(mConfigPath)),
Utils::appStringToCoreString(Paths::getFactoryConfigFilePath()), nullptr);
setMonitor(mCore);
mCore->enableRecordAware(true);
mCore->setVideoDisplayFilter("MSQOGL");
mCore->usePreviewWindow(true);
// Force capture/display.
// Useful if the app was built without video support.
// (The capture/display attributes are reset by the core in this case.)
auto config = mCore->getConfig();
if (!mCore->videoSupported()) {
config->setInt("video", "capture", 0);
config->setInt("video", "display", 0);
}
// if (!mCore->videoSupported()) {
// config->setInt("video", "capture", 0);
// config->setInt("video", "display", 0);
// }
// TODO : set the real transport type when sdk will be updated
// for now, we need to let the OS choose the port to listen on
// 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.
mCore->enableVideoPreview(false); // SDK doesn't write the state in configuration if not ready.
auto config = mCore->getConfig();
QString userAgent = ToolModel::computeUserAgent(config);
mCore->setUserAgent(Utils::appStringToCoreString(userAgent), LINPHONESDK_VERSION);
mCore->start();
@ -114,10 +101,6 @@ void CoreModel::start() {
if (mCore->getLogCollectionUploadServerUrl().empty())
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->setInterval(20);
connect(mIterateTimer, &QTimer::timeout, [this]() { mCore->iterate(); });
@ -461,7 +444,7 @@ void CoreModel::onCallStateChanged(const std::shared_ptr<linphone::Core> &core,
}
App::postModelAsync([core]() {
auto accounts = App::getInstance()->getAccountList();
if(!accounts) return;
if (!accounts) return;
for (int i = 0; i < accounts->rowCount(); ++i) {
auto accountCore = App::getInstance()->getAccountList()->getAt<AccountCore>(i);
emit accountCore->lSetPresence(core->getCallsNb() == 0 ? LinphoneEnums::Presence::Online