reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ServerInviteSession.hxx
Go to the documentation of this file.
1#if !defined(RESIP_SERVERINVITESESSION_HXX)
2#define RESIP_SERVERINVITESESSION_HXX
3
6
7#include <deque>
8
9namespace resip
10{
11
13{
14 public:
16
19
22
24
26 void redirect(const NameAddrs& contacts, int code=302);
27
31 void provisional(int code=180, bool earlyFlag=true);
32
39 virtual void provideOffer(const Contents& offer);
40 virtual void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level, const Contents* alternative);
41 virtual void provideOffer(const Contents& offer, bool sendOfferAtAccept);
42 virtual void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level,
43 const Contents* alternative, bool sendOfferAtAccept);
44
47 virtual void requestOffer();
48
52 virtual void provideAnswer(const Contents& answer);
53
55 virtual void end(const Data& userReason);
56 virtual void end(const ParserContainer<Token>& endReasons);
57 virtual void end(EndReason reason);
58 virtual void end();
59
62 virtual void reject(int statusCode, WarningCategory *warning = 0);
63 virtual void reject(int statusCode, const Contents* contents, WarningCategory *warning = 0);
64
66 void accept(int statusCode=200);
67
71 void redirectCommand(const NameAddrs& contacts, int code=302);
72 void provisionalCommand(int code=180, bool earlyFlag=true);
73 void acceptCommand(int statusCode=200);
74
75 private:
76 friend class Dialog;
77
78 virtual void dispatch(const SipMessage& msg);
79 virtual void dispatch(const DumTimeout& timer);
80
81 void dispatchStart(const SipMessage& msg);
82 void dispatchOfferOrEarly(const SipMessage& msg);
83 void dispatchAccepted(const SipMessage& msg);
84 void dispatchWaitingToOffer(const SipMessage& msg);
85 void dispatchWaitingToRequestOffer(const SipMessage& msg);
86 void dispatchAcceptedWaitingAnswer(const SipMessage& msg);
87 void dispatchFirstSentOfferReliable(const SipMessage& msg);
88 void dispatchOfferReliableProvidedAnswer(const SipMessage& msg);
89 void dispatchFirstSentAnswerReliable(const SipMessage& msg);
90 void dispatchNoAnswerReliableWaitingPrack(const SipMessage& msg);
91 void dispatchSentUpdate(const SipMessage& msg);
92 void dispatchSentUpdateGlare(const SipMessage& msg);
93 void dispatchSentUpdateAccepted(const SipMessage& msg);
94 void dispatchReceivedUpdate(const SipMessage& msg);
95 void dispatchReceivedUpdateWaitingAnswer(const SipMessage& msg);
96 void dispatchWaitingToHangup(const SipMessage& msg);
97 void dispatchNegotiatedReliable(const SipMessage& msg);
98
99 void dispatchCancel(const SipMessage& msg);
100 void dispatchBye(const SipMessage& msg);
101 void dispatchUnknown(const SipMessage& msg);
102
103 // utilities
104 void startRetransmit1xxTimer();
105 void startResubmit1xxRelTimer();
106 void startRetransmit1xxRelTimer();
107 void sendAccept(int code, Contents* offerAnswer); // sends 2xxI
108 bool sendProvisional(int code, bool earlyFlag); // returns true if sent reliably
109 void queueResponse(int code, bool earlyFlag);
110 void sendUpdate(const Contents& offerAnswer);
111 bool handlePrack(const SipMessage& msg); // verify that prack matches our last send reliable 1xx
112 void prackCheckQueue(); // send a queued message after prack
113 void updateCheckQueue(); // send a queued message after update
114
116
117 // stores the original request
118 const SipMessage mFirstRequest;
119 std::shared_ptr<SipMessage> m1xx; // for 1xx retransmissions
120 unsigned long mCurrentRetransmit1xxSeq;
121
122 // UAS Prack members
123 unsigned int mLocalRSeq;
124 std::shared_ptr<SipMessage> mUnacknowledgedReliableProvisional; // We won't send a new reliable provisional until the previous one is acknowledge - used for re-transmissions
125 std::deque< std::pair<int, bool> > mQueuedResponses;
126 bool mAnswerSentReliably;
127 std::shared_ptr<SipMessage> mPrackWithOffer; // for 1xx retransmissions
128};
129
130}
131
132#endif
133
134/* ====================================================================
135 * The Vovida Software License, Version 1.0
136 *
137 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
138 *
139 * Redistribution and use in source and binary forms, with or without
140 * modification, are permitted provided that the following conditions
141 * are met:
142 *
143 * 1. Redistributions of source code must retain the above copyright
144 * notice, this list of conditions and the following disclaimer.
145 *
146 * 2. Redistributions in binary form must reproduce the above copyright
147 * notice, this list of conditions and the following disclaimer in
148 * the documentation and/or other materials provided with the
149
150 * distribution.
151 *
152 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
153 * and "Vovida Open Communication Application Library (VOCAL)" must
154 * not be used to endorse or promote products derived from this
155 * software without prior written permission. For written
156 * permission, please contact vocal@vovida.org.
157 *
158 * 4. Products derived from this software may not be called "VOCAL", nor
159 * may "VOCAL" appear in their name, without prior written
160 * permission of Vovida Networks, Inc.
161 *
162 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
163 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
164 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
165 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
166 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
167 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
168 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
169 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
170 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
171 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
172 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
173 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
174 * DAMAGE.
175 *
176 * ====================================================================
177 *
178 * This software consists of voluntary contributions made by Vovida
179 * Networks, Inc. and many individuals on behalf of Vovida Networks,
180 * Inc. For more information on Vovida Networks, Inc., please see
181 * <http://www.vovida.org/>.
182 *
183 */
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
dcm! – kill typedef std::list<DialogId> DialogIdSet;
Definition Dialog.hxx:29
Base class for class ClientInviteSession and class ServerInviteSession.
void redirect(const NameAddrs &contacts, int code=302)
send a 3xx
ServerInviteSession & operator=(ServerInviteSession &&)=delete
void redirectCommand(const NameAddrs &contacts, int code=302)
Provide asynchronous method access by using command.
virtual void reject(int statusCode, WarningCategory *warning=0)
Rejects an offer at the SIP level.
void accept(int statusCode=200)
accept an initial invite (2xx) - this is only applicable to the UAS
virtual void provideAnswer(const Contents &answer)
Similar to provideOffer - called to set the answer to be signaled to the peer.
ServerInviteSession(const ServerInviteSession &)=delete
ServerInviteSession(ServerInviteSession &&)=delete
void acceptCommand(int statusCode=200)
virtual void provideOffer(const Contents &offer)
Called to set the offer that will be used in the next message that sends an offer.
virtual void requestOffer()
Called to request that the far end provide an offer.
ServerInviteSession & operator=(const ServerInviteSession &)=delete
void provisionalCommand(int code=180, bool earlyFlag=true)
void provisional(int code=180, bool earlyFlag=true)
send a 1xx - provisional response.
Handle< ServerInviteSession > ServerInviteSessionHandle
ServerInviteSessionHandle getHandle()
Represents a SIP message.
Represents the "warning-value" element in the RFC 3261 grammar.
dcm! – add UnusedChecking(_enum) below;
void list()
Definition userAdmin.cxx:66