Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
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
Kulya
vmj-qt
Commits
6d7ceb67
Commit
6d7ceb67
authored
Jun 23, 2021
by
Adrian Georgescu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added NAT traversal section in Preferences and STUN servers settings
parent
27df9531
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
805 additions
and
614 deletions
+805
-614
preferences.py
blink/preferences.py
+42
-3
preferences.ui
resources/preferences.ui
+763
-611
No files found.
blink/preferences.py
View file @
6d7ceb67
...
...
@@ -18,7 +18,7 @@ from zope.interface import implementer
from
sipsimple.account
import
AccountManager
,
BonjourAccount
from
sipsimple.application
import
SIPApplication
from
sipsimple.configuration
import
DefaultValue
from
sipsimple.configuration.datatypes
import
H264Profile
,
MSRPRelayAddress
,
Path
,
PortRange
,
SIPProxyAddress
from
sipsimple.configuration.datatypes
import
H264Profile
,
MSRPRelayAddress
,
Path
,
PortRange
,
SIPProxyAddress
,
STUNServerAddress
,
STUNServerAddressList
from
sipsimple.configuration.settings
import
SIPSimpleSettings
from
sipsimple.threading
import
run_in_thread
...
...
@@ -234,6 +234,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self
.
auth_username_editor
.
editingFinished
.
connect
(
self
.
_SH_AuthUsernameEditorEditingFinished
)
self
.
always_use_my_msrp_relay_button
.
clicked
.
connect
(
self
.
_SH_AlwaysUseMyMSRPRelayButtonClicked
)
self
.
msrp_relay_host_editor
.
editingFinished
.
connect
(
self
.
_SH_MSRPRelayHostEditorEditingFinished
)
self
.
stun_server_list_editor
.
editingFinished
.
connect
(
self
.
_SH_StunServerListEditorEditingFinished
)
self
.
msrp_relay_port
.
valueChanged
[
int
]
.
connect
(
self
.
_SH_MSRPRelayPortValueChanged
)
self
.
msrp_relay_transport_button
.
activated
[
str
]
.
connect
(
self
.
_SH_MSRPRelayTransportButtonActivated
)
self
.
voicemail_uri_editor
.
editingFinished
.
connect
(
self
.
_SH_VoicemailURIEditorEditingFinished
)
...
...
@@ -241,7 +242,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self
.
server_tools_url_editor
.
editingFinished
.
connect
(
self
.
_SH_ServerToolsURLEditorEditingFinished
)
self
.
conference_server_editor
.
editingFinished
.
connect
(
self
.
_SH_ConferenceServerEditorEditingFinished
)
# Account
network
settings
# Account
NAT traversal
settings
self
.
use_ice_button
.
clicked
.
connect
(
self
.
_SH_UseICEButtonClicked
)
self
.
msrp_transport_button
.
activated
[
str
]
.
connect
(
self
.
_SH_MSRPTransportButtonActivated
)
...
...
@@ -820,6 +821,12 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
self
.
always_use_my_proxy_button
.
setChecked
(
account
.
sip
.
always_use_my_proxy
)
outbound_proxy
=
account
.
sip
.
outbound_proxy
or
UnspecifiedOutboundProxy
self
.
outbound_proxy_host_editor
.
setText
(
outbound_proxy
.
host
)
if
account
.
nat_traversal
.
stun_server_list
:
stun_server_list
=
", "
.
join
(
'
%
s:
%
s'
%
(
s
.
host
,
s
.
port
)
for
s
in
account
.
nat_traversal
.
stun_server_list
)
else
:
stun_server_list
=
""
self
.
stun_server_list_editor
.
setText
(
stun_server_list
)
with
blocked_qt_signals
(
self
.
outbound_proxy_port
):
self
.
outbound_proxy_port
.
setValue
(
outbound_proxy
.
port
)
self
.
outbound_proxy_transport_button
.
setCurrentIndex
(
self
.
outbound_proxy_transport_button
.
findText
(
outbound_proxy
.
transport
.
upper
()))
...
...
@@ -1026,7 +1033,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
if
tab_widget
.
indexOf
(
self
.
server_settings_tab
)
==
-
1
:
tab_widget
.
addTab
(
self
.
server_settings_tab
,
"Server Settings"
)
if
tab_widget
.
indexOf
(
self
.
network_tab
)
==
-
1
:
tab_widget
.
addTab
(
self
.
network_tab
,
"N
etwork
"
)
tab_widget
.
addTab
(
self
.
network_tab
,
"N
AT Traversal
"
)
if
tab_widget
.
indexOf
(
self
.
advanced_tab
)
==
-
1
:
tab_widget
.
addTab
(
self
.
advanced_tab
,
"Advanced"
)
self
.
password_label
.
show
()
...
...
@@ -1233,6 +1240,37 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account
.
nat_traversal
.
msrp_relay
=
msrp_relay
account
.
save
()
def
_SH_StunServerListEditorEditingFinished
(
self
):
account
=
self
.
selected_account
stun_server_list
=
self
.
stun_server_list_editor
.
text
()
.
strip
()
.
lower
()
or
''
new_stun_server_list
=
[]
if
stun_server_list
:
for
server
in
stun_server_list
.
split
(
","
):
try
:
(
host
,
port
)
=
server
.
strip
()
.
split
(
':'
)
except
ValueError
:
host
=
server
port
=
STUNServerAddress
.
default_port
else
:
try
:
int
(
port
)
except
(
TypeError
,
ValueError
)
as
e
:
port
=
STUNServerAddress
.
default_port
try
:
new_stun_server_list
.
append
(
STUNServerAddress
(
host
,
port
))
except
ValueError
as
e
:
continue
new_stun_server_list
=
new_stun_server_list
or
None
if
account
.
nat_traversal
.
stun_server_list
!=
new_stun_server_list
:
try
:
account
.
nat_traversal
.
stun_server_list
=
new_stun_server_list
account
.
save
()
except
ValueError
as
e
:
pass
def
_SH_MSRPRelayPortValueChanged
(
self
,
value
):
account
=
self
.
selected_account
msrp_relay
=
self
.
account_msrp_relay
...
...
@@ -1240,6 +1278,7 @@ class PreferencesWindow(base_class, ui_class, metaclass=QSingleton):
account
.
nat_traversal
.
msrp_relay
=
msrp_relay
account
.
save
()
def
_SH_MSRPRelayTransportButtonActivated
(
self
,
text
):
account
=
self
.
selected_account
msrp_relay
=
self
.
account_msrp_relay
...
...
resources/preferences.ui
View file @
6d7ceb67
This diff is collapsed.
Click to expand it.
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