mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 19:38:09 +00:00
Set TLS as default
This commit is contained in:
parent
6141c1696a
commit
5a3087e5fb
2 changed files with 27 additions and 24 deletions
|
|
@ -117,21 +117,21 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
|
|||
{
|
||||
const shared_ptr<const linphone::Address> address = proxyConfig->getIdentityAddress();
|
||||
map["sipAddress"] = address
|
||||
? Utils::coreStringToAppString(proxyConfig->getIdentityAddress()->asString())
|
||||
? QString::fromStdString(proxyConfig->getIdentityAddress()->asString())
|
||||
: QString("");
|
||||
}
|
||||
map["serverAddress"] = Utils::coreStringToAppString(proxyConfig->getServerAddr());
|
||||
map["serverAddress"] = QString::fromStdString(proxyConfig->getServerAddr());
|
||||
map["registrationDuration"] = proxyConfig->getPublishExpires();
|
||||
QString transport = QString::fromStdString(proxyConfig->getTransport());
|
||||
if(transport == "")
|
||||
map["transport"] = "tls";// Set to TLS by default
|
||||
else
|
||||
map["transport"] = transport;
|
||||
|
||||
if( map["serverAddress"].toString().toUpper().contains("TRANSPORT="))// transport has been specified : let the RFC select the transport
|
||||
map["transport"] = QString::fromStdString(proxyConfig->getTransport());
|
||||
else// Set to TLS as default
|
||||
map["transport"] = "tls";
|
||||
if( proxyConfig->getRoutes().size() > 0)
|
||||
map["route"] = Utils::coreStringToAppString(proxyConfig->getRoutes().front());
|
||||
map["route"] = QString::fromStdString(proxyConfig->getRoutes().front());
|
||||
else
|
||||
map["route"] = "";
|
||||
map["contactParams"] = Utils::coreStringToAppString(proxyConfig->getContactParameters());
|
||||
map["contactParams"] = QString::fromStdString(proxyConfig->getContactParameters());
|
||||
map["avpfInterval"] = proxyConfig->getAvpfRrInterval();
|
||||
map["registerEnabled"] = proxyConfig->registerEnabled();
|
||||
map["publishPresence"] = proxyConfig->publishEnabled();
|
||||
|
|
|
|||
|
|
@ -144,23 +144,26 @@ SipAddressObserver *SipAddressesModel::getSipAddressObserver (const QString &pee
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
QString SipAddressesModel::getTransportFromSipAddress (const QString &sipAddress) {
|
||||
const shared_ptr<const linphone::Address> address = linphone::Factory::get()->createAddress(
|
||||
Utils::appStringToCoreString(sipAddress)
|
||||
);
|
||||
if( sipAddress.toUpper().contains("TRANSPORT="))
|
||||
{// Transport has been specified : check for it
|
||||
const shared_ptr<const linphone::Address> address = linphone::Factory::get()->createAddress(
|
||||
Utils::appStringToCoreString(sipAddress)
|
||||
);
|
||||
|
||||
if (!address)
|
||||
return QString("TLS"); // Return TLS by default
|
||||
if (!address)
|
||||
return QString("TLS"); // Return TLS by default
|
||||
|
||||
switch (address->getTransport()) {
|
||||
case linphone::TransportType::Udp:
|
||||
return QStringLiteral("UDP");
|
||||
case linphone::TransportType::Tcp:
|
||||
return QStringLiteral("TCP");
|
||||
case linphone::TransportType::Tls:
|
||||
return QStringLiteral("TLS");
|
||||
case linphone::TransportType::Dtls:
|
||||
return QStringLiteral("DTLS");
|
||||
}
|
||||
switch (address->getTransport()) {
|
||||
case linphone::TransportType::Udp:
|
||||
return QStringLiteral("UDP");
|
||||
case linphone::TransportType::Tcp:
|
||||
return QStringLiteral("TCP");
|
||||
case linphone::TransportType::Tls:
|
||||
return QStringLiteral("TLS");
|
||||
case linphone::TransportType::Dtls:
|
||||
return QStringLiteral("DTLS");
|
||||
}
|
||||
}
|
||||
|
||||
return QString("TLS");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue