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
8080eec2
Commit
8080eec2
authored
Nov 15, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conference: simplify recording state
Change-Id: Ic039e51cfa392e916a47ca17a3600b94c11f31be
parent
27ff1df9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
72 deletions
+26
-72
src/conference.h
src/conference.h
+2
-10
src/manager.cpp
src/manager.cpp
+24
-62
No files found.
src/conference.h
View file @
8080eec2
...
...
@@ -2,6 +2,7 @@
* Copyright (C) 2004-2019 Savoir-faire Linux Inc.
*
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
* Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -45,10 +46,7 @@ public:
enum
class
State
{
ACTIVE_ATTACHED
,
ACTIVE_DETACHED
,
ACTIVE_ATTACHED_REC
,
ACTIVE_DETACHED_REC
,
HOLD
,
HOLD_REC
HOLD
};
/**
...
...
@@ -85,14 +83,8 @@ public:
return
"ACTIVE_ATTACHED"
;
case
State
::
ACTIVE_DETACHED
:
return
"ACTIVE_DETACHED"
;
case
State
::
ACTIVE_ATTACHED_REC
:
return
"ACTIVE_ATTACHED_REC"
;
case
State
::
ACTIVE_DETACHED_REC
:
return
"ACTIVE_DETACHED_REC"
;
case
State
::
HOLD
:
return
"HOLD"
;
case
State
::
HOLD_REC
:
return
"HOLD_REC"
;
default:
return
""
;
}
...
...
src/manager.cpp
View file @
8080eec2
...
...
@@ -1234,52 +1234,30 @@ Manager::getConferenceFromID(const std::string& confID) const
bool
Manager
::
holdConference
(
const
std
::
string
&
id
)
{
auto
conf
=
getConferenceFromID
(
id
);
if
(
not
conf
)
return
false
;
bool
isRec
=
conf
->
getState
()
==
Conference
::
State
::
ACTIVE_ATTACHED_REC
or
conf
->
getState
()
==
Conference
::
State
::
ACTIVE_DETACHED_REC
or
conf
->
getState
()
==
Conference
::
State
::
HOLD_REC
;
if
(
auto
conf
=
getConferenceFromID
(
id
))
{
for
(
const
auto
&
item
:
conf
->
getParticipantList
())
onHoldCall
(
item
);
for
(
const
auto
&
item
:
conf
->
getParticipantList
())
{
pimpl_
->
switchCall
(
getCallFromCallID
(
item
));
onHoldCall
(
item
)
;
conf
->
setState
(
Conference
::
State
::
HOLD
);
emitSignal
<
DRing
::
CallSignal
::
ConferenceChanged
>
(
conf
->
getConfID
(),
conf
->
getStateStr
(
));
return
true
;
}
conf
->
setState
(
isRec
?
Conference
::
State
::
HOLD_REC
:
Conference
::
State
::
HOLD
);
emitSignal
<
DRing
::
CallSignal
::
ConferenceChanged
>
(
conf
->
getConfID
(),
conf
->
getStateStr
());
return
true
;
return
false
;
}
bool
Manager
::
unHoldConference
(
const
std
::
string
&
id
)
{
auto
conf
=
getConferenceFromID
(
id
);
if
(
not
conf
)
return
false
;
bool
isRec
=
conf
->
getState
()
==
Conference
::
State
::
ACTIVE_ATTACHED_REC
or
conf
->
getState
()
==
Conference
::
State
::
ACTIVE_DETACHED_REC
or
conf
->
getState
()
==
Conference
::
State
::
HOLD_REC
;
for
(
const
auto
&
item
:
conf
->
getParticipantList
())
{
if
(
auto
call
=
getCallFromCallID
(
item
))
{
// if one call is currently recording, the conference is in state recording
isRec
|=
call
->
isRecording
();
pimpl_
->
switchCall
(
call
);
if
(
auto
conf
=
getConferenceFromID
(
id
))
{
for
(
const
auto
&
item
:
conf
->
getParticipantList
())
offHoldCall
(
item
);
}
pimpl_
->
switchCall
(
id
);
conf
->
setState
(
Conference
::
State
::
ACTIVE_ATTACHED
);
emitSignal
<
DRing
::
CallSignal
::
ConferenceChanged
>
(
conf
->
getConfID
(),
conf
->
getStateStr
());
return
true
;
}
conf
->
setState
(
isRec
?
Conference
::
State
::
ACTIVE_ATTACHED_REC
:
Conference
::
State
::
ACTIVE_ATTACHED
);
emitSignal
<
DRing
::
CallSignal
::
ConferenceChanged
>
(
conf
->
getConfID
(),
conf
->
getStateStr
());
return
true
;
return
false
;
}
bool
...
...
@@ -1351,8 +1329,6 @@ Manager::ManagerPimpl::addMainParticipant(Conference& conf)
if
(
conf
.
getState
()
==
Conference
::
State
::
ACTIVE_DETACHED
)
conf
.
setState
(
Conference
::
State
::
ACTIVE_ATTACHED
);
else
if
(
conf
.
getState
()
==
Conference
::
State
::
ACTIVE_DETACHED_REC
)
conf
.
setState
(
Conference
::
State
::
ACTIVE_ATTACHED_REC
);
else
JAMI_WARN
(
"Invalid conference state %d while adding main participant"
,
(
int
)
conf
.
getState
());
...
...
@@ -1465,9 +1441,6 @@ Manager::detachLocalParticipant()
case
Conference
::
State
::
ACTIVE_ATTACHED
:
conf
->
setState
(
Conference
::
State
::
ACTIVE_DETACHED
);
break
;
case
Conference
::
State
::
ACTIVE_ATTACHED_REC
:
conf
->
setState
(
Conference
::
State
::
ACTIVE_DETACHED_REC
);
break
;
default:
JAMI_WARN
(
"Undefined behavior, invalid conference state in detach participant"
);
}
...
...
@@ -2284,28 +2257,16 @@ bool
Manager
::
toggleRecordingCall
(
const
std
::
string
&
id
)
{
std
::
shared_ptr
<
Recordable
>
rec
;
ConferenceMap
::
const_iterator
it
(
pimpl_
->
conferenceMap_
.
find
(
id
));
if
(
it
==
pimpl_
->
conferenceMap_
.
end
())
{
if
(
auto
conf
=
getConferenceFromID
(
id
))
{
JAMI_DBG
(
"toggle recording for conference %s"
,
id
.
c_str
());
rec
=
conf
;
}
else
if
(
auto
call
=
getCallFromCallID
(
id
))
{
JAMI_DBG
(
"toggle recording for call %s"
,
id
.
c_str
());
rec
=
getCallFromCallID
(
id
)
;
rec
=
call
;
}
else
{
JAMI_DBG
(
"toggle recording for conference %s"
,
id
.
c_str
());
auto
conf
=
it
->
second
;
if
(
conf
)
{
rec
=
conf
;
if
(
conf
->
isRecording
())
conf
->
setState
(
Conference
::
State
::
ACTIVE_ATTACHED
);
else
conf
->
setState
(
Conference
::
State
::
ACTIVE_ATTACHED_REC
);
}
}
if
(
!
rec
)
{
JAMI_ERR
(
"Could not find recordable instance %s"
,
id
.
c_str
());
return
false
;
}
const
bool
result
=
rec
->
toggleRecording
();
emitSignal
<
DRing
::
CallSignal
::
RecordPlaybackFilepath
>
(
id
,
rec
->
getPath
());
emitSignal
<
DRing
::
CallSignal
::
RecordingStateChanged
>
(
id
,
result
);
...
...
@@ -2829,9 +2790,10 @@ std::map<std::string, std::string>
Manager
::
getConferenceDetails
(
const
std
::
string
&
confID
)
const
{
if
(
auto
conf
=
getConferenceFromID
(
confID
))
return
{{
"CONFID"
,
confID
},
{
"CONF_STATE"
,
conf
->
getStateStr
()},
{
"VIDEO_SOURCE"
,
conf
->
getVideoInput
()}};
return
{{
"ID"
,
confID
},
{
"STATE"
,
conf
->
getStateStr
()},
{
"VIDEO_SOURCE"
,
conf
->
getVideoInput
()},
{
"RECORDING"
,
conf
->
isRecording
()
?
TRUE_STR
:
FALSE_STR
}};
return
{};
}
...
...
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