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
f217bfe5
Commit
f217bfe5
authored
Jan 28, 2016
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified update_ringtone logic and made it more readable
parent
21c9deb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
+6
-13
sessions.py
blink/sessions.py
+6
-13
No files found.
blink/sessions.py
View file @
f217bfe5
...
...
@@ -5263,12 +5263,6 @@ class SessionManager(object):
else
:
outbound_ringtone
=
Null
if
outbound_ringtone
.
type
is
self
.
PrimaryRingtone
and
self
.
inbound_ringtone
.
type
is
self
.
PrimaryRingtone
:
self
.
inbound_ringtone
=
Null
if
outbound_ringtone
is
not
Null
and
self
.
hold_tone
is
not
Null
:
self
.
hold_tone
=
Null
self
.
outbound_ringtone
=
outbound_ringtone
# Incoming ringtone
if
self
.
incoming_requests
:
try
:
...
...
@@ -5278,9 +5272,9 @@ class SessionManager(object):
request
=
self
.
incoming_requests
[
0
]
ringtone_type
=
self
.
SecondaryRingtone
if
self
.
active_session
is
not
None
and
self
.
active_session
.
state
in
(
'connecting/ringing'
,
'connected/*'
)
:
if
outbound_ringtone
.
type
is
self
.
PrimaryRingtone
or
self
.
active_session
is
not
None
and
self
.
active_session
.
state
==
'connected/*'
:
ringtone_type
=
self
.
SecondaryRingtone
initial_delay
=
1
# have a small delay to avoid sounds overlapping
initial_delay
=
1
# have a small delay to avoid sounds overlapping
else
:
initial_delay
=
0
...
...
@@ -5299,14 +5293,10 @@ class SessionManager(object):
else
:
inbound_ringtone
=
Null
if
inbound_ringtone
is
not
Null
and
self
.
hold_tone
is
not
Null
:
self
.
hold_tone
=
Null
self
.
inbound_ringtone
=
inbound_ringtone
# Hold tone
connected_sessions
=
[
session
for
session
in
self
.
sessions
if
session
.
state
==
'connected/*'
]
connected_on_hold_sessions
=
[
session
for
session
in
connected_sessions
if
session
.
on_hold
]
if
self
.
outbound_ringtone
is
Null
and
self
.
inbound_ringtone
is
Null
and
connected_sessions
:
if
outbound_ringtone
is
Null
and
inbound_ringtone
is
Null
and
connected_sessions
:
if
len
(
connected_sessions
)
==
len
(
connected_on_hold_sessions
):
hold_tone
=
WavePlayer
(
SIPApplication
.
alert_audio_mixer
,
Resources
.
get
(
'sounds/hold_tone.wav'
),
loop_count
=
0
,
volume
=
30
,
initial_delay
=
45
,
pause_time
=
45
)
hold_tone
.
bridge
=
SIPApplication
.
alert_audio_bridge
...
...
@@ -5319,6 +5309,9 @@ class SessionManager(object):
hold_tone
=
Null
else
:
hold_tone
=
Null
self
.
outbound_ringtone
=
outbound_ringtone
self
.
inbound_ringtone
=
inbound_ringtone
self
.
hold_tone
=
hold_tone
def
_process_remote_proposal
(
self
,
blink_session
):
...
...
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