reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ClientInviteSession.hxx
Go to the documentation of this file.
1#if !defined(RESIP_CLIENTINVITESESSION_HXX)
2#define RESIP_CLIENTINVITESESSION_HXX
3
6
7namespace resip
8{
9class SipMessage;
10class Contents;
11
13{
14 public:
16 Dialog& dialog,
17 std::shared_ptr<SipMessage> request,
18 const Contents* initialOffer,
23
26
28
29 public:
33 void provideOffer(const Contents& offer) override;
34 void provideOffer(const Contents& offer, DialogUsageManager::EncryptionLevel level, const Contents* alternative) override;
35
39 void provideAnswer(const Contents& answer) override;
40
42 void end(const Data& userReason) override;
43 void end(const ParserContainer<Token>& endReasons) override;
44 void end(EndReason reason) override;
45 void end() override;
46
50 void reject (int statusCode, WarningCategory *warning = nullptr) override;
51 void reject (int statusCode, const Contents* contents, WarningCategory *warning = 0) override;
52
53 const Contents& getEarlyMedia() const;
54
55 private:
56 void dispatch(const SipMessage& msg) override;
57 void dispatch(const DumTimeout& timer) override;
58
59 void dispatchStart (const SipMessage& msg);
60 void dispatchEarly (const SipMessage& msg);
61 void dispatchEarlyWithOffer (const SipMessage& msg);
62 void dispatchEarlyWithAnswer (const SipMessage& msg);
63 void dispatchAnswered (const SipMessage& msg);
64 void dispatchSentUpdateEarly (const SipMessage& msg);
65 void dispatchSentUpdateEarlyGlare (const SipMessage& msg);
66 void dispatchReceivedUpdateEarly (const SipMessage& msg);
67 void dispatchSentAnswer (const SipMessage& msg);
68 void dispatchQueuedUpdate (const SipMessage& msg);
69 void dispatchCancelled (const SipMessage& msg);
70
71 void handleRedirect (const SipMessage& msg);
72 void handleProvisional (const SipMessage& msg);
73 void handleFinalResponse (const SipMessage& msg);
74 void handle1xxOffer (const SipMessage& msg, const Contents& offer);
75 void handle1xxAnswer (const SipMessage& msg, const Contents& answer);
76 void sendPrackIfNeeded(const SipMessage& msg);
77 void sendPrack(const Contents& offerAnswer, DialogUsageManager::EncryptionLevel encryptionLevel);
78
79 // Called by the DialogSet (friend) when the app has CANCELed the request
80 void cancel();
81
82 // Called by the DialogSet when it receives a 2xx response
83 void onForkAccepted();
84
85 bool isBadRseq(const SipMessage& msg);
86 private:
87 void startCancelTimer();
88 void startStaleCallTimer();
89 void sendSipFrag(const SipMessage& response);
90
91 void onConnectedAspect(ClientInviteSessionHandle h, const SipMessage& msg);
92 void onProvisionalAspect(ClientInviteSessionHandle c, const SipMessage& msg);
93 void onFailureAspect(ClientInviteSessionHandle c, const SipMessage& msg);
94
95 std::unique_ptr<Contents> mEarlyMedia;
96
97 RAckCategory mRelRespInfo;
98 unsigned int mStaleCallTimerSeq;
99 unsigned int mCancelledTimerSeq;
100 ServerSubscriptionHandle mServerSub;
101 bool mAllowOfferInPrack;
102
103 friend class Dialog;
104};
105
106}
107
108#endif
109
110/* ====================================================================
111 * The Vovida Software License, Version 1.0
112 *
113 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
114 *
115 * Redistribution and use in source and binary forms, with or without
116 * modification, are permitted provided that the following conditions
117 * are met:
118 *
119 * 1. Redistributions of source code must retain the above copyright
120 * notice, this list of conditions and the following disclaimer.
121 *
122 * 2. Redistributions in binary form must reproduce the above copyright
123 * notice, this list of conditions and the following disclaimer in
124 * the documentation and/or other materials provided with the
125
126 * distribution.
127 *
128 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
129 * and "Vovida Open Communication Application Library (VOCAL)" must
130 * not be used to endorse or promote products derived from this
131 * software without prior written permission. For written
132 * permission, please contact vocal@vovida.org.
133 *
134 * 4. Products derived from this software may not be called "VOCAL", nor
135 * may "VOCAL" appear in their name, without prior written
136 * permission of Vovida Networks, Inc.
137 *
138 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
139 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
140 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
141 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
142 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
143 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
144 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
145 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
146 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
147 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
148 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
149 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
150 * DAMAGE.
151 *
152 * ====================================================================
153 *
154 * This software consists of voluntary contributions made by Vovida
155 * Networks, Inc. and many individuals on behalf of Vovida Networks,
156 * Inc. For more information on Vovida Networks, Inc., please see
157 * <http://www.vovida.org/>.
158 *
159 */
ClientInviteSessionHandle getHandle()
const Contents & getEarlyMedia() const
void reject(int statusCode, WarningCategory *warning=nullptr) override
Rejects an offer at the SIP level.
ClientInviteSession(const ClientInviteSession &)=delete
ClientInviteSession & operator=(const ClientInviteSession &)=delete
void provideAnswer(const Contents &answer) override
Similar to provideOffer - called to set the answer to be signaled to the peer.
void provideOffer(const Contents &offer) override
Called to set the offer that will be used in the next message that sends an offer.
ClientInviteSession(ClientInviteSession &&)=delete
ClientInviteSession & operator=(ClientInviteSession &&)=delete
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
static Handle< ServerSubscription > NotValid()
Definition Handle.hxx:84
Base class for class ClientInviteSession and class ServerInviteSession.
Container class for ParserCategory, used by SipMessage to represent multi-valued headers (Contact,...
Represents the RAck header field value defined in the RFC 3262 grammar.
Represents a SIP message.
Represents the "warning-value" element in the RFC 3261 grammar.
dcm! – add UnusedChecking(_enum) below;