reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Registrar.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#include "repro/Registrar.hxx"
6#include "repro/Proxy.hxx"
8#include "rutil/Logger.hxx"
9
10#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
11
12using namespace resip;
13using namespace repro;
14using namespace std;
15
17{
18}
19
23
24void
26{
27 mRegistrarHandlers.push_back(handler);
28}
29
30void
32 const resip::SipMessage& reg)
33{
34 DebugLog (<< "Registrar::onRefresh " << reg.brief());
35 std::list<RegistrarHandler*>::iterator it = mRegistrarHandlers.begin();
36 bool continueProcessing = true;
37 for(; it != mRegistrarHandlers.end() && continueProcessing; it++)
38 {
39 continueProcessing = (*it)->onRefresh(sr, reg);
40 }
41 if(continueProcessing)
42 {
43 if(mProxy)
44 {
46 }
47 sr->accept();
48 }
49}
50
51void
53 const resip::SipMessage& reg)
54{
55 DebugLog (<< "Registrar::onRemove " << reg.brief());
56 std::list<RegistrarHandler*>::iterator it = mRegistrarHandlers.begin();
57 bool continueProcessing = true;
58 for(; it != mRegistrarHandlers.end() && continueProcessing; it++)
59 {
60 continueProcessing = (*it)->onRemove(sr, reg);
61 }
62 if(continueProcessing)
63 {
64 if(mProxy)
65 {
67 }
68 sr->accept();
69 }
70}
71
72void
74 const resip::SipMessage& reg)
75{
76 DebugLog (<< "Registrar::onRemoveAll " << reg.brief());
77 std::list<RegistrarHandler*>::iterator it = mRegistrarHandlers.begin();
78 bool continueProcessing = true;
79 for(; it != mRegistrarHandlers.end() && continueProcessing; it++)
80 {
81 continueProcessing = (*it)->onRemoveAll(sr, reg);
82 }
83 if(continueProcessing)
84 {
85 if(mProxy)
86 {
88 }
89 sr->accept();
90 }
91}
92
93void
95 const resip::SipMessage& reg)
96{
97 DebugLog (<< "Registrar::onAdd " << reg.brief());
98 std::list<RegistrarHandler*>::iterator it = mRegistrarHandlers.begin();
99 bool continueProcessing = true;
100 for(; it != mRegistrarHandlers.end() && continueProcessing; it++)
101 {
102 continueProcessing = (*it)->onAdd(sr, reg);
103 }
104 if(continueProcessing)
105 {
106 if(mProxy)
107 {
109 }
110 sr->accept();
111 }
112}
113
114void
116 const resip::SipMessage& reg)
117{
118 std::list<RegistrarHandler*>::iterator it = mRegistrarHandlers.begin();
119 bool continueProcessing = true;
120 for(; it != mRegistrarHandlers.end() && continueProcessing; it++)
121 {
122 continueProcessing = (*it)->onQuery(sr, reg);
123 }
124 if(continueProcessing)
125 {
126 sr->accept();
127 }
128}
129
130/* ====================================================================
131 * The Vovida Software License, Version 1.0
132 *
133 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
134 *
135 * Redistribution and use in source and binary forms, with or without
136 * modification, are permitted provided that the following conditions
137 * are met:
138 *
139 * 1. Redistributions of source code must retain the above copyright
140 * notice, this list of conditions and the following disclaimer.
141 *
142 * 2. Redistributions in binary form must reproduce the above copyright
143 * notice, this list of conditions and the following disclaimer in
144 * the documentation and/or other materials provided with the
145 * distribution.
146 *
147 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
148 * and "Vovida Open Communication Application Library (VOCAL)" must
149 * not be used to endorse or promote products derived from this
150 * software without prior written permission. For written
151 * permission, please contact vocal@vovida.org.
152 *
153 * 4. Products derived from this software may not be called "VOCAL", nor
154 * may "VOCAL" appear in their name, without prior written
155 * permission of Vovida Networks, Inc.
156 *
157 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
158 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
159 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
160 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
161 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
162 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
163 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
164 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
165 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
166 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
167 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
168 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
169 * DAMAGE.
170 *
171 * ====================================================================
172 *
173 * This software consists of voluntary contributions made by Vovida
174 * Networks, Inc. and many individuals on behalf of Vovida Networks,
175 * Inc. For more information on Vovida Networks, Inc., please see
176 * <http://www.vovida.org/>.
177 *
178 */
#define DebugLog(args_)
Definition Logger.hxx:128
void doRegistrationAccounting(repro::AccountingCollector::RegistrationEvent regEvent, const resip::SipMessage &sip)
Definition Proxy.cxx:713
virtual void onRemove(resip::ServerRegistrationHandle, const resip::SipMessage &reg)
called when one or more specified contacts is removed
Definition Registrar.cxx:52
virtual void onQuery(resip::ServerRegistrationHandle, const resip::SipMessage &reg)
Called when a client queries for the list of current registrations.
virtual void onRefresh(resip::ServerRegistrationHandle, const resip::SipMessage &reg)
Called when registration is refreshed.
Definition Registrar.cxx:31
virtual void onRemoveAll(resip::ServerRegistrationHandle, const resip::SipMessage &reg)
Called when all the contacts are removed using "Contact: *".
Definition Registrar.cxx:73
virtual ~Registrar()
Definition Registrar.cxx:20
virtual void addRegistrarHandler(RegistrarHandler *handler)
Definition Registrar.cxx:25
virtual void onAdd(resip::ServerRegistrationHandle, const resip::SipMessage &reg)
Called when one or more contacts are added.
Definition Registrar.cxx:94
virtual Brief brief() const
return a facet for brief encoding of message
Definition Message.cxx:16
Represents a SIP message.
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;