Ring Daemon
Loading...
Searching...
No Matches
jami::Conference Class Reference

#include <conference.h>

Inheritance diagram for jami::Conference:
Inheritance graph
Collaboration diagram for jami::Conference:
Collaboration graph

Public Types

enum class  State : uint8_t { ACTIVE_ATTACHED , ACTIVE_DETACHED , HOLD }
 

Public Member Functions

void addSubCall (const std::string &callId)
 Add a new subcall to the conference.
 
void attachHost (const std::vector< libjami::MediaMap > &mediaList)
 Attach host.
 
 Conference (const std::shared_ptr< Account > &, const std::string &confId="")
 Constructor for this class, increment static counter.
 
std::vector< libjami::MediaMapcurrentMediaList () const
 Retrieve current medias list.
 
void detachHost ()
 Detach local audio/video from the conference.
 
std::shared_ptr< AccountgetAccount () const
 
std::string getAccountId () const
 
std::shared_ptr< CallgetCallFromPeerID (std::string_view peerId)
 
std::vector< std::map< std::string, std::string > > getConferenceInfos () const
 
const std::string & getConfId () const
 Return the conference id.
 
std::chrono::milliseconds getDuration () const
 
std::vector< libjami::MediaMapgetLastMediaList () const
 Return the last media list before the host was detached.
 
State getState () const
 Return the current conference state.
 
const chargetStateStr () const
 
CallIdSet getSubCalls () const
 Get the participant list for this conference.
 
void handleMediaChangeRequest (const std::shared_ptr< Call > &call, const std::vector< libjami::MediaMap > &remoteMediaList)
 Process incoming media change request.
 
void hangupParticipant (const std::string &accountUri, const std::string &deviceId="")
 
bool isMediaSourceMuted (MediaType type) const
 Get the mute state of the local host.
 
bool isRemoteParticipant (const std::string &uri)
 
bool isVideoEnabled () const
 
void mergeConfInfo (ConfInfo &newInfo, const std::string &peerURI)
 
void muteLocalHost (bool is_muted, const std::string &mediaType)
 
void muteParticipant (const std::string &uri, const bool &state)
 
void muteStream (const std::string &accountUri, const std::string &deviceId, const std::string &streamId, const bool &state)
 The client shows one tile per stream (video/audio related to a media)
 
void onConfOrder (const std::string &callId, const std::string &order)
 
void onShutdown (std::function< void(int)> cb)
 Set a callback that will be called when the conference will be destroyed.
 
void removeSubCall (const std::string &callId)
 Remove a subcall from the conference.
 
void reportMediaNegotiationStatus ()
 Announce to the client that medias are successfully negotiated.
 
bool requestMediaChange (const std::vector< libjami::MediaMap > &mediaList)
 Process a media change request.
 
void setActiveParticipant (const std::string &participant_id)
 
void setActiveStream (const std::string &streamId, bool state)
 
void setHandRaised (const std::string &uri, const bool &state)
 
void setLayout (int layout)
 
void setLocalHostMuteState (MediaType type, bool muted)
 Set the mute state of the local host.
 
void setModerator (const std::string &uri, const bool &state)
 
void setState (State state)
 Set conference state.
 
void setVoiceActivity (const std::string &streamId, const bool &newState)
 
bool startRecording (const std::string &path) override
 Start recording.
 
void stopRecording () override
 Stop recording.
 
void switchInput (const std::string &input)
 
bool toggleRecording () override
 Start/stop recording toggle.
 
void updateConferenceInfo (ConfInfo confInfo)
 
void updateMuted ()
 
void updateRecording ()
 
void updateVoiceActivity ()
 
 ~Conference ()
 Destructor for this class, decrement static counter.
 
- Public Member Functions inherited from jami::Recordable
virtual std::string getPath () const
 Return the file path for this recording.
 
bool isAudioOnly () const
 
bool isRecording () const
 Return recording state (true/false)
 
 Recordable ()
 
virtual ~Recordable ()
 

Static Public Member Functions

static constexpr const chargetStateStr (State state)
 Return a string description of the conference state.
 

Additional Inherited Members

- Protected Attributes inherited from jami::Recordable
std::mutex apiMutex_
 
bool isAudioOnly_ {false}
 
std::shared_ptr< MediaRecorderrecorder_
 
bool recording_ {false}
 

Detailed Description

Definition at line 183 of file conference.h.

Member Enumeration Documentation

◆ State

Enumerator
ACTIVE_ATTACHED 
ACTIVE_DETACHED 
HOLD 

Definition at line 186 of file conference.h.

Constructor & Destructor Documentation

◆ Conference()

jami::Conference::Conference ( const std::shared_ptr< Account > &  account,
const std::string &  confId = "" 
)
explicit

Constructor for this class, increment static counter.

Definition at line 50 of file conference.cpp.

References jami::emitSignal(), JAMI_LOG, and jami_tracepoint.

Here is the call graph for this function:

◆ ~Conference()

jami::Conference::~Conference ( )

Destructor for this class, decrement static counter.

Definition at line 247 of file conference.cpp.

References jami::closeMediaPlayer(), jami::emitSignal(), getConfId(), getDuration(), jami::Manager::getVideoManager(), jami::Manager::instance(), jami::Recordable::isRecording(), JAMI_DEBUG, JAMI_LOG, jami_tracepoint, and toggleRecording().

Here is the call graph for this function:

Member Function Documentation

◆ addSubCall()

◆ attachHost()

◆ currentMediaList()

std::vector< std::map< std::string, std::string > > jami::Conference::currentMediaList ( ) const

Retrieve current medias list.

Returns
current medias

Definition at line 354 of file conference.cpp.

References jami::MediaAttribute::mediaAttributesToMediaMaps().

Referenced by detachHost(), handleMediaChangeRequest(), and reportMediaNegotiationStatus().

Here is the call graph for this function:

◆ detachHost()

void jami::Conference::detachHost ( )

Detach local audio/video from the conference.

Definition at line 1075 of file conference.cpp.

References ACTIVE_ATTACHED, ACTIVE_DETACHED, currentMediaList(), getState(), getStateStr(), JAMI_LOG, JAMI_WARNING, and setState().

Referenced by jami::Manager::ManagerPimpl::hangupConference(), and jami::Manager::holdConference().

Here is the call graph for this function:

◆ getAccount()

std::shared_ptr< Account > jami::Conference::getAccount ( ) const
inline

Definition at line 203 of file conference.h.

Referenced by getAccountId(), and jami::Manager::ManagerPimpl::hangupConference().

◆ getAccountId()

std::string jami::Conference::getAccountId ( ) const

Definition at line 1125 of file conference.cpp.

References jami::emitSignal(), and getAccount().

Referenced by jami::Manager::ManagerPimpl::addMainParticipant(), and switchInput().

Here is the call graph for this function:

◆ getCallFromPeerID()

std::shared_ptr< Call > jami::Conference::getCallFromPeerID ( std::string_view  peerId)

Definition at line 1809 of file conference.cpp.

References jami::emitSignal(), and getSubCalls().

Referenced by hangupParticipant(), muteParticipant(), and setActiveParticipant().

Here is the call graph for this function:

◆ getConferenceInfos()

std::vector< std::map< std::string, std::string > > jami::Conference::getConferenceInfos ( ) const
inline

Definition at line 314 of file conference.h.

References jami::emitSignal(), and jami::ConfInfo::toVectorMapStringString().

Here is the call graph for this function:

◆ getConfId()

◆ getDuration()

std::chrono::milliseconds jami::Conference::getDuration ( ) const
inline
Returns
Conference duration in milliseconds

Definition at line 375 of file conference.h.

Referenced by ~Conference().

◆ getLastMediaList()

std::vector< libjami::MediaMap > jami::Conference::getLastMediaList ( ) const
inline

Return the last media list before the host was detached.

Returns
Last media list

Definition at line 366 of file conference.h.

Referenced by jami::Manager::ManagerPimpl::addMainParticipant().

◆ getState()

Conference::State jami::Conference::getState ( ) const

Return the current conference state.

Definition at line 300 of file conference.cpp.

Referenced by jami::Manager::addSubCall(), attachHost(), detachHost(), isMediaSourceMuted(), requestMediaChange(), and jami::Manager::resumeConference().

◆ getStateStr() [1/2]

const char * jami::Conference::getStateStr ( ) const
inline

Definition at line 239 of file conference.h.

References getStateStr().

Referenced by attachHost(), detachHost(), getStateStr(), and setState().

Here is the call graph for this function:

◆ getStateStr() [2/2]

static constexpr const char * jami::Conference::getStateStr ( State  state)
inlinestaticconstexpr

Return a string description of the conference state.

Definition at line 225 of file conference.h.

References ACTIVE_ATTACHED, ACTIVE_DETACHED, and HOLD.

Referenced by jami::Manager::ManagerPimpl::addMainParticipant(), jami::Manager::holdConference(), and jami::Manager::resumeConference().

◆ getSubCalls()

CallIdSet jami::Conference::getSubCalls ( ) const

Get the participant list for this conference.

Definition at line 1101 of file conference.cpp.

References jami::emitSignal().

Referenced by getCallFromPeerID(), jami::Manager::ManagerPimpl::hangupConference(), jami::Manager::resumeConference(), setHandRaised(), and setModerator().

Here is the call graph for this function:

◆ handleMediaChangeRequest()

void jami::Conference::handleMediaChangeRequest ( const std::shared_ptr< Call > &  call,
const std::vector< libjami::MediaMap > &  remoteMediaList 
)

◆ hangupParticipant()

void jami::Conference::hangupParticipant ( const std::string &  accountUri,
const std::string &  deviceId = "" 
)

◆ isMediaSourceMuted()

bool jami::Conference::isMediaSourceMuted ( MediaType  type) const

Get the mute state of the local host.

Definition at line 427 of file conference.cpp.

References ACTIVE_ATTACHED, jami::emitSignal(), getState(), JAMI_ERROR, JAMI_WARNING, jami::MEDIA_AUDIO, jami::MEDIA_NONE, and jami::MEDIA_VIDEO.

Referenced by muteLocalHost(), requestMediaChange(), and updateMuted().

Here is the call graph for this function:

◆ isRemoteParticipant()

bool jami::Conference::isRemoteParticipant ( const std::string &  uri)

◆ isVideoEnabled()

bool jami::Conference::isVideoEnabled ( ) const

Definition at line 1172 of file conference.cpp.

Referenced by muteLocalHost(), and switchInput().

◆ mergeConfInfo()

void jami::Conference::mergeConfInfo ( ConfInfo newInfo,
const std::string &  peerURI 
)

Definition at line 1755 of file conference.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Here is the call graph for this function:

◆ muteLocalHost()

void jami::Conference::muteLocalHost ( bool  is_muted,
const std::string &  mediaType 
)

◆ muteParticipant()

void jami::Conference::muteParticipant ( const std::string &  uri,
const bool state 
)

Definition at line 1488 of file conference.cpp.

References jami::emitSignal(), jami::FALSE_STR, getCallFromPeerID(), jami::string_remove_suffix(), and jami::TRUE_STR.

Here is the call graph for this function:

◆ muteStream()

void jami::Conference::muteStream ( const std::string &  accountUri,
const std::string &  deviceId,
const std::string &  streamId,
const bool state 
)

The client shows one tile per stream (video/audio related to a media)

Note
for now, in conferences we can only mute the audio of a call
Todo:
add a track (audio OR video) parameter to know what we want to mute
Parameters
accountUriAccount of the stream
deviceIdDevice of the stream
streamIdStream to mute
stateTrue to mute, false to unmute

Definition at line 1441 of file conference.cpp.

References jami::emitSignal(), and JAMI_WARNING.

Here is the call graph for this function:

◆ onConfOrder()

void jami::Conference::onConfOrder ( const std::string &  callId,
const std::string &  order 
)

Definition at line 1245 of file conference.cpp.

References jami::emitSignal(), jami::ConfProtocolParser::initData(), JAMI_WARNING, jami::ConfProtocolParser::parse(), and jami::json::parse().

Here is the call graph for this function:

◆ onShutdown()

void jami::Conference::onShutdown ( std::function< void(int)>  cb)
inline

Set a callback that will be called when the conference will be destroyed.

Definition at line 220 of file conference.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ removeSubCall()

void jami::Conference::removeSubCall ( const std::string &  callId)

Remove a subcall from the conference.

Definition at line 815 of file conference.cpp.

References jami::emitSignal(), JAMI_DEBUG, and jami::MEDIA_AUDIO.

Here is the call graph for this function:

◆ reportMediaNegotiationStatus()

void jami::Conference::reportMediaNegotiationStatus ( )

Announce to the client that medias are successfully negotiated.

Definition at line 347 of file conference.cpp.

References currentMediaList(), jami::emitSignal(), getConfId(), and libjami::Media::MediaNegotiationStatusEvents::NEGOTIATION_SUCCESS.

Referenced by requestMediaChange().

Here is the call graph for this function:

◆ requestMediaChange()

◆ setActiveParticipant()

void jami::Conference::setActiveParticipant ( const std::string &  participant_id)

Definition at line 916 of file conference.cpp.

References jami::sip_utils::DEFAULT_VIDEO_STREAMID, jami::emitSignal(), getCallFromPeerID(), and jami::sip_utils::streamId().

Here is the call graph for this function:

◆ setActiveStream()

void jami::Conference::setActiveStream ( const std::string &  streamId,
bool  state 
)

Definition at line 941 of file conference.cpp.

◆ setHandRaised()

void jami::Conference::setHandRaised ( const std::string &  uri,
const bool state 
)

Definition at line 1281 of file conference.cpp.

References jami::emitSignal(), getSubCalls(), and JAMI_WARNING.

Here is the call graph for this function:

◆ setLayout()

void jami::Conference::setLayout ( int  layout)

Definition at line 954 of file conference.cpp.

References jami::emitSignal(), JAMI_ERROR, and jami::ConfInfo::layout.

Here is the call graph for this function:

◆ setLocalHostMuteState()

void jami::Conference::setLocalHostMuteState ( MediaType  type,
bool  muted 
)

Set the mute state of the local host.

Definition at line 418 of file conference.cpp.

References jami::emitSignal().

Referenced by muteLocalHost().

Here is the call graph for this function:

◆ setModerator()

void jami::Conference::setModerator ( const std::string &  uri,
const bool state 
)

Definition at line 1361 of file conference.cpp.

References jami::emitSignal(), getSubCalls(), and JAMI_WARNING.

Here is the call graph for this function:

◆ setState()

void jami::Conference::setState ( State  state)

Set conference state.

Definition at line 306 of file conference.cpp.

References getStateStr(), and JAMI_DEBUG.

Referenced by attachHost(), detachHost(), and jami::Manager::resumeConference().

Here is the call graph for this function:

◆ setVoiceActivity()

void jami::Conference::setVoiceActivity ( const std::string &  streamId,
const bool newState 
)

Definition at line 1322 of file conference.cpp.

References jami::emitSignal(), JAMI_ERROR, and updateVoiceActivity().

Here is the call graph for this function:

◆ startRecording()

bool jami::Conference::startRecording ( const std::string &  path)
overridevirtual

Start recording.

Reimplemented from jami::Recordable.

Definition at line 1853 of file conference.cpp.

References jami::emitSignal(), jami::Recordable::startRecording(), and updateRecording().

Here is the call graph for this function:

◆ stopRecording()

void jami::Conference::stopRecording ( )
overridevirtual

Stop recording.

Reimplemented from jami::Recordable.

Definition at line 1846 of file conference.cpp.

References jami::Recordable::stopRecording(), and updateRecording().

Here is the call graph for this function:

◆ switchInput()

void jami::Conference::switchInput ( const std::string &  input)

Definition at line 1133 of file conference.cpp.

References jami::emitSignal(), getAccountId(), getConfId(), isVideoEnabled(), JAMI_DEBUG, jami::MEDIA_VIDEO, and video.

Here is the call graph for this function:

◆ toggleRecording()

bool jami::Conference::toggleRecording ( )
overridevirtual

Start/stop recording toggle.

Reimplemented from jami::Recordable.

Definition at line 1108 of file conference.cpp.

References jami::emitSignal(), jami::Recordable::isRecording(), jami::Recordable::recorder_, jami::Recordable::toggleRecording(), and updateRecording().

Referenced by addSubCall(), and ~Conference().

Here is the call graph for this function:

◆ updateConferenceInfo()

void jami::Conference::updateConferenceInfo ( ConfInfo  confInfo)

Definition at line 1612 of file conference.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ updateMuted()

void jami::Conference::updateMuted ( )

Definition at line 1532 of file conference.cpp.

References jami::emitSignal(), isMediaSourceMuted(), jami::MEDIA_AUDIO, and jami::string_remove_suffix().

Referenced by muteLocalHost().

Here is the call graph for this function:

◆ updateRecording()

void jami::Conference::updateRecording ( )

Definition at line 1518 of file conference.cpp.

References jami::emitSignal(), jami::Recordable::isRecording(), and jami::string_remove_suffix().

Referenced by startRecording(), stopRecording(), and toggleRecording().

Here is the call graph for this function:

◆ updateVoiceActivity()

void jami::Conference::updateVoiceActivity ( )

Definition at line 1401 of file conference.cpp.

References jami::emitSignal(), and jami::string_remove_suffix().

Referenced by setVoiceActivity().

Here is the call graph for this function:

The documentation for this class was generated from the following files: