mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
fix third party connection with registrar uri
This commit is contained in:
parent
ac2bcc4629
commit
a6832576d3
4 changed files with 68 additions and 39 deletions
|
|
@ -104,49 +104,55 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
<location filename="../../model/account/AccountManager.cpp" line="94"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>Das Konto ist bereits verbunden</translation>
|
<translation>Das Konto ist bereits verbunden</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
<location filename="../../model/account/AccountManager.cpp" line="144"/>
|
||||||
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
||||||
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="121"/>
|
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname.</translation>
|
<translation>Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="134"/>
|
<location filename="../../model/account/AccountManager.cpp" line="122"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Folgende Adresse konnte nicht konfiguriert werden: `%1`.</translation>
|
<translation>Folgende Adresse konnte nicht konfiguriert werden: `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="141"/>
|
<location filename="../../model/account/AccountManager.cpp" line="133"/>
|
||||||
|
<source>assistant_account_login_registrar_uri_error</source>
|
||||||
|
<extracomment>Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../model/account/AccountManager.cpp" line="151"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Kontoeinstellungen konnten nicht konfiguriert werden.</translation>
|
<translation>Kontoeinstellungen konnten nicht konfiguriert werden.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="165"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Benutzername und Passwort stimmen nicht überein</translation>
|
<translation>Benutzername und Passwort stimmen nicht überein</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="167"/>
|
<location filename="../../model/account/AccountManager.cpp" line="177"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Fehler bei der Verbindung</translation>
|
<translation>Fehler bei der Verbindung</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="181"/>
|
<location filename="../../model/account/AccountManager.cpp" line="192"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Konto konnte nicht hinzugefügt werden.</translation>
|
<translation>Konto konnte nicht hinzugefügt werden.</translation>
|
||||||
|
|
|
||||||
|
|
@ -104,49 +104,55 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
<location filename="../../model/account/AccountManager.cpp" line="94"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>The account is already connected</translation>
|
<translation>The account is already connected</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
<location filename="../../model/account/AccountManager.cpp" line="144"/>
|
||||||
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
||||||
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
<translation>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</translation>
|
<translation>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="121"/>
|
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Unable to create proxy address. Please check the domain name.</translation>
|
<translation>Unable to create proxy address. Please check the domain name.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="134"/>
|
<location filename="../../model/account/AccountManager.cpp" line="122"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Unable to configure address: `%1`.</translation>
|
<translation>Unable to configure address: `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="141"/>
|
<location filename="../../model/account/AccountManager.cpp" line="133"/>
|
||||||
|
<source>assistant_account_login_registrar_uri_error</source>
|
||||||
|
<extracomment>Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
|
<translation>Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../model/account/AccountManager.cpp" line="151"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Unable to configure account settings.</translation>
|
<translation>Unable to configure account settings.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="165"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Username and password do not match</translation>
|
<translation>Username and password do not match</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="167"/>
|
<location filename="../../model/account/AccountManager.cpp" line="177"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Error during connection</translation>
|
<translation>Error during connection</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="181"/>
|
<location filename="../../model/account/AccountManager.cpp" line="192"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Unable to add account.</translation>
|
<translation>Unable to add account.</translation>
|
||||||
|
|
|
||||||
|
|
@ -104,49 +104,55 @@
|
||||||
<context>
|
<context>
|
||||||
<name>AccountManager</name>
|
<name>AccountManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="93"/>
|
<location filename="../../model/account/AccountManager.cpp" line="94"/>
|
||||||
<source>assistant_account_login_already_connected_error</source>
|
<source>assistant_account_login_already_connected_error</source>
|
||||||
<extracomment>"The account is already connected"</extracomment>
|
<extracomment>"The account is already connected"</extracomment>
|
||||||
<translation>Le compte est déjà connecté</translation>
|
<translation>Le compte est déjà connecté</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
<location filename="../../model/account/AccountManager.cpp" line="144"/>
|
||||||
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
<source>assistant_account_login_outbound_proxy_uri_error</source>
|
||||||
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
<extracomment>Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
<translation>L'uri du proxy SIP sortant est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel)</translation>
|
<translation>L'uri du proxy SIP sortant est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="121"/>
|
<location filename="../../model/account/AccountManager.cpp" line="109"/>
|
||||||
<source>assistant_account_login_proxy_address_error</source>
|
<source>assistant_account_login_proxy_address_error</source>
|
||||||
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
<extracomment>"Unable to create proxy address. Please check the domain name."</extracomment>
|
||||||
<translation>Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine.</translation>
|
<translation>Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="134"/>
|
<location filename="../../model/account/AccountManager.cpp" line="122"/>
|
||||||
<source>assistant_account_login_address_configuration_error</source>
|
<source>assistant_account_login_address_configuration_error</source>
|
||||||
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
<extracomment>"Unable to configure address: `%1`."</extracomment>
|
||||||
<translation>Impossible de configurer l'adresse : `%1`.</translation>
|
<translation>Impossible de configurer l'adresse : `%1`.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="141"/>
|
<location filename="../../model/account/AccountManager.cpp" line="133"/>
|
||||||
|
<source>assistant_account_login_registrar_uri_error</source>
|
||||||
|
<extracomment>Registrar uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional)</extracomment>
|
||||||
|
<translation>La registrar uri est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../../model/account/AccountManager.cpp" line="151"/>
|
||||||
<source>assistant_account_login_params_configuration_error</source>
|
<source>assistant_account_login_params_configuration_error</source>
|
||||||
<extracomment>"Unable to configure account settings."</extracomment>
|
<extracomment>"Unable to configure account settings."</extracomment>
|
||||||
<translation>Impossible de configurer les paramètres du compte.</translation>
|
<translation>Impossible de configurer les paramètres du compte.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="165"/>
|
<location filename="../../model/account/AccountManager.cpp" line="175"/>
|
||||||
<source>assistant_account_login_forbidden_error</source>
|
<source>assistant_account_login_forbidden_error</source>
|
||||||
<extracomment>"Username and password do not match"</extracomment>
|
<extracomment>"Username and password do not match"</extracomment>
|
||||||
<translation>Le couple identifiant mot de passe ne correspond pas</translation>
|
<translation>Le couple identifiant mot de passe ne correspond pas</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="167"/>
|
<location filename="../../model/account/AccountManager.cpp" line="177"/>
|
||||||
<source>assistant_account_login_error</source>
|
<source>assistant_account_login_error</source>
|
||||||
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
<extracomment>"Error during connection, please verify your parameters"</extracomment>
|
||||||
<translation>Erreur durant la connexion, veuillez vérifier vos paramètres</translation>
|
<translation>Erreur durant la connexion, veuillez vérifier vos paramètres</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../model/account/AccountManager.cpp" line="181"/>
|
<location filename="../../model/account/AccountManager.cpp" line="192"/>
|
||||||
<source>assistant_account_add_error</source>
|
<source>assistant_account_add_error</source>
|
||||||
<extracomment>"Unable to add account."</extracomment>
|
<extracomment>"Unable to add account."</extracomment>
|
||||||
<translation>Impossible d'ajouter le compte.</translation>
|
<translation>Impossible d'ajouter le compte.</translation>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "core/path/Paths.hpp"
|
#include "core/path/Paths.hpp"
|
||||||
#include "model/core/CoreModel.hpp"
|
#include "model/core/CoreModel.hpp"
|
||||||
|
#include "model/setting/SettingsModel.hpp"
|
||||||
#include "model/tool/ToolModel.hpp"
|
#include "model/tool/ToolModel.hpp"
|
||||||
#include "tool/Utils.hpp"
|
#include "tool/Utils.hpp"
|
||||||
|
|
||||||
|
|
@ -96,23 +97,10 @@ bool AccountManager::login(QString username,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!displayName.isEmpty()) identity->setDisplayName(Utils::appStringToCoreString(displayName));
|
if (!displayName.isEmpty()) identity->setDisplayName(Utils::appStringToCoreString(displayName));
|
||||||
if (!registrarUri.isEmpty()) {
|
|
||||||
auto linRegistrarUri = ToolModel::interpretUrl(registrarUri);
|
|
||||||
params->setServerAddress(linRegistrarUri);
|
|
||||||
}
|
|
||||||
if (!outboundProxyAddress.isEmpty()) {
|
|
||||||
auto linOutboundProxyAddress = factory->createAddress(Utils::appStringToCoreString(outboundProxyAddress));
|
|
||||||
if (linOutboundProxyAddress) params->setRoutesAddresses({linOutboundProxyAddress});
|
|
||||||
else {
|
|
||||||
//: Outbound proxy uri is invalid. Please make sure it matches the following format :
|
|
||||||
//: sip:host>:<port>;transport=<transport> (:<port> is optional)
|
|
||||||
*errorMessage = tr("assistant_account_login_outbound_proxy_uri_error");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!domain.isEmpty()) {
|
if (!domain.isEmpty()) {
|
||||||
identity->setDomain(Utils::appStringToCoreString(domain));
|
identity->setDomain(Utils::appStringToCoreString(domain));
|
||||||
if (QString::compare(domain, "sip.linphone.org")) {
|
if (QString::compare(domain, SettingsModel::getInstance()->getDefaultDomain())) {
|
||||||
params->setLimeServerUrl("");
|
params->setLimeServerUrl("");
|
||||||
auto computedServerAddress =
|
auto computedServerAddress =
|
||||||
factory->createAddress(Utils::appStringToCoreString(QStringLiteral("sip:%1").arg(domain)));
|
factory->createAddress(Utils::appStringToCoreString(QStringLiteral("sip:%1").arg(domain)));
|
||||||
|
|
@ -136,6 +124,28 @@ bool AccountManager::login(QString username,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!registrarUri.isEmpty()) {
|
||||||
|
auto linRegistrarUri = factory->createAddress(Utils::appStringToCoreString(registrarUri));
|
||||||
|
if (linRegistrarUri) params->setServerAddress(linRegistrarUri);
|
||||||
|
else {
|
||||||
|
//: Registrar uri is invalid. Please make sure it matches the following format :
|
||||||
|
//: sip:host>:<port>;transport=<transport> (:<port> is optional)
|
||||||
|
*errorMessage = tr("assistant_account_login_registrar_uri_error");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!outboundProxyAddress.isEmpty()) {
|
||||||
|
auto linOutboundProxyAddress = factory->createAddress(Utils::appStringToCoreString(outboundProxyAddress));
|
||||||
|
if (linOutboundProxyAddress) params->setRoutesAddresses({linOutboundProxyAddress});
|
||||||
|
else {
|
||||||
|
//: Outbound proxy uri is invalid. Please make sure it matches the following format :
|
||||||
|
//: sip:host>:<port>;transport=<transport> (:<port> is optional)
|
||||||
|
*errorMessage = tr("assistant_account_login_outbound_proxy_uri_error");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (account->setParams(params)) {
|
if (account->setParams(params)) {
|
||||||
//: "Unable to configure account settings."
|
//: "Unable to configure account settings."
|
||||||
*errorMessage = tr("assistant_account_login_params_configuration_error");
|
*errorMessage = tr("assistant_account_login_params_configuration_error");
|
||||||
|
|
@ -175,6 +185,7 @@ bool AccountManager::login(QString username,
|
||||||
}
|
}
|
||||||
emit registrationStateChanged(state, account->getError(), errorMessage);
|
emit registrationStateChanged(state, account->getError(), errorMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto status = core->addAccount(account);
|
auto status = core->addAccount(account);
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
//: "Unable to add account."
|
//: "Unable to add account."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue