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
f41a747c
Commit
f41a747c
authored
Mar 10, 2014
by
Saul Ibarra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed playing hold tone when switching sessions
parent
4d445f90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
sessions.py
blink/sessions.py
+4
-4
No files found.
blink/sessions.py
View file @
f41a747c
...
@@ -637,13 +637,13 @@ class BlinkSession(QObject):
...
@@ -637,13 +637,13 @@ class BlinkSession(QObject):
if
self
.
sip_session
is
not
None
and
not
self
.
local_hold
:
if
self
.
sip_session
is
not
None
and
not
self
.
local_hold
:
self
.
local_hold
=
True
self
.
local_hold
=
True
self
.
sip_session
.
hold
()
self
.
sip_session
.
hold
()
NotificationCenter
()
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
NotificationCenter
()
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
originator
=
'local'
,
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
def
unhold
(
self
):
def
unhold
(
self
):
if
self
.
sip_session
is
not
None
and
self
.
local_hold
:
if
self
.
sip_session
is
not
None
and
self
.
local_hold
:
self
.
local_hold
=
False
self
.
local_hold
=
False
self
.
sip_session
.
unhold
()
self
.
sip_session
.
unhold
()
NotificationCenter
()
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
NotificationCenter
()
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
originator
=
'local'
,
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
def
send_dtmf
(
self
,
digit
):
def
send_dtmf
(
self
,
digit
):
audio_stream
=
self
.
streams
.
get
(
'audio'
)
audio_stream
=
self
.
streams
.
get
(
'audio'
)
...
@@ -843,7 +843,7 @@ class BlinkSession(QObject):
...
@@ -843,7 +843,7 @@ class BlinkSession(QObject):
def
_NH_SIPSessionDidChangeHoldState
(
self
,
notification
):
def
_NH_SIPSessionDidChangeHoldState
(
self
,
notification
):
if
notification
.
data
.
originator
==
'remote'
:
if
notification
.
data
.
originator
==
'remote'
:
self
.
remote_hold
=
notification
.
data
.
on_hold
self
.
remote_hold
=
notification
.
data
.
on_hold
notification
.
center
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
notification
.
center
.
post_notification
(
'BlinkSessionDidChangeHoldState'
,
sender
=
self
,
data
=
NotificationData
(
originator
=
notification
.
data
.
originator
,
local_hold
=
self
.
local_hold
,
remote_hold
=
self
.
remote_hold
))
def
_NH_SIPSessionNewProposal
(
self
,
notification
):
def
_NH_SIPSessionNewProposal
(
self
,
notification
):
if
self
.
state
not
in
(
'ending'
,
'ended'
,
'deleted'
):
if
self
.
state
not
in
(
'ending'
,
'ended'
,
'deleted'
):
...
@@ -4186,7 +4186,7 @@ class SessionManager(object):
...
@@ -4186,7 +4186,7 @@ class SessionManager(object):
notification
.
sender
.
_play_hangup_tone
=
notification
.
data
.
old_state
in
(
'connecting/*'
,
'connected/*'
)
and
notification
.
sender
.
streams
.
types
.
intersection
({
'audio'
,
'video'
})
notification
.
sender
.
_play_hangup_tone
=
notification
.
data
.
old_state
in
(
'connecting/*'
,
'connected/*'
)
and
notification
.
sender
.
streams
.
types
.
intersection
({
'audio'
,
'video'
})
def
_NH_BlinkSessionDidChangeHoldState
(
self
,
notification
):
def
_NH_BlinkSessionDidChangeHoldState
(
self
,
notification
):
if
notification
.
data
.
remote_hold
and
not
notification
.
data
.
local_hold
:
if
notification
.
sender
is
self
.
active_session
and
notification
.
data
.
originator
==
'remote'
and
notification
.
data
.
remote_hold
and
not
notification
.
data
.
local_hold
:
player
=
WavePlayer
(
SIPApplication
.
voice_audio_bridge
.
mixer
,
Resources
.
get
(
'sounds/hold_tone.wav'
),
loop_count
=
1
,
volume
=
30
)
player
=
WavePlayer
(
SIPApplication
.
voice_audio_bridge
.
mixer
,
Resources
.
get
(
'sounds/hold_tone.wav'
),
loop_count
=
1
,
volume
=
30
)
SIPApplication
.
voice_audio_bridge
.
add
(
player
)
SIPApplication
.
voice_audio_bridge
.
add
(
player
)
player
.
start
()
player
.
start
()
...
...
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