reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
AccountingCollector.hxx
Go to the documentation of this file.
1#if !defined(RESIP_ACCOUNTINGCOLLECTOR_HXX)
2#define RESIP_ACCOUNTINGCOLLECTOR_HXX
3
4#include <memory>
5#include "rutil/ThreadIf.hxx"
8
9namespace json
10{
11 class Object;
12}
13
14namespace repro
15{
16class RequestContext;
17class PersistentMessageEnqueue;
18class ProxyConfig;
19
21{
22public:
30
41
43 virtual ~AccountingCollector();
44
45 virtual void doSessionAccounting(const resip::SipMessage& sip, bool received, RequestContext& context);
47
48private:
49 resip::Data mDbBaseDir;
50 PersistentMessageEnqueue* mSessionEventQueue;
51 PersistentMessageEnqueue* mRegistrationEventQueue;
52 bool mSessionAccountingAddRoutingHeaders;
53 bool mSessionAccountingAddViaHeaders;
54 bool mRegistrationAccountingAddRoutingHeaders;
55 bool mRegistrationAccountingAddViaHeaders;
56 bool mRegistrationAccountingLogRefreshes;
57
58 virtual void thread();
59
60 enum FifoEventType
61 {
62 SessionEventType,
63 RegistrationEventType
64 };
65 class FifoEvent
66 {
67 public:
68 FifoEventType mType;
69 resip::Data mData;
70 };
72 PersistentMessageEnqueue* initializeEventQueue(FifoEventType type, bool destroyFirst=false);
73 void pushEventObjectToQueue(json::Object& object, FifoEventType type);
74 void internalProcess(std::unique_ptr<FifoEvent> eventData);
75};
76
77}
78
79#endif
80
81/* ====================================================================
82 * The Vovida Software License, Version 1.0
83 *
84 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
85 *
86 * Redistribution and use in source and binary forms, with or without
87 * modification, are permitted provided that the following conditions
88 * are met:
89 *
90 * 1. Redistributions of source code must retain the above copyright
91 * notice, this list of conditions and the following disclaimer.
92 *
93 * 2. Redistributions in binary form must reproduce the above copyright
94 * notice, this list of conditions and the following disclaimer in
95 * the documentation and/or other materials provided with the
96 * distribution.
97 *
98 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
99 * and "Vovida Open Communication Application Library (VOCAL)" must
100 * not be used to endorse or promote products derived from this
101 * software without prior written permission. For written
102 * permission, please contact vocal@vovida.org.
103 *
104 * 4. Products derived from this software may not be called "VOCAL", nor
105 * may "VOCAL" appear in their name, without prior written
106 * permission of Vovida Networks, Inc.
107 *
108 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
109 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
110 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
111 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
112 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
113 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
114 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
116 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
117 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
118 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
119 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
120 * DAMAGE.
121 *
122 * ====================================================================
123 *
124 * This software consists of voluntary contributions made by Vovida
125 * Networks, Inc. and many individuals on behalf of Vovida Networks,
126 * Inc. For more information on Vovida Networks, Inc., please see
127 * <http://www.vovida.org/>.
128 *
129 */
virtual void doSessionAccounting(const resip::SipMessage &sip, bool received, RequestContext &context)
virtual void doRegistrationAccounting(RegistrationEvent regevent, const resip::SipMessage &sip)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents a SIP message.
A wrapper class to create and spawn a thread.
Definition ThreadIf.hxx:54
This Class is used to implement a primitive form of RPC using loose XML formatting.
void list()
Definition userAdmin.cxx:66