reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
SipXLocalParticipant.cxx
Go to the documentation of this file.
1#include "SipXBridgeMixer.hxx"
3#include "Conversation.hxx"
4#include "UserAgent.hxx"
5#include "ReconSubsystem.hxx"
7#include <CpTopologyGraphInterface.h>
8
9#include <rutil/Log.hxx>
10#include <rutil/Logger.hxx>
11
12using namespace recon;
13using namespace resip;
14using namespace std;
15
16#define RESIPROCATE_SUBSYSTEM ReconSubsystem::RECON
17
19 ConversationManager& conversationManager,
20 SipXMediaStackAdapter& sipXMediaStackAdapter)
21: Participant(partHandle, ConversationManager::ParticipantType_Local, conversationManager),
22 LocalParticipant(partHandle, conversationManager),
23 SipXParticipant(partHandle, ConversationManager::ParticipantType_Local, conversationManager, sipXMediaStackAdapter),
24 mLocalPortOnBridge(-1)
25{
26 InfoLog(<< "SipXLocalParticipant created, handle=" << mHandle);
27}
28
30{
31 // Note: Ideally this call would exist in the Participant Base class - but this call requires
32 // dynamic_casts and virtual methods to function correctly during destruction.
33 // If the call is placed in the base Participant class then these things will not
34 // function as desired because a classes type changes as the descructors unwind.
35 // See https://stackoverflow.com/questions/10979250/usage-of-this-in-destructor.
37
38 InfoLog(<< "SipXLocalParticipant destroyed, handle=" << mHandle);
39}
40
41int
43{
44 if(mLocalPortOnBridge == -1)
45 {
47 getMediaInterface()->getInterface()->getResourceInputPortOnBridge(VIRTUAL_NAME_LOCAL_STREAM_OUTPUT,0,mLocalPortOnBridge);
48 InfoLog(<< "SipXLocalParticipant getConnectionPortOnBridge, handle=" << mHandle << ", localPortOnBridge=" << mLocalPortOnBridge);
49 }
50 return mLocalPortOnBridge;
51}
52
53void
54SipXLocalParticipant::addToConversation(Conversation *conversation, unsigned int inputGain, unsigned int outputGain)
55{
56 Participant::addToConversation(conversation, inputGain, outputGain);
57
59 {
60 // The Local participant is in a new Conversation, give that conversation focus
62 getMediaInterface()->getInterface()->giveFocus();
63 }
64}
65
66
67/* ====================================================================
68
69 Copuright (c) 2021, SIP Spectrum, Inc. www.sipspectrum.com
70 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
71 Copyright (c) 2007-2008, Plantronics, Inc.
72 All rights reserved.
73
74 Redistribution and use in source and binary forms, with or without
75 modification, are permitted provided that the following conditions are
76 met:
77
78 1. Redistributions of source code must retain the above copyright
79 notice, this list of conditions and the following disclaimer.
80
81 2. Redistributions in binary form must reproduce the above copyright
82 notice, this list of conditions and the following disclaimer in the
83 documentation and/or other materials provided with the distribution.
84
85 3. Neither the name of Plantronics nor the names of its contributors
86 may be used to endorse or promote products derived from this
87 software without specific prior written permission.
88
89 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
90 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
91 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
92 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
93 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
94 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
95 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
96 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
97 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
98 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
99 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
100
101 ==================================================================== */
#define InfoLog(args_)
Definition Logger.hxx:131
#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.
This class is used to manage membership of participants.
This class represents a local participant.
This is the base class for a RemoteParticipant, LocalParticipant and a MediaResourceParticipant.
virtual void addToConversation(Conversation *conversation, unsigned int inputGain=100, unsigned int outputGain=100)
virtual void unregisterFromAllConversations()
ParticipantHandle mHandle
SipXLocalParticipant(ParticipantHandle partHandle, ConversationManager &conversationManager, SipXMediaStackAdapter &sipXMediaStackAdapter)
virtual void addToConversation(Conversation *conversation, unsigned int inputGain=100, unsigned int outputGain=100)
This class is one of two main classes of concern to an application using the UserAgent library.
MediaInterfaceMode getMediaInterfaceMode() const
This is the base class for a SipXRemoteParticipant, SipXLocalParticipant and a SipXMediaResourceParti...
SipXMediaStackAdapter & mSipXMediaStackAdapter
virtual std::shared_ptr< SipXMediaInterface > getMediaInterface()
unsigned int ParticipantHandle
dcm! – add UnusedChecking(_enum) below;