reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
UserAgentDialogSetFactory.cxx
Go to the documentation of this file.
2#include "ReconSubsystem.hxx"
8
9#include <rutil/Log.hxx>
10#include <rutil/Logger.hxx>
14
15#define RESIPROCATE_SUBSYSTEM ReconSubsystem::RECON
16
17using namespace recon;
18using namespace resip;
19using namespace std;
20
21
23 mConversationManager(conversationManager)
24{
25}
26
29 const SipMessage& msg)
30{
31 switch(msg.method())
32 {
33 case INVITE:
34 {
35 SdpContents* sdp = dynamic_cast<SdpContents*>(msg.getContents());
36 if (sdp)
37 {
38 for (auto it = sdp->session().media().begin(); it != sdp->session().media().end(); it++)
39 {
40 if (it->name() == "message")
41 {
42 // If there is a message media line, then we assume no audio/video are present and we create an RemoteIMSessionParticipantDialogSet
43 return mConversationManager.createRemoteIMSessionParticipantDialogSetInstance();
44 }
45 }
46 }
48 break;
49 }
50 default:
51 return new DefaultDialogSet(mConversationManager);
52 break;
53 }
54}
55
56
57/* ====================================================================
58
59 Copyright (c) 2021-2022, SIP Spectrum, Inc. http://www.sipspectrum.com
60 Copyright (c) 2007-2008, Plantronics, Inc.
61 All rights reserved.
62
63 Redistribution and use in source and binary forms, with or without
64 modification, are permitted provided that the following conditions are
65 met:
66
67 1. Redistributions of source code must retain the above copyright
68 notice, this list of conditions and the following disclaimer.
69
70 2. Redistributions in binary form must reproduce the above copyright
71 notice, this list of conditions and the following disclaimer in the
72 documentation and/or other materials provided with the distribution.
73
74 3. Neither the name of Plantronics nor the names of its contributors
75 may be used to endorse or promote products derived from this
76 software without specific prior written permission.
77
78 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
79 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
80 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
81 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
82 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
83 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
84 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
88 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89
90 ==================================================================== */
This class is one of two main classes of concern to an application using the UserAgent library.
MediaStackAdapter & getMediaStackAdapter()
virtual RemoteParticipantDialogSet * createRemoteIMSessionParticipantDialogSetInstance(ConversationManager::ParticipantForkSelectMode forkSelectMode=ConversationManager::ForkSelectAutomatic, std::shared_ptr< ConversationProfile > conversationProfile=nullptr)
This class is used by non-Invite DialogSets.
virtual RemoteParticipantDialogSet * createRemoteParticipantDialogSetInstance(ConversationManager::ParticipantForkSelectMode forkSelectMode=ConversationManager::ForkSelectAutomatic, std::shared_ptr< ConversationProfile > conversationProfile=nullptr)=0
resip::AppDialogSet * createAppDialogSet(resip::DialogUsageManager &, const resip::SipMessage &)
UserAgentDialogSetFactory(ConversationManager &conversationManager)
const MediumContainer & media() const
return session Media lines
Provides an interface to process and generate SDP bodies (MIME content-type application/sdp).
Session & session()
get the parsed SDP
Represents a SIP message.
Contents * getContents() const
Retrieves the body of a SIP message.
resip::MethodTypes method() const
returns the method type of the message
dcm! – add UnusedChecking(_enum) below;