reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Conversation.hxx
Go to the documentation of this file.
1#if !defined(Conversation_hxx)
2#define Conversation_hxx
3
6
7namespace recon
8{
9class Participant;
10class LocalParticipant;
11class RemoteParticipant;
12class RelatedConversationSet;
13class BridgeMixer;
14
32{
33protected:
36 RelatedConversationSet* relatedConversationSet, // Pass NULL to create new RelatedConversationSet
39 unsigned int maxParticipants = 0);
42public:
43 virtual ~Conversation();
44
45 void addParticipant(Participant* participant, unsigned int inputGain = 100, unsigned int outputGain = 100);
48
49 unsigned int getNumLocalParticipants() { return mNumLocalParticipants; }
50 unsigned int getNumRemoteParticipants() { return mNumRemoteParticipants; }
51 unsigned int getNumRemoteIMParticipants() { return mNumRemoteIMParticipants; }
52 unsigned int getNumMediaParticipants() { return mNumMediaParticipants; }
53 bool shouldHold();
54 bool broadcastOnly();
57
59 void join(Conversation* conversation); // move all non-duplicate participants from this conversation to passed in conversation and destroy this one
60
61 void destroy();
62
63 ConversationHandle getHandle() { return mHandle; }
64 void setMaxParticipants(unsigned int maxParticipants) { mMaxParticipants = maxParticipants; };
65 unsigned int getMaxParticipants() const { return mMaxParticipants; };
66
68
69protected:
70 std::shared_ptr<resip::ConfigParse> getConfig() { return mConversationManager.getConfig(); };
71
72 friend class Participant;
73 friend class SipXParticipant;
74 friend class LocalParticipant;
76 friend class RemoteParticipant;
81 void registerParticipant(Participant *, unsigned int inputGain=100, unsigned int outputGain=100);
83
84 friend class BridgeMixer;
85 friend class SipXBridgeMixer;
86 friend class KurentoBridgeMixer;
87 friend class GstBridgeMixer;
89 typedef std::map<ParticipantHandle, ConversationParticipantAssignment> ParticipantMap;
90 ParticipantMap& getParticipants() { return mParticipants; }
91
92 friend class AddParticipantCmd;
93 friend class JoinConversationCmd;
94 friend class MoveParticipantCmd;
95
96 // sipX Media related members
97 // Note: these are only set here if sipXConversationMediaInterfaceMode is used
98 friend class ConversationManager;
103 BridgeMixer* getBridgeMixer() noexcept { return mBridgeMixer.get(); }
104 std::shared_ptr<BridgeMixer> getBridgeMixerShared() { return mBridgeMixer; }
105 virtual void setBridgeMixer(std::shared_ptr<BridgeMixer> mixer) { mBridgeMixer = mixer; }
106 virtual bool isSharingMediaInterfaceWithAnotherConversation() { return mSharingMediaInterfaceWithAnotherConversation; }
107
108 virtual ConversationManager& getConversationManager() { return mConversationManager; }
109
110
111private:
112 ConversationHandle mHandle;
113 ConversationManager& mConversationManager;
114 RelatedConversationSet *mRelatedConversationSet;
115
116 ParticipantMap mParticipants;
118 bool mDestroying;
119 unsigned int mNumLocalParticipants;
120 unsigned int mNumRemoteParticipants;
121 unsigned int mNumRemoteIMParticipants;
122 unsigned int mNumMediaParticipants;
124 unsigned int mMaxParticipants;
125
126 // sipX Media related members
127 // Note: these are only set here if sipXConversationMediaInterfaceMode is used
128 std::shared_ptr<BridgeMixer> mBridgeMixer;
129 bool mSharingMediaInterfaceWithAnotherConversation;
130};
131
132}
133
134#endif
135
136
137/* ====================================================================
138
139 Copyright (c) 2021, SIP Spectrum, Inc.
140 Copyright (c) 2022, Software Freedom Institute https://softwarefreedom.institute
141 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
142 Copyright (c) 2007-2008, Plantronics, Inc.
143 All rights reserved.
144
145 Redistribution and use in source and binary forms, with or without
146 modification, are permitted provided that the following conditions are
147 met:
148
149 1. Redistributions of source code must retain the above copyright
150 notice, this list of conditions and the following disclaimer.
151
152 2. Redistributions in binary form must reproduce the above copyright
153 notice, this list of conditions and the following disclaimer in the
154 documentation and/or other materials provided with the distribution.
155
156 3. Neither the name of Plantronics nor the names of its contributors
157 may be used to endorse or promote products derived from this
158 software without specific prior written permission.
159
160 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
161 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
162 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
163 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
164 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
165 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
166 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
167 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
168 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
169 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
170 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
171
172 ==================================================================== */
This class is used to control the sipX Bridge Mixer mix matrix.
This class is one of two main classes of concern to an application using the UserAgent library.
std::shared_ptr< resip::ConfigParse > getConfig()
This class is used to manage membership of participants.
ParticipantMap & getParticipants()
unsigned int getNumRemoteParticipants()
unsigned int getNumLocalParticipants()
unsigned int getNumMediaParticipants()
void addParticipant(Participant *participant, unsigned int inputGain=100, unsigned int outputGain=100)
void notifyRemoteParticipantsOfHoldChange()
void removeParticipant(Participant *participant)
std::shared_ptr< resip::ConfigParse > getConfig()
BridgeMixer * getBridgeMixer() noexcept
virtual void setBridgeMixer(std::shared_ptr< BridgeMixer > mixer)
virtual ConversationManager & getConversationManager()
void setMaxParticipants(unsigned int maxParticipants)
void join(Conversation *conversation)
std::shared_ptr< BridgeMixer > getBridgeMixerShared()
virtual void onParticipantAdded(Participant *participant)=0
ConversationHandle getHandle()
unsigned int getMaxParticipants() const
void relayInstantMessageToRemoteParticipants(ParticipantHandle sourceParticipant, const resip::Data &senderDisplayName, const resip::SipMessage &msg)
virtual bool isSharingMediaInterfaceWithAnotherConversation()
void registerParticipant(Participant *, unsigned int inputGain=100, unsigned int outputGain=100)
void unregisterParticipant(Participant *)
std::map< ParticipantHandle, ConversationParticipantAssignment > ParticipantMap
void modifyParticipantContribution(Participant *participant, unsigned int inputGain, unsigned int outputGain)
unsigned int getNumRemoteIMParticipants()
virtual void onParticipantRemoved(Participant *participant)=0
void createRelatedConversation(RemoteParticipant *newForkedParticipant, ParticipantHandle origParticipantHandle)
virtual void confirmParticipant(Participant *participant)
This class is used to control the sipX Bridge Mixer mix matrix.
This class is one of two main classes of concern to an application using the UserAgent library.
This class is used to control the sipX Bridge Mixer mix matrix.
This class is one of two main classes of concern to an application using the UserAgent library.
This class represent a remote participant.
This class is used to control the sipX Bridge Mixer mix matrix.
This class is one of two main classes of concern to an application using the UserAgent library.
This class represents a local participant.
This class represents a media resource participant.
This is the base class for a RemoteParticipant, LocalParticipant and a MediaResourceParticipant.
This is used to keep a mapping between all related conversations.
This class represent a remote participant.
This class is used to control the sipX Bridge Mixer mix matrix.
This class represents a local participant.
This class represents a media resource participant.
This class is one of two main classes of concern to an application using the UserAgent library.
This is the base class for a SipXRemoteParticipant, SipXLocalParticipant and a SipXMediaResourceParti...
This class represent a remote participant.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents a SIP message.
unsigned int ConversationHandle
unsigned int ParticipantHandle
void list()
Definition userAdmin.cxx:66