/[resiprocate]/main/resip/dum/ClientInviteSession.hxx
ViewVC logotype

Contents of /main/resip/dum/ClientInviteSession.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10695 - (show annotations) (download)
Fri Nov 22 23:12:34 2013 UTC (6 years ago) by sgodin
File MIME type: text/plain
File size: 6486 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 #if !defined(RESIP_CLIENTINVITESESSION_HXX)
2 #define RESIP_CLIENTINVITESESSION_HXX
3
4 #include "resip/dum/InviteSession.hxx"
5 #include "resip/dum/Handles.hxx"
6
7 namespace resip
8 {
9 class SipMessage;
10 class Contents;
11
12 class ClientInviteSession : public InviteSession
13 {
14 public:
15 ClientInviteSession(DialogUsageManager& dum,
16 Dialog& dialog,
17 SharedPtr<SipMessage> request,
18 const Contents* initialOffer,
19 DialogUsageManager::EncryptionLevel level,
20 ServerSubscriptionHandle serverSub = ServerSubscriptionHandle::NotValid());
21
22 ClientInviteSessionHandle getHandle();
23
24 public:
25 /** Called to set the offer that will be used in the next message that
26 sends an offer. For a UAC in an early dialog, this can be used to send
27 an UPDATE request with an offer. */
28 virtual void provideOffer (const Contents& offer);
29 virtual void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level, const Contents* alternative);
30
31 /** Similar to provideOffer - called to set the answer to be signalled to
32 the peer. May result in message being sent synchronously depending on
33 the state. */
34 virtual void provideAnswer (const Contents& answer);
35
36 /** Makes the specific dialog end. Will send a BYE (not a CANCEL) */
37 virtual void end(const Data& userReason);
38 virtual void end(EndReason reason);
39 virtual void end();
40
41 /** Rejects an offer at the SIP level. For a UAC in an early dialog
42 this typically only makes sense, when rejecting an UPDATE request
43 that contains an offer in an early dialog. */
44 virtual void reject (int statusCode, WarningCategory *warning = 0);
45
46 const Contents& getEarlyMedia() const;
47
48 private:
49 virtual void dispatch(const SipMessage& msg);
50 virtual void dispatch(const DumTimeout& timer);
51
52 void dispatchStart (const SipMessage& msg);
53 void dispatchEarly (const SipMessage& msg);
54 void dispatchEarlyWithOffer (const SipMessage& msg);
55 void dispatchEarlyWithAnswer (const SipMessage& msg);
56 void dispatchAnswered (const SipMessage& msg);
57 void dispatchSentUpdateEarly (const SipMessage& msg);
58 void dispatchSentUpdateEarlyGlare (const SipMessage& msg);
59 void dispatchReceivedUpdateEarly (const SipMessage& msg);
60 void dispatchSentAnswer (const SipMessage& msg);
61 void dispatchQueuedUpdate (const SipMessage& msg);
62 void dispatchCancelled (const SipMessage& msg);
63
64 void handleRedirect (const SipMessage& msg);
65 void handleProvisional (const SipMessage& msg);
66 void handleFinalResponse (const SipMessage& msg);
67 void handle1xxOffer (const SipMessage& msg, const Contents& offer);
68 void handle1xxAnswer (const SipMessage& msg, const Contents& answer);
69 void sendPrackIfNeeded(const SipMessage& msg);
70 void sendPrack(const Contents& offerAnswer, DialogUsageManager::EncryptionLevel encryptionLevel);
71
72 // Called by the DialogSet (friend) when the app has CANCELed the request
73 void cancel();
74
75 // Called by the DialogSet when it receives a 2xx response
76 void onForkAccepted();
77
78 bool isBadRseq(const SipMessage& msg);
79 private:
80 void startCancelTimer();
81 void startStaleCallTimer();
82 void sendSipFrag(const SipMessage& response);
83
84 void onConnectedAspect(ClientInviteSessionHandle h, const SipMessage& msg);
85 void onProvisionalAspect(ClientInviteSessionHandle c, const SipMessage& msg);
86 void onFailureAspect(ClientInviteSessionHandle c, const SipMessage& msg);
87
88 std::auto_ptr<Contents> mEarlyMedia;
89
90 RAckCategory mRelRespInfo;
91 unsigned int mStaleCallTimerSeq;
92 unsigned int mCancelledTimerSeq;
93 ServerSubscriptionHandle mServerSub;
94 bool mAllowOfferInPrack;
95
96 // disabled
97 ClientInviteSession(const ClientInviteSession&);
98 ClientInviteSession& operator=(const ClientInviteSession&);
99
100 friend class Dialog;
101 };
102
103 }
104
105 #endif
106
107 /* ====================================================================
108 * The Vovida Software License, Version 1.0
109 *
110 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
111 *
112 * Redistribution and use in source and binary forms, with or without
113 * modification, are permitted provided that the following conditions
114 * are met:
115 *
116 * 1. Redistributions of source code must retain the above copyright
117 * notice, this list of conditions and the following disclaimer.
118 *
119 * 2. Redistributions in binary form must reproduce the above copyright
120 * notice, this list of conditions and the following disclaimer in
121 * the documentation and/or other materials provided with the
122
123 * distribution.
124 *
125 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
126 * and "Vovida Open Communication Application Library (VOCAL)" must
127 * not be used to endorse or promote products derived from this
128 * software without prior written permission. For written
129 * permission, please contact vocal@vovida.org.
130 *
131 * 4. Products derived from this software may not be called "VOCAL", nor
132 * may "VOCAL" appear in their name, without prior written
133 * permission of Vovida Networks, Inc.
134 *
135 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
136 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
137 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
138 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
139 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
140 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
141 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
142 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
143 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
144 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
145 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
146 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
147 * DAMAGE.
148 *
149 * ====================================================================
150 *
151 * This software consists of voluntary contributions made by Vovida
152 * Networks, Inc. and many individuals on behalf of Vovida Networks,
153 * Inc. For more information on Vovida Networks, Inc., please see
154 * <http://www.vovida.org/>.
155 *
156 */

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