reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RemoteParticipantDialogSet.hxx
Go to the documentation of this file.
1#if !defined(RemoteParticipantDialogSet_hxx)
2#define RemoteParticipantDialogSet_hxx
3
4#include <map>
5#include <list>
11
14#include "Participant.hxx"
15#include "MediaStreamEvent.hxx"
16
17namespace resip
18{
19class DialogUsageManager;
20class SipMessage;
21}
22
23namespace recon
24{
25class ConversationManager;
26class RemoteParticipant;
27
37{
38public:
41 std::shared_ptr<ConversationProfile> conversationProfile = nullptr);
42
44
47 std::shared_ptr<ConversationProfile> getConversationProfile();
48
50 virtual void setProposedSdp(ParticipantHandle handle, const resip::SdpContents& sdp);
51 virtual std::shared_ptr<resip::SdpContents> getProposedSdp() { return mProposedSdp; }
52 virtual void setUACConnected(const resip::DialogId& dialogId, ParticipantHandle partHandle);
53 virtual bool isUACConnected();
54 virtual bool isStaleFork(const resip::DialogId& dialogId);
55
56 virtual void removeDialog(const resip::DialogId& dialogId);
60
61 // DialogSetHandler
64
65 // Media Stream Processing
66 virtual void processMediaStreamReadyEvent(std::shared_ptr<MediaStreamReadyEvent::StreamParams> streamParams);
67 virtual void processMediaStreamErrorEvent(unsigned int errorCode);
68
69 void sendInvite(std::shared_ptr<resip::SipMessage> invite);
70 void provideOffer(std::unique_ptr<resip::SdpContents> offer, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAccept);
71 void provideAnswer(std::unique_ptr<resip::SdpContents> answer, resip::InviteSessionHandle& inviteSessionHandle, bool postAnswerAccept, bool postAnswerAlert);
75 bool getSecureMediaRequired() { return mSecureMediaRequired; }
76 void setSecureMediaRequired(bool r) { mSecureMediaRequired = r; };
77
78protected:
79 RemoteParticipant* getUACOriginalRemoteParticipant() { return mUACOriginalRemoteParticipant; }
80 virtual std::shared_ptr<resip::UserProfile> selectUASUserProfile(const resip::SipMessage&);
81
82 virtual bool isAsyncMediaSetup() = 0;
83
84 virtual void fixUpSdp(resip::SdpContents* sdp) = 0;
85
86 std::map<resip::DialogId, RemoteParticipant*> mDialogs;
89
90private:
91 RemoteParticipant* mUACOriginalRemoteParticipant;
92 std::list<ConversationHandle> mUACOriginalConversationHandles;
93 unsigned int mNumDialogs;
95 std::shared_ptr<ConversationProfile> mConversationProfile;
96 resip::DialogId mUACConnectedDialogId;
97
98 // SDP Negotiations that may need to be delayed due to media stack binding/allocation
99 std::shared_ptr<resip::SipMessage> mPendingInvite;
100 void doSendInvite(std::shared_ptr<resip::SipMessage> invite);
101 class PendingOfferAnswer
102 {
103 public:
104 PendingOfferAnswer() {}
105 bool mOffer;
106 std::unique_ptr<resip::SdpContents> mSdp;
107 resip::InviteSessionHandle mInviteSessionHandle;
108 bool mPostOfferAnswerAccept;
109 bool mPostAnswerAlert;
110 };
111 PendingOfferAnswer mPendingOfferAnswer;
112 void doProvideOfferAnswer(bool offer, std::unique_ptr<resip::SdpContents> sdp, resip::InviteSessionHandle& inviteSessionHandle, bool postOfferAnswerAccept, bool postAnswerAlert);
113 std::shared_ptr<resip::SdpContents> mProposedSdp; // stored here vs RemoteParticipant, since each forked leg needs access to the original offer
114
115 // Secure Media
117 bool mSecureMediaRequired;
118};
119
120}
121
122#endif
123
124
125/* ====================================================================
126
127 Copyright (c) 2021-2026, SIP Spectrum, Inc. http://www.sipspectrum.com
128 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
129 Copyright (c) 2007-2008, Plantronics, Inc.
130 All rights reserved.
131
132 Redistribution and use in source and binary forms, with or without
133 modification, are permitted provided that the following conditions are
134 met:
135
136 1. Redistributions of source code must retain the above copyright
137 notice, this list of conditions and the following disclaimer.
138
139 2. Redistributions in binary form must reproduce the above copyright
140 notice, this list of conditions and the following disclaimer in the
141 documentation and/or other materials provided with the distribution.
142
143 3. Neither the name of Plantronics nor the names of its contributors
144 may be used to endorse or promote products derived from this
145 software without specific prior written permission.
146
147 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
148 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
149 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
150 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
151 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
152 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
153 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
154 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
155 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
156 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
157 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
158
159 ==================================================================== */
This class is one of two main classes of concern to an application using the UserAgent library.
This class is used by Invite DialogSets.
virtual void endIncludeRelated(ParticipantHandle requestingParticipant)
virtual std::shared_ptr< resip::UserProfile > selectUASUserProfile(const resip::SipMessage &)
virtual std::shared_ptr< resip::SdpContents > getProposedSdp()
virtual void removeDialog(const resip::DialogId &dialogId)
std::shared_ptr< ConversationProfile > getConversationProfile()
void provideOffer(std::unique_ptr< resip::SdpContents > offer, resip::InviteSessionHandle &inviteSessionHandle, bool postOfferAccept)
virtual void setActiveRemoteParticipantHandle(ParticipantHandle handle)
virtual void processMediaStreamErrorEvent(unsigned int errorCode)
virtual void setProposedSdp(ParticipantHandle handle, const resip::SdpContents &sdp)
virtual resip::AppDialog * createAppDialog(const resip::SipMessage &msg)
ConversationProfile::SecureMediaMode getSecureMediaMode()
virtual void onNonDialogCreatingProvisional(resip::AppDialogSetHandle, const resip::SipMessage &msg)
virtual void onTrying(resip::AppDialogSetHandle, const resip::SipMessage &msg)
virtual RemoteParticipant * createUACOriginalRemoteParticipant(ParticipantHandle handle)
virtual void fixUpSdp(resip::SdpContents *sdp)=0
virtual ParticipantHandle getActiveRemoteParticipantHandle()
void sendInvite(std::shared_ptr< resip::SipMessage > invite)
void accept(resip::InviteSessionHandle &inviteSessionHandle)
virtual bool isStaleFork(const resip::DialogId &dialogId)
std::map< resip::DialogId, RemoteParticipant * > mDialogs
void setSecureMediaMode(ConversationProfile::SecureMediaMode m)
virtual void setUACConnected(const resip::DialogId &dialogId, ParticipantHandle partHandle)
void provideAnswer(std::unique_ptr< resip::SdpContents > answer, resip::InviteSessionHandle &inviteSessionHandle, bool postAnswerAccept, bool postAnswerAlert)
virtual void processMediaStreamReadyEvent(std::shared_ptr< MediaStreamReadyEvent::StreamParams > streamParams)
virtual ConversationManager::ParticipantForkSelectMode getForkSelectMode()
This class represent a remote participant.
Provides an interface to process and generate SDP bodies (MIME content-type application/sdp).
Represents a SIP message.
unsigned int ParticipantHandle
dcm! – add UnusedChecking(_enum) below;
void list()
Definition userAdmin.cxx:66