reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RegistrationHandler.hxx
Go to the documentation of this file.
1#if !defined(RESIP_REGISTRATIONHANDLER_HXX)
2#define RESIP_REGISTRATIONHANDLER_HXX
3
6
7#include <memory>
8
9namespace resip
10{
11
12class SipMessage;
13class NameAddr;
14class MasterProfile;
15
17{
18 public:
22 virtual void onSuccess(ClientRegistrationHandle, const SipMessage& response)=0;
23
24 // Called when all of my bindings have been removed
25 virtual void onRemoved(ClientRegistrationHandle, const SipMessage& response) = 0;
26
29 virtual int onRequestRetry(ClientRegistrationHandle, int retrySeconds, const SipMessage& response)=0;
30
33 virtual void onFailure(ClientRegistrationHandle, const SipMessage& response)=0;
34
37 // Called only if clientOutbound is enabled on the UserProfile and the first hop server
41
45 virtual bool onRefreshRequired(ClientRegistrationHandle, const SipMessage& lastRequest);
46};
47
49{
50 public:
51 virtual ~ServerRegistrationHandler() = default;
52
54 virtual void onRefresh(ServerRegistrationHandle, const SipMessage& reg)=0;
55
57 virtual void onRemove(ServerRegistrationHandle, const SipMessage& reg)=0;
58
60 virtual void onRemoveAll(ServerRegistrationHandle, const SipMessage& reg)=0;
61
64 virtual void onAdd(ServerRegistrationHandle, const SipMessage& reg)=0;
65
67 virtual void onQuery(ServerRegistrationHandle, const SipMessage& reg)=0;
68
75 virtual void getGlobalExpires(const SipMessage& msg,
76 const std::shared_ptr<MasterProfile>& masterProfile,
77 uint32_t &expires,
78 uint32_t &returnCode);
79
86 virtual void getContactExpires(const NameAddr &contact,
87 const std::shared_ptr<MasterProfile>& masterProfile,
88 uint32_t &expires,
89 uint32_t &returnCode);
90
93 virtual bool asyncProcessing(void) const
94 {
95 return false;
96 }
97
102 {
103 }
104
110 const Uri& aor,
111 std::unique_ptr<ContactPtrList> modifiedContactList,
112 std::unique_ptr<ContactRecordTransactionLog> transactionLog)
113 {
114 }
115
120 const resip::Uri& aor,
121 std::unique_ptr<resip::ContactPtrList> contacts)
122 {
123 }
124};
125
126}
127
128#endif
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 */
virtual void onFailure(ClientRegistrationHandle, const SipMessage &response)=0
Called if registration fails, usage will be destroyed (unless a Registration retry interval is enable...
virtual void onFlowTerminated(ClientRegistrationHandle)
Called when a TCP or TLS flow to the server has terminated.
virtual int onRequestRetry(ClientRegistrationHandle, int retrySeconds, const SipMessage &response)=0
call on Retry-After failure.
virtual bool onRefreshRequired(ClientRegistrationHandle, const SipMessage &lastRequest)
Called before attempting to refresh a registration Return true if the refresh should go ahead or fals...
virtual void onSuccess(ClientRegistrationHandle, const SipMessage &response)=0
Called when registration succeeds or each time it is successfully refreshed (manual refreshes only).
virtual void onRemoved(ClientRegistrationHandle, const SipMessage &response)=0
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
virtual void asyncGetContacts(ServerRegistrationHandle, const Uri &aor)
Called when a REGISTER is first received to retrieve the current list.
virtual void onRefresh(ServerRegistrationHandle, const SipMessage &reg)=0
Called when registration is refreshed.
virtual void onRemoveAll(ServerRegistrationHandle, const SipMessage &reg)=0
Called when all the contacts are removed using "Contact: *".
virtual void asyncUpdateContacts(ServerRegistrationHandle, const Uri &aor, std::unique_ptr< ContactPtrList > modifiedContactList, std::unique_ptr< ContactRecordTransactionLog > transactionLog)
Notifies the handler to update the current contact list for the AOR to the specified list that has be...
virtual void onAdd(ServerRegistrationHandle, const SipMessage &reg)=0
Called when one or more contacts are added.
virtual void onQuery(ServerRegistrationHandle, const SipMessage &reg)=0
Called when a client queries for the list of current registrations.
virtual void getContactExpires(const NameAddr &contact, const std::shared_ptr< MasterProfile > &masterProfile, uint32_t &expires, uint32_t &returnCode)
When processing a REGISTER request, return the desired expires value by processing this contact's exp...
virtual void asyncRemoveExpired(ServerRegistrationHandle, const resip::Uri &aor, std::unique_ptr< resip::ContactPtrList > contacts)
Notifies the handler to remove the entries specified in the contacts parameter.
virtual void onRemove(ServerRegistrationHandle, const SipMessage &reg)=0
called when one or more specified contacts is removed
virtual void getGlobalExpires(const SipMessage &msg, const std::shared_ptr< MasterProfile > &masterProfile, uint32_t &expires, uint32_t &returnCode)
When processing a REGISTER request, return the desired expires value when processing the "Expires" he...
virtual ~ServerRegistrationHandler()=default
virtual bool asyncProcessing(void) const
If true, the registration processing will use the async* functions here and will not use the Registra...
Represents a SIP message.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition Stun.hxx:34