reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
MediaStackAdapter.hxx
Go to the documentation of this file.
1#if !defined(MediaStackAdapter_hxx)
2#define MediaStackAdapter_hxx
3
4#include "BridgeMixer.hxx"
6
7#include <resip/stack/Uri.hxx>
9
11
13#include "MediaEvent.hxx"
14#include "HandleTypes.hxx"
15
16#include <memory>
17
18namespace resip
19{
20class DialogUsageManager;
21}
22
23namespace recon
24{
25class Conversation;
26class RelatedConversationSet;
27class Participant;
28class UserAgent;
29class ConversationProfile;
30class LocalParticipant;
31class MediaResourceParticipant;
32class RemoteParticipant;
33class RemoteParticipantDialogSet;
34
35
41{
42public:
43
45 virtual ~MediaStackAdapter();
46
48 virtual void shutdown() = 0;
49
51 // Participant methods ///////////////////////////////////////////////
53
61 const std::vector<unsigned int>& codecIds, resip::SdpContents& sessionCaps) = 0;
62
64 // Media Related Methods - this may not be the right spot for these - move to LocalParticipant?
66
68 RelatedConversationSet* relatedConversationSet, // Pass NULL to create new RelatedConversationSet
77 std::shared_ptr<ConversationProfile> conversationProfile = nullptr) = 0;
78
81 virtual bool supportsLocalAudio() = 0;
82
83 virtual void setRTCPEventLoggingHandler(std::shared_ptr<flowmanager::RTCPEventLoggingHandler> h) { mRTCPEventLoggingHandler = h; };
84 virtual std::shared_ptr<flowmanager::RTCPEventLoggingHandler> getRTCPEventLoggingHandler() const { return mRTCPEventLoggingHandler; };
85
86protected:
87 friend class ConversationManager;
88 virtual void setUserAgent(UserAgent *userAgent) = 0;
90 ConversationManager& getConversationManager() { return mConversationManager; };
91 std::shared_ptr<BridgeMixer>& getBridgeMixer() { return getConversationManager().getBridgeMixer(); }
94 void post(resip::Message *message) { getConversationManager().post(message); };
96
97 std::shared_ptr<resip::ConfigParse> getConfig() { return mConversationManager.getConfig(); };
98
99private:
100 ConversationManager& mConversationManager;
101
102 std::shared_ptr<flowmanager::RTCPEventLoggingHandler> mRTCPEventLoggingHandler;
103
104 friend class ConversationManager;
105 /* Called periodically in the event loop to give the MediaStackAdapter
106 the opportunity to do any pending work */
107 virtual void process() = 0;
108
109 friend class UserAgent;
110 virtual void initializeDtlsFactory(const resip::Data& defaultAoR) = 0;
111
113 virtual void outputBridgeMatrixImpl(ConversationHandle convHandle = 0) = 0;
114};
115
116}
117
118#endif
119
120
121/* ====================================================================
122
123 Copyright (c) 2021-2022, SIP Spectrum, Inc. www.sipspectrum.com
124 Copyright (c) 2021-2022, Daniel Pocock https://danielpocock.com
125 Copyright (c) 2021-2022, Software Freedom Institute LLC https://softwarefreedom.institute
126 Copyright (c) 2007-2008, Plantronics, Inc.
127 All rights reserved.
128
129 Redistribution and use in source and binary forms, with or without
130 modification, are permitted provided that the following conditions are
131 met:
132
133 1. Redistributions of source code must retain the above copyright
134 notice, this list of conditions and the following disclaimer.
135
136 2. Redistributions in binary form must reproduce the above copyright
137 notice, this list of conditions and the following disclaimer in the
138 documentation and/or other materials provided with the distribution.
139
140 3. Neither the name of Plantronics nor the names of its contributors
141 may be used to endorse or promote products derived from this
142 software without specific prior written permission.
143
144 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
145 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
146 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
147 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
148 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
149 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
150 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
151 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
152 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
153 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
154 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
155
156 ==================================================================== */
This class is one of two main classes of concern to an application using the UserAgent library.
void post(resip::Message *message)
Conversation * getConversation(ConversationHandle convHandle)
ConversationHandle getNewConversationHandle()
std::shared_ptr< resip::ConfigParse > getConfig()
std::shared_ptr< BridgeMixer > & getBridgeMixer()
This class is used to manage membership of participants.
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.
virtual LocalParticipant * createLocalParticipantInstance(ParticipantHandle partHandle)=0
ConversationManager & getConversationManager()
Conversation * getConversation(ConversationHandle convHandle)
virtual MediaResourceParticipant * createMediaResourceParticipantInstance(ParticipantHandle partHandle, const resip::Uri &mediaUrl, const std::shared_ptr< resip::Data > &playAudioBuffer, void *recordingCircularBuffer)=0
std::shared_ptr< resip::ConfigParse > getConfig()
virtual RemoteParticipant * createRemoteParticipantInstance(resip::DialogUsageManager &dum, RemoteParticipantDialogSet &rpds)=0
virtual RemoteParticipant * createRemoteParticipantInstance(ParticipantHandle partHandle, resip::DialogUsageManager &dum, RemoteParticipantDialogSet &rpds)=0
virtual void conversationManagerReady(ConversationManager *conversationManager)=0
virtual Conversation * createConversationInstance(ConversationHandle handle, RelatedConversationSet *relatedConversationSet, ConversationHandle sharedMediaInterfaceConvHandle, ConversationManager::AutoHoldMode autoHoldMode)=0
virtual bool supportsMultipleMediaInterfaces()=0
virtual bool supportsLocalAudio()=0
virtual std::shared_ptr< flowmanager::RTCPEventLoggingHandler > getRTCPEventLoggingHandler() const
virtual bool canConversationsShareParticipants(Conversation *conversation1, Conversation *conversation2)=0
virtual void buildSessionCapabilities(const resip::Data &ipaddress, const std::vector< unsigned int > &codecIds, resip::SdpContents &sessionCaps)=0
Builds a session capabilties SDPContents based on the passed in ipaddress and codec ordering.
virtual UserAgent * getUserAgent()
virtual void shutdown()=0
ConversationHandle getNewConversationHandle()
std::shared_ptr< BridgeMixer > & getBridgeMixer()
virtual RemoteParticipantDialogSet * createRemoteParticipantDialogSetInstance(ConversationManager::ParticipantForkSelectMode forkSelectMode=ConversationManager::ForkSelectAutomatic, std::shared_ptr< ConversationProfile > conversationProfile=nullptr)=0
virtual void setUserAgent(UserAgent *userAgent)=0
virtual void setRTCPEventLoggingHandler(std::shared_ptr< flowmanager::RTCPEventLoggingHandler > h)
void post(resip::Message *message)
This is used to keep a mapping between all related conversations.
This class is used by Invite DialogSets.
This class represent a remote participant.
This class is one of two main classes of concern to an application using the UserAgent library.
Definition UserAgent.hxx:56
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
The base-class used for message-passing.
Definition Message.hxx:21
Provides an interface to process and generate SDP bodies (MIME content-type application/sdp).
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
unsigned int ConversationHandle
unsigned int ParticipantHandle
dcm! – add UnusedChecking(_enum) below;
void list()
Definition userAdmin.cxx:66