Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
986f5d99
Commit
986f5d99
authored
Feb 20, 2018
by
Danmei Chen
Committed by
Ronan Abhamon
Feb 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(SettingsSipAccountsEdit): give access to nat policy settings for one proxy config
parent
c2cde508
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
319 additions
and
86 deletions
+319
-86
en.ts
assets/languages/en.ts
+28
-0
fr_FR.ts
assets/languages/fr_FR.ts
+28
-0
ru.ts
assets/languages/ru.ts
+28
-0
tr.ts
assets/languages/tr.ts
+28
-0
AccountSettingsModel.cpp
src/components/settings/AccountSettingsModel.cpp
+35
-1
SettingsSipAccountsEdit.js
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.js
+13
-1
SettingsSipAccountsEdit.qml
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.qml
+158
-83
SettingsSipAccountsEditStyle.qml
.../Styles/Settings/Dialogs/SettingsSipAccountsEditStyle.qml
+1
-1
No files found.
assets/languages/en.ts
View file @
986f5d99
...
...
@@ -1386,6 +1386,34 @@ your friend's SIP address or username.</translation>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Invalid
route
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableIceLabel
<
/source
>
<
translation
>
Enable
ICE
<
/translation
>
<
/message
>
<
message
>
<
source
>
stunServerLabel
<
/source
>
<
translation
>
STUN
/
TURN
server
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableTurnLabel
<
/source
>
<
translation
>
Enable
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnUserLabel
<
/source
>
<
translation
>
TURN
user
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnPasswordLabel
<
/source
>
<
translation
>
TURN
password
<
/translation
>
<
/message
>
<
message
>
<
source
>
natAndFirewallTitle
<
/source
>
<
translation
>
NAT
and
Firewall
<
/translation
>
<
/message
>
<
message
>
<
source
>
mainSipAccountSettingsTitle
<
/source
>
<
translation
>
Main
SIP
account
settings
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
...
...
assets/languages/fr_FR.ts
View file @
986f5d99
...
...
@@ -1384,6 +1384,34 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Route
invalide
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableIceLabel
<
/source
>
<
translation
>
Activer
ICE
<
/translation
>
<
/message
>
<
message
>
<
source
>
stunServerLabel
<
/source
>
<
translation
>
Serveur
STUN
/
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableTurnLabel
<
/source
>
<
translation
>
Activer
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnUserLabel
<
/source
>
<
translation
>
Utilisateur
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnPasswordLabel
<
/source
>
<
translation
>
Mot
de
passe
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
natAndFirewallTitle
<
/source
>
<
translation
>
NAT
et
Pare
-
feu
<
/translation
>
<
/message
>
<
message
>
<
source
>
mainSipAccountSettingsTitle
<
/source
>
<
translation
>
Param
è
tres
principaux
du
compte
SIP
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
...
...
assets/languages/ru.ts
View file @
986f5d99
...
...
@@ -1384,6 +1384,34 @@
<
source
>
invalidRoute
<
/source
>
<
translation
>
Неверный
маршрут
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableIceLabel
<
/source
>
<
translation
>
Включить
ICE
<
/translation
>
<
/message
>
<
message
>
<
source
>
stunServerLabel
<
/source
>
<
translation
>
Сервер
STUN
/
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableTurnLabel
<
/source
>
<
translation
>
Включить
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnUserLabel
<
/source
>
<
translation
>
Пользователь
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnPasswordLabel
<
/source
>
<
translation
>
Пароль
TURN
<
/translation
>
<
/message
>
<
message
>
<
source
>
natAndFirewallTitle
<
/source
>
<
translation
>
NAT
и
межсетевой
экран
<
/translation
>
<
/message
>
<
message
>
<
source
>
mainSipAccountSettingsTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
...
...
assets/languages/tr.ts
View file @
986f5d99
...
...
@@ -1386,6 +1386,34 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.</translation>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Ge
ç
ersiz
rota
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableIceLabel
<
/source
>
<
translation
>
ICE
&
apos
;
yi
etkinle
ş
tir
<
/translation
>
<
/message
>
<
message
>
<
source
>
stunServerLabel
<
/source
>
<
translation
>
STUN
/
TURN
sunucusu
<
/translation
>
<
/message
>
<
message
>
<
source
>
enableTurnLabel
<
/source
>
<
translation
>
TURN
&
apos
;
u
etkinle
ş
tir
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnUserLabel
<
/source
>
<
translation
>
TURN
kullan
ı
c
ı
s
ı
<
/translation
>
<
/message
>
<
message
>
<
source
>
turnPasswordLabel
<
/source
>
<
translation
>
TURN
parolas
ı
<
/translation
>
<
/message
>
<
message
>
<
source
>
natAndFirewallTitle
<
/source
>
<
translation
>
NAT
ve
G
ü
venlik
Duvar
ı
<
/translation
>
<
/message
>
<
message
>
<
source
>
mainSipAccountSettingsTitle
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
986f5d99
...
...
@@ -96,7 +96,6 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
?
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
())
:
QString
(
""
);
}
map
[
"serverAddress"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getServerAddr
());
map
[
"registrationDuration"
]
=
proxyConfig
->
getPublishExpires
();
map
[
"transport"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getTransport
());
...
...
@@ -108,6 +107,14 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
map
[
"avpfEnabled"
]
=
proxyConfig
->
getAvpfMode
()
==
linphone
::
AVPFMode
::
AVPFModeEnabled
;
map
[
"registrationState"
]
=
::
mapLinphoneRegistrationStateToUi
(
proxyConfig
->
getState
());
shared_ptr
<
linphone
::
NatPolicy
>
natPolicy
=
proxyConfig
->
getNatPolicy
();
map
[
"iceEnabled"
]
=
natPolicy
->
iceEnabled
();
map
[
"turnEnabled"
]
=
natPolicy
->
turnEnabled
();
map
[
"stunServer"
]
=
::
Utils
::
coreStringToAppString
(
natPolicy
->
getStunServer
());
map
[
"turnUser"
]
=
::
Utils
::
coreStringToAppString
(
natPolicy
->
getStunServerUsername
());
shared_ptr
<
const
linphone
::
AuthInfo
>
authInfo
=
proxyConfig
->
findAuthInfo
();
map
[
"turnPassword"
]
=
authInfo
?
::
Utils
::
coreStringToAppString
(
authInfo
->
getPasswd
())
:
QString
(
""
);
return
map
;
}
...
...
@@ -172,6 +179,33 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
:
linphone
::
AVPFMode
::
AVPFModeDefault
);
shared_ptr
<
linphone
::
NatPolicy
>
natPolicy
=
proxyConfig
->
getNatPolicy
();
natPolicy
->
enableIce
(
data
[
"iceEnabled"
].
toBool
());
natPolicy
->
enableStun
(
data
[
"iceEnabled"
].
toBool
());
natPolicy
->
enableTurn
(
data
[
"turnEnabled"
].
toBool
());
natPolicy
->
setStunServer
(
::
Utils
::
appStringToCoreString
(
data
[
"stunServer"
].
toString
()));
natPolicy
->
setStunServerUsername
(
::
Utils
::
appStringToCoreString
(
data
[
"turnUser"
].
toString
()));
shared_ptr
<
const
linphone
::
AuthInfo
>
authInfo
=
proxyConfig
->
findAuthInfo
();
shared_ptr
<
linphone
::
Core
>
core
=
proxyConfig
->
getCore
();
if
(
authInfo
)
{
shared_ptr
<
linphone
::
AuthInfo
>
clonedAuthInfo
=
authInfo
->
clone
();
clonedAuthInfo
->
setPasswd
(
::
Utils
::
appStringToCoreString
(
data
[
"turnPassword"
].
toString
()));
core
->
removeAuthInfo
(
authInfo
);
core
->
addAuthInfo
(
clonedAuthInfo
);
}
else
{
authInfo
=
linphone
::
Factory
::
get
()
->
createAuthInfo
(
::
Utils
::
appStringToCoreString
(
data
[
"turnUser"
].
toString
()),
::
Utils
::
appStringToCoreString
(
data
[
"turnUser"
].
toString
()),
::
Utils
::
appStringToCoreString
(
data
[
"turnPassword"
].
toString
()),
""
,
""
,
""
);
core
->
addAuthInfo
(
authInfo
);
}
return
addOrUpdateProxyConfig
(
proxyConfig
);
}
...
...
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.js
View file @
986f5d99
...
...
@@ -36,6 +36,11 @@ function initForm (account) {
registerEnabled
.
checked
=
config
.
registerEnabled
publishPresence
.
checked
=
config
.
publishPresence
avpfEnabled
.
checked
=
config
.
avpfEnabled
iceEnabled
.
checked
=
config
.
iceEnabled
turnEnabled
.
checked
=
config
.
turnEnabled
stunServer
.
text
=
config
.
stunServer
turnPassword
.
text
=
config
.
turnPassword
turnUser
.
text
=
config
.
turnUser
if
(
account
)
{
dialog
.
_sipAddressOk
=
true
...
...
@@ -62,7 +67,12 @@ function validProxyConfig () {
avpfInterval
:
avpfInterval
.
text
,
registerEnabled
:
registerEnabled
.
checked
,
publishPresence
:
publishPresence
.
checked
,
avpfEnabled
:
avpfEnabled
.
checked
avpfEnabled
:
avpfEnabled
.
checked
,
iceEnabled
:
iceEnabled
.
checked
,
turnEnabled
:
turnEnabled
.
checked
,
stunServer
:
stunServer
.
text
,
turnUser
:
turnUser
.
text
,
turnPassword
:
turnPassword
.
text
}))
{
dialog
.
exit
(
1
)
}
else
{
...
...
@@ -108,3 +118,5 @@ function handleTransportChanged (transport) {
dialog
.
_serverAddressOk
=
false
}
}
// -----------------------------------------------------------------------------
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.qml
View file @
986f5d99
...
...
@@ -42,8 +42,13 @@ DialogPlus {
// ---------------------------------------------------------------------------
TabContainer
{
Column
{
width
:
parent
.
width
Form
{
anchors.fill
:
parent
title
:
qsTr
(
'
mainSipAccountSettingsTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
...
...
@@ -171,4 +176,74 @@ DialogPlus {
}
}
}
// -----------------------------------------------------------------------
// NAT and Firewall.
// -----------------------------------------------------------------------
Form
{
title
:
qsTr
(
'
natAndFirewallTitle
'
)
width
:
parent
.
width
FormLine
{
FormGroup
{
label
:
qsTr
(
'
enableIceLabel
'
)
Switch
{
id
:
iceEnabled
onClicked
:
checked
=
!
checked
}
}
FormGroup
{
label
:
qsTr
(
'
stunServerLabel
'
)
TextField
{
id
:
stunServer
readOnly
:
!
iceEnabled
.
checked
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
enableTurnLabel
'
)
Switch
{
id
:
turnEnabled
enabled
:
iceEnabled
.
checked
onClicked
:
checked
=
!
checked
}
}
FormGroup
{
label
:
qsTr
(
'
turnUserLabel
'
)
TextField
{
id
:
turnUser
readOnly
:
!
turnEnabled
.
checked
||
!
turnEnabled
.
enabled
}
}
}
FormLine
{
FormGroup
{}
FormGroup
{
label
:
qsTr
(
'
turnPasswordLabel
'
)
TextField
{
id
:
turnPassword
readOnly
:
!
turnEnabled
.
checked
||
!
turnEnabled
.
enabled
||
!
turnUser
.
text
.
length
}
}
}
}
}
}
}
ui/views/App/Styles/Settings/Dialogs/SettingsSipAccountsEditStyle.qml
View file @
986f5d99
...
...
@@ -5,5 +5,5 @@ import QtQml 2.2
QtObject
{
property
int
height
:
550
property
int
width
:
600
property
int
width
:
934
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment