reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
SubscriptionCreator.cxx
Go to the documentation of this file.
3
4#include <utility>
5
6using namespace resip;
7
9 const NameAddr& target,
10 std::shared_ptr<UserProfile> userProfile,
11 const Data& event,
12 uint32_t subscriptionTime)
13 : BaseCreator(dum, userProfile),
14 mRefreshInterval(-1)
15{
16 makeInitialRequest(target, SUBSCRIBE);
17
18 mLastRequest->header(h_Event).value() = event;
19 mLastRequest->header(h_Expires).value() = subscriptionTime;
20}
21
23 const NameAddr& target,
24 std::shared_ptr<UserProfile> userProfile,
25 const Data& event,
26 uint32_t subscriptionTime,
27 int refreshInterval)
28 : BaseCreator(dum, userProfile),
29 mRefreshInterval(refreshInterval)
30{
31 makeInitialRequest(target, SUBSCRIBE);
32
33 mLastRequest->header(h_Event).value() = event;
34 mLastRequest->header(h_Expires).value() = subscriptionTime;
35}
36
38 const NameAddr& target,
39 std::shared_ptr<UserProfile> userProfile,
40 const H_ReferTo::Type& referTo)
41 : BaseCreator(dum, userProfile),
42 mRefreshInterval(-1)
43{
44 makeInitialRequest(target, REFER);
45 mLastRequest->header(h_ReferTo) = referTo;
46 mLastRequest->header(h_Event).value() = "refer";
47}
48
49bool
51{
52 return mRefreshInterval > 0;
53}
54
55int
57{
58 return mRefreshInterval;
59}
60
61
62/* ====================================================================
63 * The Vovida Software License, Version 1.0
64 *
65 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
66 *
67 * Redistribution and use in source and binary forms, with or without
68 * modification, are permitted provided that the following conditions
69 * are met:
70 *
71 * 1. Redistributions of source code must retain the above copyright
72 * notice, this list of conditions and the following disclaimer.
73 *
74 * 2. Redistributions in binary form must reproduce the above copyright
75 * notice, this list of conditions and the following disclaimer in
76 * the documentation and/or other materials provided with the
77 * distribution.
78 *
79 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
80 * and "Vovida Open Communication Application Library (VOCAL)" must
81 * not be used to endorse or promote products derived from this
82 * software without prior written permission. For written
83 * permission, please contact vocal@vovida.org.
84 *
85 * 4. Products derived from this software may not be called "VOCAL", nor
86 * may "VOCAL" appear in their name, without prior written
87 * permission of Vovida Networks, Inc.
88 *
89 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
90 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
91 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
92 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
93 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
94 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
95 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
96 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
97 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
98 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
99 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
100 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
101 * DAMAGE.
102 *
103 * ====================================================================
104 *
105 * This software consists of voluntary contributions made by Vovida
106 * Networks, Inc. and many individuals on behalf of Vovida Networks,
107 * Inc. For more information on Vovida Networks, Inc., please see
108 * <http://www.vovida.org/>.
109 *
110 */
void makeInitialRequest(const NameAddr &target, MethodTypes method)
std::shared_ptr< SipMessage > mLastRequest
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
bool hasRefreshInterval() const noexcept
SubscriptionCreator(DialogUsageManager &dum, const NameAddr &target, std::shared_ptr< UserProfile > userProfile, const Data &event, uint32_t subscriptionTime)
int getRefreshInterval() const noexcept
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition Stun.hxx:34