/[resiprocate]/main/resip/dum/InviteSessionCreator.cxx
ViewVC logotype

Contents of /main/resip/dum/InviteSessionCreator.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10695 - (show annotations) (download)
Fri Nov 22 23:12:34 2013 UTC (5 years, 11 months ago) by sgodin
File MIME type: text/plain
File size: 5340 byte(s)
-Merged from b-uasprack-20130904
  -added UAS Prack support to DUM!  Original implementation taken from b-uasprack-20091103
  -many changes, fixes and enhancements from original branch
  -MasterProfile setting setUasReliableProvisionalMode is used to enable
  -added mode called SupportedEssential where we will send reliable provisionals only if they
   are a provisional that is carrying an offer or answer  - required for 3GPP IMS flows 
  -added resubmit timer for reliable responses to ensure we send a reliable provisional at least 
   every 2.5 minutes  -new profile setting: set1xxRelResubmitTime to support this
  -updated state diagrams and added new PRACK flow diagrams to dum/doc directory (removed old diagrams)
  -fixed update glare handling for UAC prack 
  -added in support for UAC Prack to be able to send an offer in the first PRACK response 
  (must call provideOffer from onAnswer callback)
  -made a helper method on DialogUsageManager to set advertised capabilities 
  -fixed missing break in ClientInviteSession::dispatchReceivedUpdateEarly 
  

  
  
1 #include "resip/stack/MultipartMixedContents.hxx"
2 #include "resip/stack/MultipartAlternativeContents.hxx"
3 #include "resip/dum/InviteSessionCreator.hxx"
4 #include "resip/stack/SdpContents.hxx"
5 #include "resip/dum/DialogUsageManager.hxx"
6 #include "resip/dum/MasterProfile.hxx"
7 #include "resip/dum/DumHelper.hxx"
8
9 using namespace resip;
10
11 InviteSessionCreator::InviteSessionCreator(DialogUsageManager& dum,
12 const NameAddr& target,
13 SharedPtr<UserProfile> userProfile,
14 const Contents* initial,
15 DialogUsageManager::EncryptionLevel level,
16 const Contents* alternative,
17 ServerSubscriptionHandle serverSub)
18 : BaseCreator(dum, userProfile),
19 mState(Initialized),
20 mServerSub(serverSub),
21 mEncryptionLevel(level)
22 {
23 makeInitialRequest(target, INVITE);
24 if (userProfile->isAnonymous())
25 {
26 mLastRequest->header(h_Privacys).push_back(PrivacyCategory(Symbols::id));
27 }
28
29 DumHelper::setOutgoingEncryptionLevel(*mLastRequest, level);
30 if(mDum.getMasterProfile()->getSupportedOptionTags().find(Token(Symbols::Timer)))
31 {
32 assert(userProfile.get());
33 if(userProfile->getDefaultSessionTime() >= 90)
34 {
35 getLastRequest()->header(h_SessionExpires).value() = userProfile->getDefaultSessionTime();
36 getLastRequest()->header(h_MinSE).value() = 90; // Absolute minimum specified by RFC4028
37 }
38 }
39
40 std::auto_ptr<Contents> initialOffer;
41 if (initial)
42 {
43 if (alternative)
44 {
45 MultipartAlternativeContents* mac = new MultipartAlternativeContents;
46 mac->parts().push_back(alternative->clone());
47 mac->parts().push_back(initial->clone());
48 initialOffer.reset(mac);
49 }
50 else
51 {
52 initialOffer.reset(initial->clone());
53 }
54 getLastRequest()->setContents(initialOffer);
55 }
56 //100rel
57 switch(mDum.getMasterProfile()->getUacReliableProvisionalMode())
58 {
59 case MasterProfile::Never:
60 //no support, do nothing
61 break;
62 case MasterProfile::Supported:
63 case MasterProfile::SupportedEssential:
64 getLastRequest()->header(h_Supporteds).push_back(Token(Symbols::C100rel));
65 break;
66 case MasterProfile::Required:
67 getLastRequest()->header(h_Requires).push_back(Token(Symbols::C100rel));
68 break;
69 default:
70 assert(0);
71 }
72 }
73
74 InviteSessionCreator::~InviteSessionCreator()
75 {
76 }
77
78 void
79 InviteSessionCreator::end()
80 {
81 assert(0);
82 }
83
84 void
85 InviteSessionCreator::dispatch(const SipMessage& msg)
86 {
87 // !jf! does this have to do with CANCELing all of the branches associated
88 // with a single invite request
89 }
90
91 const Contents*
92 InviteSessionCreator::getInitialOffer()
93 {
94 return getLastRequest()->getContents();
95 }
96
97
98 /* ====================================================================
99 * The Vovida Software License, Version 1.0
100 *
101 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
102 *
103 * Redistribution and use in source and binary forms, with or without
104 * modification, are permitted provided that the following conditions
105 * are met:
106 *
107 * 1. Redistributions of source code must retain the above copyright
108 * notice, this list of conditions and the following disclaimer.
109 *
110 * 2. Redistributions in binary form must reproduce the above copyright
111 * notice, this list of conditions and the following disclaimer in
112 * the documentation and/or other materials provided with the
113 * distribution.
114 *
115 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
116 * and "Vovida Open Communication Application Library (VOCAL)" must
117 * not be used to endorse or promote products derived from this
118 * software without prior written permission. For written
119 * permission, please contact vocal@vovida.org.
120 *
121 * 4. Products derived from this software may not be called "VOCAL", nor
122 * may "VOCAL" appear in their name, without prior written
123 * permission of Vovida Networks, Inc.
124 *
125 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
126 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
127 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
128 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
129 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
130 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
131 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
132 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
133 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
134 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
135 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
136 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
137 * DAMAGE.
138 *
139 * ====================================================================
140 *
141 * This software consists of voluntary contributions made by Vovida
142 * Networks, Inc. and many individuals on behalf of Vovida Networks,
143 * Inc. For more information on Vovida Networks, Inc., please see
144 * <http://www.vovida.org/>.
145 *
146 */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27