reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
InviteSessionCreator.cxx
Go to the documentation of this file.
8
9#include <utility>
10
11using namespace resip;
12
14 const NameAddr& target,
15 std::shared_ptr<UserProfile> userProfile,
16 const Contents* initial,
18 const Contents* alternative,
20 : BaseCreator(dum, userProfile),
21 mServerSub(serverSub),
22 mEncryptionLevel(level)
23{
24 makeInitialRequest(target, INVITE);
25 if (mUserProfile->isAnonymous())
26 {
27 mLastRequest->header(h_Privacys).push_back(PrivacyCategory(Symbols::id));
28 }
29
31 if(mDum.getMasterProfile()->getSupportedOptionTags().find(Token(Symbols::Timer)))
32 {
34 if(mUserProfile->getDefaultSessionTime() >= 90)
35 {
36 getLastRequest()->header(h_SessionExpires).value() = mUserProfile->getDefaultSessionTime();
37 getLastRequest()->header(h_MinSE).value() = 90; // Absolute minimum specified by RFC4028
38 }
39 }
40
41 std::unique_ptr<Contents> initialOffer;
42 if (initial)
43 {
44 if (alternative)
45 {
47 mac->parts().push_back(alternative->clone());
48 mac->parts().push_back(initial->clone());
49 initialOffer.reset(mac);
50 }
51 else
52 {
53 initialOffer.reset(initial->clone());
54 }
55 getLastRequest()->setContents(std::move(initialOffer));
56 }
57 //100rel
58 switch(mDum.getMasterProfile()->getUacReliableProvisionalMode())
59 {
61 //no support, do nothing
62 break;
65 getLastRequest()->header(h_Supporteds).push_back(Token(Symbols::C100rel));
66 break;
68 getLastRequest()->header(h_Requires).push_back(Token(Symbols::C100rel));
69 break;
70 default:
71 resip_assert(0);
72 }
73}
74
75void
80
81void
83{
84 // !jf! does this have to do with CANCELing all of the branches associated
85 // with a single invite request
86}
87
88const Contents*
93
94
95/* ====================================================================
96 * The Vovida Software License, Version 1.0
97 *
98 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
99 *
100 * Redistribution and use in source and binary forms, with or without
101 * modification, are permitted provided that the following conditions
102 * are met:
103 *
104 * 1. Redistributions of source code must retain the above copyright
105 * notice, this list of conditions and the following disclaimer.
106 *
107 * 2. Redistributions in binary form must reproduce the above copyright
108 * notice, this list of conditions and the following disclaimer in
109 * the documentation and/or other materials provided with the
110 * distribution.
111 *
112 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
113 * and "Vovida Open Communication Application Library (VOCAL)" must
114 * not be used to endorse or promote products derived from this
115 * software without prior written permission. For written
116 * permission, please contact vocal@vovida.org.
117 *
118 * 4. Products derived from this software may not be called "VOCAL", nor
119 * may "VOCAL" appear in their name, without prior written
120 * permission of Vovida Networks, Inc.
121 *
122 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
123 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
125 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
126 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
127 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
128 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
129 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
130 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
131 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
132 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
133 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
134 * DAMAGE.
135 *
136 * ====================================================================
137 *
138 * This software consists of voluntary contributions made by Vovida
139 * Networks, Inc. and many individuals on behalf of Vovida Networks,
140 * Inc. For more information on Vovida Networks, Inc., please see
141 * <http://www.vovida.org/>.
142 *
143 */
#define resip_assert(x)
This file needs to work for both C and C++ code.
void makeInitialRequest(const NameAddr &target, MethodTypes method)
DialogUsageManager & mDum
std::shared_ptr< SipMessage > mLastRequest
std::shared_ptr< UserProfile > mUserProfile
std::shared_ptr< SipMessage > getLastRequest() const noexcept
Base class for all SIP body types.
Definition Contents.hxx:51
virtual Contents * getContents()
access to wrapped contents (signed, encrypted)
Definition Contents.hxx:100
virtual Contents * clone() const =0
returns a copy of a Contents object
std::shared_ptr< MasterProfile > & getMasterProfile()
static void setOutgoingEncryptionLevel(SipMessage &message, DialogUsageManager::EncryptionLevel level)
Definition DumHelper.cxx:11
const Contents * getInitialOffer() const
InviteSessionCreator(DialogUsageManager &dum, const NameAddr &target, std::shared_ptr< UserProfile > userProfile, const Contents *initial, DialogUsageManager::EncryptionLevel level, const Contents *alternative, ServerSubscriptionHandle serverSub=ServerSubscriptionHandle::NotValid())
virtual void dispatch(const SipMessage &msg)
SIP body type for holding Multipart-Alternative body contents (MIME content-type multipart/alternativ...
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Represents the "token" element in the RFC 3261 grammar.
Represents a SIP message.
static const char * id
Definition Symbols.hxx:127
static const char * C100rel
Definition Symbols.hxx:107
static const char * Timer
Definition Symbols.hxx:109
Represents the "token" element in the RFC 3261 grammar.
Definition Token.hxx:18
dcm! – add UnusedChecking(_enum) below;