reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ContactInstanceRecord.hxx
Go to the documentation of this file.
1#if !defined(resip_ContactInstanceRecord_hxx)
2#define resip_ContactInstanceRecord_hxx
3
4#include <vector>
5#include <list>
6#include <deque>
7
9#include "rutil/Data.hxx"
10#include "resip/stack/Tuple.hxx"
11
12#include <memory>
13#include <utility>
14
15namespace resip
16{
17
18class XMLCursor;
19
20static const uint64_t NeverExpire = 0xFFFFFFFFFFFFFFFFULL;
21
25{
26 public:
30 virtual ~ContactInstanceRecord();
31
32 static ContactInstanceRecord makeRemoveDelta(const NameAddr& contact);
33 static ContactInstanceRecord makeUpdateDelta(const NameAddr& contact,
34 uint64_t expires, // absolute time in secs
35 const SipMessage& msg);
36
37 // Stream ContactInstanceRecord in XML format
38 void stream(std::iostream& ss) const;
39
40 // Deserialize off xml tree
41 bool deserialize(resip::XMLCursor& xml, uint64_t now = 0);
42 /* @returns true if successfully deserialized
43 */
44
45 NameAddr mContact; // can contain callee caps and q-values
46 uint64_t mRegExpires; // in seconds
47 uint64_t mLastUpdated; // in seconds
48 Tuple mReceivedFrom; // source transport, IP address, and port
49 Tuple mPublicAddress; // Public IP address closest to the client (from Via headers): note: Tuple::getType == UNKNOWN_TRANPORT if no public address was found
50 NameAddrs mSipPath; // Value of SIP Path header from the request
51 Data mInstance; // From the instance parameter; usually a UUID URI
52 uint32_t mRegId; // From regid parameter of Contact header
53 Data mUserAgent; // From User-Agent header
54 bool mSyncContact; // This contact came from registration sync process, instead of direct SIP registration
55 bool mUseFlowRouting; // Set to true when routing to this contact should use flow routing
56 // Note: There is no need to regsync this field, since such records will also have
57 // onlyUseExistingConnection set, and such contacts are not replicated.
58 // Data mServerSessionId;// if there is no SIP Path header, the connection/session identifier
59 // Uri gruu; (GRUU is currently derived)
60 void *mUserInfo;
61 Data* mUserData; // Optional user/application specific string
62
63 bool operator==(const ContactInstanceRecord& rhs) const;
64
65};
66
67typedef std::list<ContactInstanceRecord> ContactList;
68
71typedef std::list<std::shared_ptr<ContactInstanceRecord>> ContactPtrList;
72
77{
78 public:
79
88
92
93 ContactRecordTransaction(Operation op, std::shared_ptr<ContactInstanceRecord> rec)
94 :mOp(op),mRec(rec)
95 {}
96
100 std::shared_ptr<ContactInstanceRecord> mRec;
101};
102
105typedef std::deque<std::shared_ptr<ContactRecordTransaction>> ContactRecordTransactionLog;
106
108{
109 public:
110 Data mAor; // canonical URI for this AOR and its aliases
112 std::vector<Uri> mAliases;
113};
114
116{
118 std::vector<ContactInstanceRecord> mInserts;
119 std::vector<ContactInstanceRecord> mUpdates;
120 std::vector<ContactInstanceRecord> mRemoves;
121};
122}
123#endif
A single contact record, bound to an Aor during registration.
bool operator==(const ContactInstanceRecord &rhs) const
void stream(std::iostream &ss) const
ContactInstanceRecord & operator=(const ContactInstanceRecord &rhs)
bool deserialize(resip::XMLCursor &xml, uint64_t now=0)
void * mUserInfo
can be used to map user record information (database record id for faster updates?...
static ContactInstanceRecord makeRemoveDelta(const NameAddr &contact)
static ContactInstanceRecord makeUpdateDelta(const NameAddr &contact, uint64_t expires, const SipMessage &msg)
Records a log of the database transacations that were performed when processing a local registration ...
std::shared_ptr< ContactInstanceRecord > mRec
For create & update: the newly modified record; for remove: the removed record; for removeAll: 0.
Operation mOp
the operation that was performed in this transaction.
ContactRecordTransaction(Operation op, std::shared_ptr< ContactInstanceRecord > rec)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Represents a SIP message.
Represents a network address.
Definition Tuple.hxx:59
dcm! – add UnusedChecking(_enum) below;
static const uint64_t NeverExpire
std::deque< std::shared_ptr< ContactRecordTransaction > > ContactRecordTransactionLog
Contains a collection of database operations that were performed during REGISTER processing.
std::list< std::shared_ptr< ContactInstanceRecord > > ContactPtrList
Used to reduce copying ContactInstanceRecord objects when processing registration.
unsigned long long uint64_t
Definition Stun.hxx:39
unsigned int uint32_t
Definition Stun.hxx:34
std::list< ContactInstanceRecord > ContactList
std::vector< ContactInstanceRecord > mRemoves
std::vector< ContactInstanceRecord > mUpdates
std::vector< ContactInstanceRecord > mInserts