Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
64d32828
Commit
64d32828
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
sipcall: lock when starting/stopping media
Change-Id: Ia12da6f9e58ec0cd0100eaba206e1d9e711ca0e1
parent
dc41bae7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sip/sipcall.cpp
+2
-1
2 additions, 1 deletion
src/sip/sipcall.cpp
src/sip/sipcall.h
+1
-2
1 addition, 2 deletions
src/sip/sipcall.h
with
3 additions
and
3 deletions
src/sip/sipcall.cpp
+
2
−
1
View file @
64d32828
...
@@ -929,7 +929,6 @@ SIPCall::getAudioCodec() const
...
@@ -929,7 +929,6 @@ SIPCall::getAudioCodec() const
void
void
SIPCall
::
startAllMedia
()
SIPCall
::
startAllMedia
()
{
{
std
::
lock_guard
<
std
::
recursive_mutex
>
lock
(
callMutex_
);
if
(
!
transport_
)
return
;
if
(
!
transport_
)
return
;
JAMI_WARN
(
"[call:%s] startAllMedia()"
,
getCallId
().
c_str
());
JAMI_WARN
(
"[call:%s] startAllMedia()"
,
getCallId
().
c_str
());
if
(
isSecure
()
&&
not
transport_
->
isSecure
())
{
if
(
isSecure
()
&&
not
transport_
->
isSecure
())
{
...
@@ -1135,6 +1134,7 @@ SIPCall::onMediaUpdate()
...
@@ -1135,6 +1134,7 @@ SIPCall::onMediaUpdate()
// to a negotiated transport.
// to a negotiated transport.
runOnMainThread
([
w
=
weak
()]
{
runOnMainThread
([
w
=
weak
()]
{
if
(
auto
this_
=
w
.
lock
())
{
if
(
auto
this_
=
w
.
lock
())
{
std
::
lock_guard
<
std
::
recursive_mutex
>
lk
{
this_
->
callMutex_
};
// The call is already ended, so we don't need to restart medias
// The call is already ended, so we don't need to restart medias
if
(
!
this_
->
inv
or
this_
->
inv
->
state
==
PJSIP_INV_STATE_DISCONNECTED
)
return
;
if
(
!
this_
->
inv
or
this_
->
inv
->
state
==
PJSIP_INV_STATE_DISCONNECTED
)
return
;
// If ICE is not used, start medias now
// If ICE is not used, start medias now
...
@@ -1185,6 +1185,7 @@ SIPCall::waitForIceAndStartMedia()
...
@@ -1185,6 +1185,7 @@ SIPCall::waitForIceAndStartMedia()
// Negotiation waiting task
// Negotiation waiting task
Manager
::
instance
().
addTask
([
weak_call
]
{
Manager
::
instance
().
addTask
([
weak_call
]
{
if
(
auto
call
=
weak_call
.
lock
())
{
if
(
auto
call
=
weak_call
.
lock
())
{
std
::
lock_guard
<
std
::
recursive_mutex
>
lk
{
call
->
callMutex_
};
auto
ice
=
call
->
getIceMediaTransport
();
auto
ice
=
call
->
getIceMediaTransport
();
if
(
not
ice
or
ice
->
isFailed
())
{
if
(
not
ice
or
ice
->
isFailed
())
{
...
...
This diff is collapsed.
Click to expand it.
src/sip/sipcall.h
+
1
−
2
View file @
64d32828
...
@@ -222,8 +222,6 @@ public: // NOT SIP RELATED (good candidates to be moved elsewhere)
...
@@ -222,8 +222,6 @@ public: // NOT SIP RELATED (good candidates to be moved elsewhere)
void
generateMediaPorts
();
void
generateMediaPorts
();
void
startAllMedia
();
void
openPortsUPnP
();
void
openPortsUPnP
();
void
setPeerRegistredName
(
const
std
::
string
&
name
)
{
void
setPeerRegistredName
(
const
std
::
string
&
name
)
{
...
@@ -256,6 +254,7 @@ private:
...
@@ -256,6 +254,7 @@ private:
void
waitForIceAndStartMedia
();
void
waitForIceAndStartMedia
();
void
startAllMedia
();
void
stopAllMedia
();
void
stopAllMedia
();
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment