reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
PresenceServer.cxx
Go to the documentation of this file.
5#include <rutil/Logger.hxx>
7
8using namespace resip;
9using namespace repro;
10
11#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
12
13PresenceServer::PresenceServer(DialogUsageManager& dum, resip::Dispatcher* userDispatcher, bool presenceUsesRegistrationState,
14 bool PresenceNotifyClosedStateForNonPublishedUsers) :
15 mDum(dum),
16 mPresenceSubscriptionHandler(dum, userDispatcher, presenceUsesRegistrationState, PresenceNotifyClosedStateForNonPublishedUsers),
17 mPresencePublicationHandler(dum)
18{
19 MasterProfile& profile = *mDum.getMasterProfile();
20 profile.addSupportedMethod(PUBLISH);
21 profile.addSupportedMethod(SUBSCRIBE);
22 //profile.validateAcceptEnabled() = true; // !slg! this causes Accept validation for registration requests as well, which is not really desired
23 profile.validateContentEnabled() = true;
26
27 mDum.addServerSubscriptionHandler(Symbols::Presence, &mPresenceSubscriptionHandler);
28 mDum.addServerPublicationHandler(Symbols::Presence, &mPresencePublicationHandler);
29}
30
34
35/* ====================================================================
36*
37* Copyright (c) 2015 SIP Spectrum, Inc. All rights reserved.
38*
39* Redistribution and use in source and binary forms, with or without
40* modification, are permitted provided that the following conditions
41* are met:
42*
43* 1. Redistributions of source code must retain the above copyright
44* notice, this list of conditions and the following disclaimer.
45*
46* 2. Redistributions in binary form must reproduce the above copyright
47* notice, this list of conditions and the following disclaimer in
48* the documentation and/or other materials provided with the
49* distribution.
50*
51* 3. Neither the name of the author(s) nor the names of any contributors
52* may be used to endorse or promote products derived from this software
53* without specific prior written permission.
54*
55* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
56* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
58* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
59* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
60* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
61* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
62* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
63* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
64* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65* SUCH DAMAGE.
66*
67* ====================================================================
68*
69*/
70/*
71* vi: set shiftwidth=3 expandtab:
72*/
PresenceServer(resip::DialogUsageManager &dum, resip::Dispatcher *userDispatcher, bool presenceUsesRegistrationState, bool presenceNotifyClosedStateForNonPublishedUsers)
void addServerPublicationHandler(const Data &eventType, ServerPublicationHandler *)
void addServerSubscriptionHandler(const Data &eventType, ServerSubscriptionHandler *)
std::shared_ptr< MasterProfile > & getMasterProfile()
A generic thread-bank class.
static const Mime & getStaticType()
virtual void addSupportedMimeType(const MethodTypes &method, const Mime &mimeType)
Default is application/sdp for INVITE, OPTIONS, PRACK and UPDATE Methods.
virtual bool & validateContentEnabled() noexcept
enable/disable content validation
virtual void addSupportedMethod(const MethodTypes &method)
Defaults are: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE.
static const char * Presence
Definition Symbols.hxx:103
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;