reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
DialogEventInfo.cxx
Go to the documentation of this file.
3
4namespace resip
5{
6
8: mState(DialogEventInfo::Trying),
9 mDialogId(Data::Empty, Data::Empty, Data::Empty),
10 mDirection(DialogEventInfo::Initiator),
11 mInviteSession(InviteSessionHandle::NotValid()),
12 mCreationTimeSeconds(0),
13 mReplaced(false)
14{
15}
16
18: mState(rhs.mState),
19 mDialogEventId(rhs.mDialogEventId),
20 mDialogId(rhs.mDialogId),
21 mDirection(rhs.mDirection),
22 mInviteSession(rhs.mInviteSession),
23 mReferredBy(rhs.mReferredBy ? new NameAddr(*rhs.mReferredBy) : nullptr),
24 mRouteSet(rhs.mRouteSet),
25 mLocalIdentity(rhs.mLocalIdentity),
26 mRemoteIdentity(rhs.mRemoteIdentity),
27 mLocalTarget(rhs.mLocalTarget),
28 mRemoteTarget(rhs.mRemoteTarget ? new Uri(*rhs.mRemoteTarget) : nullptr),
29 mCreationTimeSeconds(rhs.mCreationTimeSeconds),
30 mReplaced(rhs.mReplaced)
31{
32 if (rhs.mReplacesId)
33 {
34 mReplacesId = std::unique_ptr<DialogId>(new DialogId(rhs.mReplacesId->getCallId(),
35 rhs.mReplacesId->getLocalTag(),
36 rhs.mReplacesId->getRemoteTag()));
37 }
38 if (rhs.mLocalOfferAnswer)
39 {
40 mLocalOfferAnswer = std::unique_ptr<Contents>(rhs.mLocalOfferAnswer->clone());
41 }
42 if (rhs.mRemoteOfferAnswer)
43 {
44 mRemoteOfferAnswer = std::unique_ptr<Contents>(rhs.mRemoteOfferAnswer->clone());
45 }
46}
47
50{
51 if (this != &dialogEventInfo)
52 {
53 mDialogId = dialogEventInfo.mDialogId;
54 mState = dialogEventInfo.mState;
56 mDialogEventId = dialogEventInfo.mDialogEventId;
57 mDirection = dialogEventInfo.mDirection;
58 mInviteSession = dialogEventInfo.mInviteSession;
59 mLocalIdentity = dialogEventInfo.mLocalIdentity;
60
61 mLocalOfferAnswer.reset();
62 mReferredBy.reset();
63 mRemoteOfferAnswer.reset();
64 mRemoteTarget.reset();
65 mReplacesId.reset();
66
67 if(dialogEventInfo.mLocalOfferAnswer)
68 {
69 mLocalOfferAnswer.reset(dialogEventInfo.mLocalOfferAnswer->clone());
70 }
71
72 if(dialogEventInfo.mReferredBy)
73 {
74 mReferredBy.reset((NameAddr*)(dialogEventInfo.mReferredBy->clone()));
75 }
76
77 if(dialogEventInfo.mRemoteOfferAnswer)
78 {
79 mRemoteOfferAnswer.reset(dialogEventInfo.mRemoteOfferAnswer->clone());
80 }
81
82 if(dialogEventInfo.mRemoteTarget)
83 {
84 mRemoteTarget.reset((Uri*)dialogEventInfo.mRemoteTarget->clone());
85 }
86
87 if(dialogEventInfo.mReplacesId)
88 {
89 mReplacesId.reset(
90 new DialogId(dialogEventInfo.mReplacesId->getDialogSetId(),
91 dialogEventInfo.mReplacesId->getRemoteTag()));
92 }
93
94 mLocalTarget = dialogEventInfo.mLocalTarget;
95 mRemoteIdentity = dialogEventInfo.mRemoteIdentity;
96 mRouteSet = dialogEventInfo.mRouteSet;
97 mReplaced = dialogEventInfo.mReplaced;
98 }
99 return *this;
100}
101
102bool
104{
105 return (mDialogEventId == rhs.mDialogEventId);
106}
107
108bool
110{
111 return (mDialogEventId != rhs.mDialogEventId);
112}
113
114bool
116{
117 return (mDialogEventId < rhs.mDialogEventId);
118}
119
122{
123 return mState;
124}
125
126const Data&
131
132const Data&
134{
135 return mDialogId.getCallId();
136}
137
138const Data&
140{
141 return mDialogId.getLocalTag();
142}
143
144bool
149
150const Data&
155
156bool
158{
159 return mReferredBy != nullptr;
160}
161
162const NameAddr&
164{
165 return *mReferredBy;
166}
167
168const NameAddr&
173
174const NameAddr&
179
180const Uri&
182{
183 return mLocalTarget;
184}
185
186bool
188{
189 return false;
190}
191
192const NameAddrs&
194{
195 return mRouteSet;
196}
197
198bool
200{
201 return mRemoteTarget != nullptr;
202}
203
204const Uri&
206{
207 return *mRemoteTarget;
208}
209
210const Contents&
212{
214 {
216 {
218 }
219 }
221 return *mLocalOfferAnswer;
222}
223
224const Contents&
226{
228 {
230 {
232 }
233 }
235 return *mRemoteOfferAnswer;
236}
237
238bool
243
244bool
249
252{
254 return delta;
255}
256
257bool
259{
260 return mReplacesId != nullptr;
261}
262
263const DialogId&
265{
266 return *mReplacesId;
267}
268
271{
272 return mDirection;
273}
274
275} // namespace resip
276
277/* ====================================================================
278* The Vovida Software License, Version 1.0
279*
280* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
281*
282* Redistribution and use in source and binary forms, with or without
283* modification, are permitted provided that the following conditions
284* are met:
285*
286* 1. Redistributions of source code must retain the above copyright
287* notice, this list of conditions and the following disclaimer.
288*
289* 2. Redistributions in binary form must reproduce the above copyright
290* notice, this list of conditions and the following disclaimer in
291* the documentation and/or other materials provided with the
292* distribution.
293*
294* 3. The names "VOCAL", "Vovida Open Communication Application Library",
295* and "Vovida Open Communication Application Library (VOCAL)" must
296* not be used to endorse or promote products derived from this
297* software without prior written permission. For written
298* permission, please contact vocal@vovida.org.
299*
300* 4. Products derived from this software may not be called "VOCAL", nor
301* may "VOCAL" appear in their name, without prior written
302* permission of Vovida Networks, Inc.
303*
304* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
305* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
306* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
307* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
308* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
309* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
310* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
311* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
312* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
313* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
314* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
315* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
316* DAMAGE.
317*
318* ====================================================================
319*
320* This software consists of voluntary contributions made by Vovida
321* Networks, Inc. and many individuals on behalf of Vovida Networks,
322* Inc. For more information on Vovida Networks, Inc., please see
323* <http://www.vovida.org/>.
324*
325*/
#define resip_assert(x)
This file needs to work for both C and C++ code.
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
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
const Uri & getRemoteTarget() const
const Data & getLocalTag() const
DialogEventInfo & operator=(const DialogEventInfo &dialogEventInfo)
std::unique_ptr< Contents > mRemoteOfferAnswer
std::unique_ptr< Contents > mLocalOfferAnswer
std::unique_ptr< DialogId > mReplacesId
std::unique_ptr< Uri > mRemoteTarget
const Data & getRemoteTag() const
const Contents & getRemoteOfferAnswer() const
const DialogId & getReplacesId() const
std::unique_ptr< NameAddr > mReferredBy
bool operator!=(const DialogEventInfo &rhs) const
const State & getState() const
const Data & getDialogEventId() const
const NameAddr & getRefferredBy() const
Direction getDirection() const
bool operator==(const DialogEventInfo &rhs) const
const NameAddrs & getRouteSet() const
uint64_t getDurationSeconds() const
const Data & getCallId() const
const NameAddr & getRemoteIdentity() const
bool operator<(const DialogEventInfo &rhs) const
const NameAddr & getLocalIdentity() const
const Uri & getLocalTarget() const
const Contents & getLocalOfferAnswer() const
InviteSessionHandle mInviteSession
const Data & getLocalTag() const
Definition DialogId.cxx:105
const Data & getRemoteTag() const
Definition DialogId.cxx:111
const Data & getCallId() const
Definition DialogId.cxx:99
bool isValid() const
Definition Handle.hxx:25
bool hasLocalOfferAnswer() const
bool hasRemoteOfferAnswer() const
const Contents & getRemoteOfferAnswer() const
const Contents & getLocalOfferAnswer() const
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
static uint64_t getTimeSecs()
Returns the current clock time in seconds.
Definition Timer.hxx:78
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
Definition Stun.hxx:39