21#define RESIPROCATE_SUBSYSTEM ReconSubsystem::RECON
27#define MAX_PARTICIPANTS 2
36 mLibWebRTCMediaStackAdapter(libwebrtcMediaStackAdapter),
37 mLibWebRTCReInviteOnParticipantsPresent(true)
59 std::shared_ptr<ConfigParse> cfg =
getConfig();
62 mLibWebRTCReInviteOnParticipantsPresent = cfg->getConfigBool(
"LibWebRTCReInviteOnParticipantsPresent",
63 mLibWebRTCReInviteOnParticipantsPresent);
85 std::shared_ptr<libwebrtc::BaseRtpEndpoint> answeredEndpoint = _p->
getEndpoint();
88 DebugLog(<<
"we are first in the conversation");
97 DebugLog(<<
"joining a Conversation with an existing Participant");
101 ErrLog(<<
"our endpoint is not initialized");
106 DebugLog(<<
"the local endpoint is not yet in a valid state");
109 DebugLog(<<
"attempting to join two RemoteParticipants");
111 answeredEndpoint->disconnect([
this, _p, answeredEndpoint]{
116 Conversation::ParticipantMap::iterator _it = m.begin();
117 for(;_it != m.end() && krp == 0; _it++)
126 std::shared_ptr<libwebrtc::BaseRtpEndpoint> otherEndpoint = krp->
getEndpoint();
129 otherEndpoint->disconnect([
this, _p, answeredEndpoint, otherEndpoint, krp]{
130 otherEndpoint->connect([
this, _p, answeredEndpoint, otherEndpoint, krp]{
131 answeredEndpoint->connect([
this, _p, answeredEndpoint, otherEndpoint, krp]{
133 if(mLibWebRTCReInviteOnParticipantsPresent)
140 for(
int i = 1000; i <= 5000; i+=1000)
142 std::chrono::milliseconds _i = std::chrono::milliseconds(i);
143 std::chrono::milliseconds __i = std::chrono::milliseconds(i + 500);
151 }, *answeredEndpoint);
155 }, *answeredEndpoint);
161 DebugLog(<<
"onParticipantRemoved, checking for remaining participants");
163 std::shared_ptr<libwebrtc::BaseRtpEndpoint> myEndpoint = _p->
getEndpoint();
166 Conversation::ParticipantMap::iterator _it = m.begin();
167 for(;_it != m.end() && krp == 0; _it++)
177 DebugLog(<<
"remaining participant found");
178 std::shared_ptr<libwebrtc::BaseRtpEndpoint> otherEndpoint = krp->
getEndpoint();
179 otherEndpoint->disconnect([
this, krp, myEndpoint, otherEndpoint](){
180 myEndpoint->disconnect([
this, krp](){
#define WarningLog(args_)
#define resip_assert(x)
This file needs to work for both C and C++ code.
This class is one of two main classes of concern to an application using the UserAgent library.
virtual void requestKeyframeFromPeer(ParticipantHandle partHandle, std::chrono::duration< double > durationMs)
virtual void requestKeyframe(ParticipantHandle partHandle, std::chrono::duration< double > durationMs)
This class is used to manage membership of participants.
ParticipantMap & getParticipants()
unsigned int getNumRemoteParticipants()
std::shared_ptr< resip::ConfigParse > getConfig()
virtual ConversationManager & getConversationManager()
std::shared_ptr< BridgeMixer > getBridgeMixerShared()
ConversationHandle getHandle()
virtual bool isSharingMediaInterfaceWithAnotherConversation()
std::map< ParticipantHandle, ConversationParticipantAssignment > ParticipantMap
virtual ~LibWebRTCConversation()
virtual void onParticipantRemoved(Participant *participant)
virtual void confirmParticipant(Participant *participant)
LibWebRTCConversation(ConversationHandle handle, ConversationManager &conversationManager, LibWebRTCMediaStackAdapter &libwebrtcMediaStackAdapter, RelatedConversationSet *relatedConversationSet, ConversationHandle sharedMediaInterfaceConvHandle, ConversationManager::AutoHoldMode autoHoldMode)
virtual void onParticipantAdded(Participant *participant)
This class represent a remote participant.
virtual std::shared_ptr< libwebrtc::MediaElement > getWaitingModeElement()
virtual std::shared_ptr< libwebrtc::BaseRtpEndpoint > getEndpoint()
virtual void waitingMode()
This is the base class for a RemoteParticipant, LocalParticipant and a MediaResourceParticipant.
virtual ParticipantHandle getParticipantHandle()
unsigned int ConversationHandle
unsigned int ParticipantHandle
dcm! – add UnusedChecking(_enum) below;