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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8738 - (show annotations) (download)
Sat Jan 23 15:36:09 2010 UTC (9 years, 10 months ago) by sgodin
File size: 5493 byte(s)
-add missing include
1 #if !defined(RESIP_DialogEventInfo_hxx)
2 #define RESIP_DialogEventInfo_hxx
3
4 #include <memory>
5 #include "resip/stack/NameAddr.hxx"
6 #include "resip/dum/DialogId.hxx"
7 #include "resip/dum/Handles.hxx"
8 #include "resip/stack/Contents.hxx"
9
10 namespace resip
11 {
12
13 //As uac, one is created for DialogSet; given to first dialog, new instances are
14 //generated for each fork. As uas, created at the same time as a Dialog.
15 class DialogEventInfo
16 {
17 public:
18 DialogEventInfo(void);
19 DialogEventInfo(const DialogEventInfo& rhs);
20 DialogEventInfo& operator=(const DialogEventInfo& dialogEventInfo);
21
22 //based on DialogEventId
23 bool operator==(const DialogEventInfo& rhs) const;
24 bool operator!=(const DialogEventInfo& rhs) const;
25 bool operator<(const DialogEventInfo& rhs) const;
26
27 enum Direction
28 {
29 Initiator,
30 Recipient
31 };
32
33 enum State
34 {
35 Trying = 0,
36 Proceeding,
37 Early,
38 Confirmed,
39 Terminated
40 };
41
42 const State& getState() const;
43
44 const Data& getDialogEventId() const;
45
46 const Data& getCallId() const;
47 const Data& getLocalTag() const;
48 bool hasRemoteTag() const;
49 const Data& getRemoteTag() const;
50
51 bool hasRefferedBy() const;
52 const NameAddr& getRefferredBy() const;
53
54 const NameAddr& getLocalIdentity() const;
55 const NameAddr& getRemoteIdentity() const;
56 const Uri& getLocalTarget() const;
57 //has... below only applicable when direction is outgoing
58 bool hasRouteSet() const;
59 const NameAddrs& getRouteSet() const;
60 bool hasRemoteTarget() const;
61 const Uri& getRemoteTarget() const;
62
63 // cache the first one, then forevermore lookup from InviteSession
64 const Contents& getLocalOfferAnswer() const;
65 const Contents& getRemoteOfferAnswer() const;
66 bool hasLocalOfferAnswer() const;
67 bool hasRemoteOfferAnswer() const;
68
69 UInt64 getDurationSeconds() const; // in seconds
70
71 bool hasReplacesId() const;
72 const DialogId& getReplacesId() const;
73
74 Direction getDirection() const;
75
76 protected:
77 friend class DialogEventStateManager;
78
79 State mState;
80 Data mDialogEventId; //unique for all Dialogs at this ua...may hash local +
81 //callid, all 3 tags for forks. Or could cycles an
82 //integer...hash memory location+salt at cons time(might be easiest).
83 DialogId mDialogId;
84 Direction mDirection;
85 //ID of the dialog this dialog replaced.
86 std::auto_ptr<DialogId> mReplacesId;
87 InviteSessionHandle mInviteSession;
88
89 std::auto_ptr<NameAddr> mReferredBy;
90
91 //could back-point to dialog for this information to save space
92 NameAddrs mRouteSet;
93 NameAddr mLocalIdentity;
94 NameAddr mRemoteIdentity;
95 Uri mLocalTarget;
96 std::auto_ptr<Uri> mRemoteTarget;
97
98 UInt64 mCreationTimeSeconds;
99
100 std::auto_ptr<Contents> mLocalOfferAnswer;
101 std::auto_ptr<Contents> mRemoteOfferAnswer;
102
103 private:
104 bool mReplaced;
105 };
106
107 }
108
109 #endif
110
111
112 /* ====================================================================
113 * The Vovida Software License, Version 1.0
114 *
115 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
116 *
117 * Redistribution and use in source and binary forms, with or without
118 * modification, are permitted provided that the following conditions
119 * are met:
120 *
121 * 1. Redistributions of source code must retain the above copyright
122 * notice, this list of conditions and the following disclaimer.
123 *
124 * 2. Redistributions in binary form must reproduce the above copyright
125 * notice, this list of conditions and the following disclaimer in
126 * the documentation and/or other materials provided with the
127 * distribution.
128 *
129 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
130 * and "Vovida Open Communication Application Library (VOCAL)" must
131 * not be used to endorse or promote products derived from this
132 * software without prior written permission. For written
133 * permission, please contact vocal@vovida.org.
134 *
135 * 4. Products derived from this software may not be called "VOCAL", nor
136 * may "VOCAL" appear in their name, without prior written
137 * permission of Vovida Networks, Inc.
138 *
139 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
140 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
141 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
142 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
143 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
144 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
145 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
146 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
147 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
148 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
149 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
150 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
151 * DAMAGE.
152 *
153 * ====================================================================
154 *
155 * This software consists of voluntary contributions made by Vovida
156 * Networks, Inc. and many individuals on behalf of Vovida Networks,
157 * Inc. For more information on Vovida Networks, Inc., please see
158 * <http://www.vovida.org/>.
159 *
160 */

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27