Ring Daemon 16.0.0
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 { 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
 
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 188 of file conference.h.

Member Enumeration Documentation

◆ State

Enumerator
ACTIVE_ATTACHED 
ACTIVE_DETACHED 
HOLD 

Definition at line 191 of file conference.h.

Constructor & Destructor Documentation

◆ Conference()

◆ ~Conference()

jami::Conference::~Conference ( )

Destructor for this class, decrement static counter.

Definition at line 235 of file conference.cpp.

References jami::closeMediaPlayer(), jami::emitSignal(), getConfId(), getDuration(), jami::Manager::getVideoManager(), jami::Manager::instance(), jami::Recordable::isRecording(), JAMI_DEBUG, JAMI_INFO, 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 357 of file conference.cpp.

References jami::MediaAttribute::mediaAttributesToMediaMaps().

Referenced by 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 954 of file conference.cpp.

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

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

Here is the call graph for this function:

◆ getAccount()

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

Definition at line 209 of file conference.h.

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

◆ getAccountId()

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

Definition at line 1002 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 1707 of file conference.cpp.

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

Referenced by Conference(), 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 320 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().

◆ getState()

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

Return the current conference state.

Definition at line 294 of file conference.cpp.

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

◆ getStateStr() [1/2]

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

Definition at line 245 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 231 of file conference.h.

References ACTIVE_ATTACHED, ACTIVE_DETACHED, and HOLD.

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

◆ getSubCalls()

CallIdSet jami::Conference::getSubCalls ( ) const

Get the participant list for this conference.

Definition at line 978 of file conference.cpp.

References jami::emitSignal().

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

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 435 of file conference.cpp.

References ACTIVE_ATTACHED, jami::emitSignal(), getState(), JAMI_ERR, JAMI_WARN, 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 1053 of file conference.cpp.

Referenced by muteLocalHost(), and switchInput().

◆ mergeConfInfo()

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

Definition at line 1656 of file conference.cpp.

References jami::emitSignal(), JAMI_DBG, and JAMI_WARN.

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 1382 of file conference.cpp.

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

Referenced by Conference().

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 1328 of file conference.cpp.

References jami::emitSignal(), and JAMI_WARN.

Referenced by Conference().

Here is the call graph for this function:

◆ onConfOrder()

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

Definition at line 1126 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 226 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 756 of file conference.cpp.

References jami::emitSignal(), getConfId(), 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 348 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 789 of file conference.cpp.

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

Referenced by Conference().

Here is the call graph for this function:

◆ setActiveStream()

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

Definition at line 816 of file conference.cpp.

Referenced by Conference().

◆ setHandRaised()

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

Definition at line 1162 of file conference.cpp.

References jami::emitSignal(), getSubCalls(), JAMI_DBG, JAMI_DEBUG, and JAMI_WARN.

Referenced by Conference().

Here is the call graph for this function:

◆ setLayout()

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

Definition at line 829 of file conference.cpp.

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

Referenced by Conference().

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 427 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 1246 of file conference.cpp.

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

Here is the call graph for this function:

◆ setState()

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

Set conference state.

Definition at line 300 of file conference.cpp.

References getStateStr(), and JAMI_DEBUG.

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

Here is the call graph for this function:

◆ setVoiceActivity()

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

Definition at line 1207 of file conference.cpp.

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

Referenced by Conference().

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 1751 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 1744 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 1010 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 985 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 1508 of file conference.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ updateMuted()

void jami::Conference::updateMuted ( )

Definition at line 1427 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 1412 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 1288 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: