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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11167 - (show annotations) (download)
Thu May 1 19:31:20 2014 UTC (5 years, 6 months ago) by sgodin
File MIME type: text/plain
File size: 7995 byte(s)
-ensure we maintain the virtual override of InviteSession::provideOffer by moving the new 
 bool sendOfferAtAccept parameter (added in UAS PRACK changes) to two new methods
 -some apps relied on the virtualness of provideOffer to call the correct version
1 #if !defined(RESIP_SERVERINVITESESSION_HXX)
2 #define RESIP_SERVERINVITESESSION_HXX
3
4 #include "resip/dum/InviteSession.hxx"
5 #include "resip/stack/SipMessage.hxx"
6
7 #include <deque>
8
9 namespace resip
10 {
11
12 class ServerInviteSession: public InviteSession
13 {
14 public:
15 typedef Handle<ServerInviteSession> ServerInviteSessionHandle;
16 ServerInviteSessionHandle getHandle();
17
18 /** send a 3xx */
19 void redirect(const NameAddrs& contacts, int code=302);
20
21 /** send a 1xx - provisional response. If you set earlyFlag to true, and have provided
22 an answer, then DUM will attach the answer to the provisional response, as an
23 early media indication */
24 void provisional(int code=180, bool earlyFlag=true);
25
26 /** Called to set the offer that will be used in the next message that
27 sends an offer. If possible, this will synchronously send the
28 appropriate request or response. In some cases, the UAS might have to
29 call accept in order to cause the message to be sent.
30 If sendOfferAtAccept is true, no UPDATE will be sent if media is negotiated reliable,
31 it will be sent at accept */
32 virtual void provideOffer(const Contents& offer);
33 virtual void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level, const Contents* alternative);
34 virtual void provideOffer(const Contents& offer, bool sendOfferAtAccept);
35 virtual void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level,
36 const Contents* alternative, bool sendOfferAtAccept);
37
38 /** Called to request that the far end provide an offer. This will cause a
39 reinvite with no body to be sent. */
40 virtual void requestOffer();
41
42 /** Similar to provideOffer - called to set the answer to be signalled to
43 the peer. May result in message being sent synchronously depending on
44 the state. */
45 virtual void provideAnswer(const Contents& answer);
46
47 /** Makes the specific dialog end. Will send a 480. */
48 virtual void end(const Data& userReason);
49 virtual void end(EndReason reason);
50 virtual void end();
51
52 /** Rejects an offer at the SIP level. So this can send a 488 to a
53 reINVITE or UPDATE */
54 virtual void reject(int statusCode, WarningCategory *warning = 0);
55
56 /** accept an initial invite (2xx) - this is only applicable to the UAS */
57 void accept(int statusCode=200);
58
59 /**
60 * Provide asynchronous method access by using command
61 */
62 void redirectCommand(const NameAddrs& contacts, int code=302);
63 void provisionalCommand(int code=180);
64 void acceptCommand(int statusCode=200);
65
66 private:
67 friend class Dialog;
68
69 virtual void dispatch(const SipMessage& msg);
70 virtual void dispatch(const DumTimeout& timer);
71
72 void dispatchStart(const SipMessage& msg);
73 void dispatchOfferOrEarly(const SipMessage& msg);
74 void dispatchAccepted(const SipMessage& msg);
75 void dispatchWaitingToOffer(const SipMessage& msg);
76 void dispatchWaitingToRequestOffer(const SipMessage& msg);
77 void dispatchAcceptedWaitingAnswer(const SipMessage& msg);
78 void dispatchFirstSentOfferReliable(const SipMessage& msg);
79 void dispatchOfferReliableProvidedAnswer(const SipMessage& msg);
80 void dispatchFirstSentAnswerReliable(const SipMessage& msg);
81 void dispatchNoAnswerReliableWaitingPrack(const SipMessage& msg);
82 void dispatchSentUpdate(const SipMessage& msg);
83 void dispatchSentUpdateGlare(const SipMessage& msg);
84 void dispatchSentUpdateAccepted(const SipMessage& msg);
85 void dispatchReceivedUpdate(const SipMessage& msg);
86 void dispatchReceivedUpdateWaitingAnswer(const SipMessage& msg);
87 void dispatchWaitingToHangup(const SipMessage& msg);
88 void dispatchNegotiatedReliable(const SipMessage& msg);
89
90 void dispatchCancel(const SipMessage& msg);
91 void dispatchBye(const SipMessage& msg);
92 void dispatchUnknown(const SipMessage& msg);
93
94 // utilities
95 void startRetransmit1xxTimer();
96 void startResubmit1xxRelTimer();
97 void startRetransmit1xxRelTimer();
98 void sendAccept(int code, Contents* offerAnswer); // sends 2xxI
99 bool sendProvisional(int code, bool earlyFlag); // returns true if sent reliably
100 void queueResponse(int code, bool earlyFlag);
101 void sendUpdate(const Contents& offerAnswer);
102 bool handlePrack(const SipMessage& msg); // verify that prack matches our last send reliable 1xx
103 void prackCheckQueue(); // send a queued message after prack
104 void updateCheckQueue(); // send a queued message after update
105
106 ServerInviteSession(DialogUsageManager& dum, Dialog& dialog, const SipMessage& msg);
107
108 // disabled
109 ServerInviteSession(const ServerInviteSession&);
110 ServerInviteSession& operator=(const ServerInviteSession&);
111
112 // stores the original request
113 const SipMessage mFirstRequest;
114 SharedPtr<SipMessage> m1xx; // for 1xx retransmissions
115 unsigned long mCurrentRetransmit1xxSeq;
116
117 // UAS Prack members
118 unsigned int mLocalRSeq;
119 SharedPtr<SipMessage> mUnacknowledgedReliableProvisional; // We won't send a new reliable provisional until the previous one is acknowledge - used for re-transmissions
120 std::deque< std::pair<int, bool> > mQueuedResponses;
121 bool mAnswerSentReliably;
122 SharedPtr<SipMessage> mPrackWithOffer; // for 1xx retransmissions
123 };
124
125 }
126
127 #endif
128
129 /* ====================================================================
130 * The Vovida Software License, Version 1.0
131 *
132 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
133 *
134 * Redistribution and use in source and binary forms, with or without
135 * modification, are permitted provided that the following conditions
136 * are met:
137 *
138 * 1. Redistributions of source code must retain the above copyright
139 * notice, this list of conditions and the following disclaimer.
140 *
141 * 2. Redistributions in binary form must reproduce the above copyright
142 * notice, this list of conditions and the following disclaimer in
143 * the documentation and/or other materials provided with the
144
145 * distribution.
146 *
147 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
148 * and "Vovida Open Communication Application Library (VOCAL)" must
149 * not be used to endorse or promote products derived from this
150 * software without prior written permission. For written
151 * permission, please contact vocal@vovida.org.
152 *
153 * 4. Products derived from this software may not be called "VOCAL", nor
154 * may "VOCAL" appear in their name, without prior written
155 * permission of Vovida Networks, Inc.
156 *
157 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
158 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
159 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
160 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
161 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
162 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
163 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
164 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
165 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
166 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
167 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
168 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
169 * DAMAGE.
170 *
171 * ====================================================================
172 *
173 * This software consists of voluntary contributions made by Vovida
174 * Networks, Inc. and many individuals on behalf of Vovida Networks,
175 * Inc. For more information on Vovida Networks, Inc., please see
176 * <http://www.vovida.org/>.
177 *
178 */

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