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
Hide 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>
...
@@ -1386,6 +1386,34 @@ your friend's SIP address or username.</translation>
<
source
>
invalidRoute
<
/source
>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Invalid
route
.
<
/translation
>
<
translation
>
Invalid
route
.
<
/translation
>
<
/message
>
<
/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
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
name
>
SettingsUi
<
/name
>
...
...
assets/languages/fr_FR.ts
View file @
986f5d99
...
@@ -1384,6 +1384,34 @@ Cliquez ici : <a href="%1">%1</a>
...
@@ -1384,6 +1384,34 @@ Cliquez ici : <a href="%1">%1</a>
<
source
>
invalidRoute
<
/source
>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Route
invalide
.
<
/translation
>
<
translation
>
Route
invalide
.
<
/translation
>
<
/message
>
<
/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
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
name
>
SettingsUi
<
/name
>
...
...
assets/languages/ru.ts
View file @
986f5d99
...
@@ -1384,6 +1384,34 @@
...
@@ -1384,6 +1384,34 @@
<
source
>
invalidRoute
<
/source
>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Неверный
маршрут
.
<
/translation
>
<
translation
>
Неверный
маршрут
.
<
/translation
>
<
/message
>
<
/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
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
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>
...
@@ -1386,6 +1386,34 @@ arkadaşınızın SIP adresini veya kullanıcı adını girin.</translation>
<
source
>
invalidRoute
<
/source
>
<
source
>
invalidRoute
<
/source
>
<
translation
>
Ge
ç
ersiz
rota
.
<
/translation
>
<
translation
>
Ge
ç
ersiz
rota
.
<
/translation
>
<
/message
>
<
/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
>
<
context
>
<
context
>
<
name
>
SettingsUi
<
/name
>
<
name
>
SettingsUi
<
/name
>
...
...
src/components/settings/AccountSettingsModel.cpp
View file @
986f5d99
...
@@ -96,7 +96,6 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
...
@@ -96,7 +96,6 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
?
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
())
?
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getIdentityAddress
()
->
asString
())
:
QString
(
""
);
:
QString
(
""
);
}
}
map
[
"serverAddress"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getServerAddr
());
map
[
"serverAddress"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getServerAddr
());
map
[
"registrationDuration"
]
=
proxyConfig
->
getPublishExpires
();
map
[
"registrationDuration"
]
=
proxyConfig
->
getPublishExpires
();
map
[
"transport"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getTransport
());
map
[
"transport"
]
=
::
Utils
::
coreStringToAppString
(
proxyConfig
->
getTransport
());
...
@@ -108,6 +107,14 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
...
@@ -108,6 +107,14 @@ QVariantMap AccountSettingsModel::getProxyConfigDescription (const shared_ptr<li
map
[
"avpfEnabled"
]
=
proxyConfig
->
getAvpfMode
()
==
linphone
::
AVPFMode
::
AVPFModeEnabled
;
map
[
"avpfEnabled"
]
=
proxyConfig
->
getAvpfMode
()
==
linphone
::
AVPFMode
::
AVPFModeEnabled
;
map
[
"registrationState"
]
=
::
mapLinphoneRegistrationStateToUi
(
proxyConfig
->
getState
());
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
;
return
map
;
}
}
...
@@ -172,6 +179,33 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
...
@@ -172,6 +179,33 @@ bool AccountSettingsModel::addOrUpdateProxyConfig (
:
linphone
::
AVPFMode
::
AVPFModeDefault
:
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
);
return
addOrUpdateProxyConfig
(
proxyConfig
);
}
}
...
...
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.js
View file @
986f5d99
...
@@ -36,6 +36,11 @@ function initForm (account) {
...
@@ -36,6 +36,11 @@ function initForm (account) {
registerEnabled
.
checked
=
config
.
registerEnabled
registerEnabled
.
checked
=
config
.
registerEnabled
publishPresence
.
checked
=
config
.
publishPresence
publishPresence
.
checked
=
config
.
publishPresence
avpfEnabled
.
checked
=
config
.
avpfEnabled
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
)
{
if
(
account
)
{
dialog
.
_sipAddressOk
=
true
dialog
.
_sipAddressOk
=
true
...
@@ -62,7 +67,12 @@ function validProxyConfig () {
...
@@ -62,7 +67,12 @@ function validProxyConfig () {
avpfInterval
:
avpfInterval
.
text
,
avpfInterval
:
avpfInterval
.
text
,
registerEnabled
:
registerEnabled
.
checked
,
registerEnabled
:
registerEnabled
.
checked
,
publishPresence
:
publishPresence
.
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
)
dialog
.
exit
(
1
)
}
else
{
}
else
{
...
@@ -108,3 +118,5 @@ function handleTransportChanged (transport) {
...
@@ -108,3 +118,5 @@ function handleTransportChanged (transport) {
dialog
.
_serverAddressOk
=
false
dialog
.
_serverAddressOk
=
false
}
}
}
}
// -----------------------------------------------------------------------------
ui/views/App/Settings/Dialogs/SettingsSipAccountsEdit.qml
View file @
986f5d99
...
@@ -42,131 +42,206 @@ DialogPlus {
...
@@ -42,131 +42,206 @@ DialogPlus {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Form
{
TabContainer
{
anchors.fill
:
parent
Column
{
width
:
parent
.
width
FormLine
{
Form
{
FormGroup
{
title
:
qsTr
(
'
mainSipAccountSettingsTitle
'
)
label
:
qsTr
(
'
sipAddressLabel
'
)
+
'
*
'
width
:
parent
.
width
TextField
{
FormLine
{
id
:
sipAddress
FormGroup
{
label
:
qsTr
(
'
sipAddressLabel
'
)
+
'
*
'
error
:
dialog
.
_sipAddressOk
?
''
:
qsTr
(
'
invalidSipAddress
'
)
TextField
{
id
:
sipAddress
onTextChanged
:
Logic
.
handleSipAddressChanged
(
text
)
error
:
dialog
.
_sipAddressOk
?
''
:
qsTr
(
'
invalidSipAddress
'
)
onTextChanged
:
Logic
.
handleSipAddressChanged
(
text
)
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
serverAddressLabel
'
)
+
'
*
'
label
:
qsTr
(
'
serverAddressLabel
'
)
+
'
*
'
TextField
{
TextField
{
id
:
serverAddress
id
:
serverAddress
error
:
dialog
.
_serverAddressOk
?
''
:
qsTr
(
'
invalidServerAddress
'
)
error
:
dialog
.
_serverAddressOk
?
''
:
qsTr
(
'
invalidServerAddress
'
)
onTextChanged
:
Logic
.
handleServerAddressChanged
(
text
)
onTextChanged
:
Logic
.
handleServerAddressChanged
(
text
)
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
registrationDurationLabel
'
)
label
:
qsTr
(
'
registrationDurationLabel
'
)
NumericField
{
NumericField
{
id
:
registrationDuration
id
:
registrationDuration
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
transportLabel
'
)
label
:
qsTr
(
'
transportLabel
'
)
ComboBox
{
ComboBox
{
id
:
transport
id
:
transport
enabled
:
dialog
.
_serverAddressOk
enabled
:
dialog
.
_serverAddressOk
model
:
[
'
UDP
'
,
'
TCP
'
,
'
TLS
'
,
'
DTLS
'
]
model
:
[
'
UDP
'
,
'
TCP
'
,
'
TLS
'
,
'
DTLS
'
]
onActivated
:
Logic
.
handleTransportChanged
(
model
[
index
])
onActivated
:
Logic
.
handleTransportChanged
(
model
[
index
])
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
routeLabel
'
)
label
:
qsTr
(
'
routeLabel
'
)
TextField
{
TextField
{
id
:
route
id
:
route
error
:
dialog
.
_routeOk
?
''
:
qsTr
(
'
invalidRoute
'
)
error
:
dialog
.
_routeOk
?
''
:
qsTr
(
'
invalidRoute
'
)
onTextChanged
:
Logic
.
handleRouteChanged
(
text
)
onTextChanged
:
Logic
.
handleRouteChanged
(
text
)
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
contactParamsLabel
'
)
label
:
qsTr
(
'
contactParamsLabel
'
)
TextField
{
TextField
{
id
:
contactParams
id
:
contactParams
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
avpfIntervalLabel
'
)
label
:
qsTr
(
'
avpfIntervalLabel
'
)
NumericField
{
NumericField
{
id
:
avpfInterval
id
:
avpfInterval
maxValue
:
5
maxValue
:
5
minValue
:
1
minValue
:
1
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
registerEnabledLabel
'
)
label
:
qsTr
(
'
registerEnabledLabel
'
)
Switch
{
Switch
{
id
:
registerEnabled
id
:
registerEnabled
onClicked
:
checked
=
!
checked
onClicked
:
checked
=
!
checked
}
}
}
}
}
}
FormLine
{
FormLine
{
FormGroup
{
FormGroup
{
label
:
qsTr
(
'
publishPresenceLabel
'
)
label
:
qsTr
(
'
publishPresenceLabel
'
)
Switch
{
Switch
{
id
:
publishPresence
id
:
publishPresence
onClicked
:
checked
=
!
checked
onClicked
:
checked
=
!
checked
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
avpfEnabledLabel
'
)
Switch
{
id
:
avpfEnabled
onClicked
:
checked
=
!
checked
}
}
}
}
}
}
}
FormLine
{
// -----------------------------------------------------------------------
FormGroup
{
// NAT and Firewall.
label
:
qsTr
(
'
avpfEnabledLabel
'
)
// -----------------------------------------------------------------------
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
{}
Switch
{
FormGroup
{
id
:
avpfEnabled
label
:
qsTr
(
'
turnPasswordLabel
'
)
onClicked
:
checked
=
!
checked
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
...
@@ -5,5 +5,5 @@ import QtQml 2.2
QtObject
{
QtObject
{
property
int
height
:
550
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