Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
d623c210
Commit
d623c210
authored
May 30, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sipcall: check ice for null, cleanup
Change-Id: Ia6a43fe3650762b0b8cf1185aaac6cf582b55b8b
parent
2251dbd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
src/sip/sipcall.cpp
src/sip/sipcall.cpp
+15
-15
No files found.
src/sip/sipcall.cpp
View file @
d623c210
...
...
@@ -740,14 +740,15 @@ SIPCall::removeCall()
void
SIPCall
::
onFailure
(
signed
cause
)
{
setState
(
CallState
::
MERROR
,
ConnectionState
::
DISCONNECTED
,
cause
);
runOnMainThread
([
w
=
std
::
weak_ptr
<
Call
>
(
shared_from_this
())]
{
if
(
auto
shared
=
w
.
lock
())
{
auto
&
call
=
*
shared
;
Manager
::
instance
().
callFailure
(
call
);
call
.
removeCall
();
}
});
if
(
setState
(
CallState
::
MERROR
,
ConnectionState
::
DISCONNECTED
,
cause
))
{
runOnMainThread
([
w
=
weak
()]
{
if
(
auto
shared
=
w
.
lock
())
{
auto
&
call
=
*
shared
;
Manager
::
instance
().
callFailure
(
call
);
call
.
removeCall
();
}
});
}
}
void
...
...
@@ -758,7 +759,7 @@ SIPCall::onBusyHere()
else
setState
(
CallState
::
BUSY
,
ConnectionState
::
DISCONNECTED
);
runOnMainThread
([
w
=
std
::
weak_ptr
<
Call
>
(
shared_from_this
()
)]
{
runOnMainThread
([
w
=
weak
(
)]
{
if
(
auto
shared
=
w
.
lock
())
{
auto
&
call
=
*
shared
;
Manager
::
instance
().
callBusy
(
call
);
...
...
@@ -770,7 +771,7 @@ SIPCall::onBusyHere()
void
SIPCall
::
onClosed
()
{
runOnMainThread
([
w
=
std
::
weak_ptr
<
Call
>
(
shared_from_this
()
)]
{
runOnMainThread
([
w
=
weak
(
)]
{
if
(
auto
shared
=
w
.
lock
())
{
auto
&
call
=
*
shared
;
Manager
::
instance
().
peerHungupCall
(
call
);
...
...
@@ -787,7 +788,7 @@ SIPCall::onAnswered()
if
(
getConnectionState
()
!=
ConnectionState
::
CONNECTED
)
{
setState
(
CallState
::
ACTIVE
,
ConnectionState
::
CONNECTED
);
if
(
not
isSubcall
())
{
runOnMainThread
([
w
=
std
::
weak_ptr
<
Call
>
(
shared_from_this
()
)]
{
runOnMainThread
([
w
=
weak
(
)]
{
if
(
auto
shared
=
w
.
lock
())
{
Manager
::
instance
().
peerAnsweredCall
(
*
shared
);
}
...
...
@@ -1093,13 +1094,12 @@ void
SIPCall
::
waitForIceAndStartMedia
()
{
// Initialization waiting task
auto
weak_call
=
std
::
weak_ptr
<
SIPCall
>
(
std
::
static_pointer_cast
<
SIPCall
>
(
shared_from_this
()));
Manager
::
instance
().
addTask
([
weak_call
]
{
Manager
::
instance
().
addTask
([
weak_call
=
weak
()]
{
// TODO: polling algo, to it by event
if
(
auto
call
=
weak_call
.
lock
())
{
auto
ice
=
call
->
getIceMediaTransport
();
if
(
ice
->
isFailed
())
{
if
(
not
ice
or
ice
->
isFailed
())
{
JAMI_ERR
(
"[call:%s] Media ICE init failed"
,
call
->
getCallId
().
c_str
());
call
->
onFailure
(
EIO
);
return
false
;
...
...
@@ -1126,7 +1126,7 @@ SIPCall::waitForIceAndStartMedia()
if
(
auto
call
=
weak_call
.
lock
())
{
auto
ice
=
call
->
getIceMediaTransport
();
if
(
ice
->
isFailed
())
{
if
(
not
ice
or
ice
->
isFailed
())
{
JAMI_ERR
(
"[call:%s] Media ICE negotiation failed"
,
call
->
getCallId
().
c_str
());
call
->
onFailure
(
EIO
);
return
false
;
...
...
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