reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
SubscriptionHandler.hxx
Go to the documentation of this file.
1#if !defined(RESIP_SUBSCRIPTIONHANDLER_HXX)
2#define RESIP_SUBSCRIPTIONHANDLER_HXX
3
7
8namespace resip
9{
10class SipMessage;
11class SecurityAttributes;
12
14{
15 public:
17
18 //Client must call acceptUpdate or rejectUpdate for any onUpdateFoo
19 virtual void onUpdatePending(ClientSubscriptionHandle, const SipMessage& notify, bool outOfOrder)=0;
20 virtual void onUpdateActive(ClientSubscriptionHandle, const SipMessage& notify, bool outOfOrder)=0;
21 //unknown Subscription-State value
22 virtual void onUpdateExtension(ClientSubscriptionHandle, const SipMessage& notify, bool outOfOrder)=0;
23
24 virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage& notify)=0;
25
26 //subscription can be ended through a notify or a failure response.
27 virtual void onTerminated(ClientSubscriptionHandle, const SipMessage* msg)=0;
28 //not sure if this has any value - can be called for either a 200/SUBSCRIBE or a NOTIFY - whichever arrives first
30
34
37 // Called only if clientOutbound is enabled on the UserProfile and the first hop server
41};
42
44{
45 public:
47
50 virtual void onRefresh(ServerSubscriptionHandle, const SipMessage& sub);
51 //called when a new document is Published that matches this subscription. Also
52 //called when the publication is removed or expires, in which case contents
53 //and attrs are passed as null pointers.
54 virtual void onPublished(ServerSubscriptionHandle associated,
55 ServerPublicationHandle publication,
56 const Contents* contents,
57 const SecurityAttributes* attrs);
58
59 virtual void onNotifyAccepted(ServerSubscriptionHandle, const SipMessage& msg);
60 virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage& msg);
61
62 //called when this usage is destroyed for any reason. One of the following
63 //three methods will always be called before this, but this is the only
64 //method that MUST be implemented by a handler
66
68
69 //will be called when a NOTIFY is not delivered(with a usage terminating
70 //statusCode), or the Dialog is destroyed
71 virtual void onError(ServerSubscriptionHandle, const SipMessage& msg);
72
73 //app can synchronously decorate terminating NOTIFY messages. The only
74 //graceful termination mechanism is expiration, but the client can
75 //explicity end a subscription with an Expires header of 0.
76 virtual void onExpiredByClient(ServerSubscriptionHandle, const SipMessage& sub, SipMessage& notify);
77 virtual void onExpired(ServerSubscriptionHandle, SipMessage& notify);
78
81 // Called only if clientOutbound is enabled on the UserProfile and the first hop server
85
90 virtual void getExpires(const SipMessage &msg, uint32_t &expires, int &errorResponseCode);//ivr mod
91
92 virtual bool hasDefaultExpires() const;
93 virtual uint32_t getDefaultExpires() const;
94
95 virtual bool hasMinExpires() const;
96 virtual uint32_t getMinExpires() const;
97
98 virtual bool hasMaxExpires() const;
99 virtual uint32_t getMaxExpires() const;
100
101 const Mimes& getSupportedMimeTypes() const;
102};
103
104}
105
106#endif
107
108/* ====================================================================
109 * The Vovida Software License, Version 1.0
110 *
111 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
112 *
113 * Redistribution and use in source and binary forms, with or without
114 * modification, are permitted provided that the following conditions
115 * are met:
116 *
117 * 1. Redistributions of source code must retain the above copyright
118 * notice, this list of conditions and the following disclaimer.
119 *
120 * 2. Redistributions in binary form must reproduce the above copyright
121 * notice, this list of conditions and the following disclaimer in
122 * the documentation and/or other materials provided with the
123 * distribution.
124 *
125 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
126 * and "Vovida Open Communication Application Library (VOCAL)" must
127 * not be used to endorse or promote products derived from this
128 * software without prior written permission. For written
129 * permission, please contact vocal@vovida.org.
130 *
131 * 4. Products derived from this software may not be called "VOCAL", nor
132 * may "VOCAL" appear in their name, without prior written
133 * permission of Vovida Networks, Inc.
134 *
135 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
136 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
137 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
138 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
139 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
140 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
141 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
142 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
143 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
144 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
145 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
146 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
147 * DAMAGE.
148 *
149 * ====================================================================
150 *
151 * This software consists of voluntary contributions made by Vovida
152 * Networks, Inc. and many individuals on behalf of Vovida Networks,
153 * Inc. For more information on Vovida Networks, Inc., please see
154 * <http://www.vovida.org/>.
155 *
156 */
virtual void onUpdatePending(ClientSubscriptionHandle, const SipMessage &notify, bool outOfOrder)=0
virtual void onFlowTerminated(ClientSubscriptionHandle)
Called when a TCP or TLS flow to the server has terminated.
virtual void onUpdateExtension(ClientSubscriptionHandle, const SipMessage &notify, bool outOfOrder)=0
virtual void onNewSubscription(ClientSubscriptionHandle, const SipMessage &notify)=0
virtual void onReadyToSend(ClientSubscriptionHandle, SipMessage &msg)
called to allow app to adorn a message.
virtual void onUpdateActive(ClientSubscriptionHandle, const SipMessage &notify, bool outOfOrder)=0
virtual void onTerminated(ClientSubscriptionHandle, const SipMessage *msg)=0
virtual void onNotifyNotReceived(ClientSubscriptionHandle)
virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage &notify)=0
Base class for all SIP body types.
Definition Contents.hxx:51
virtual void onNewSubscription(ServerSubscriptionHandle, const SipMessage &sub)=0
virtual void onFlowTerminated(ServerSubscriptionHandle)
Called when a TCP or TLS flow to the server has terminated.
virtual void onExpiredByClient(ServerSubscriptionHandle, const SipMessage &sub, SipMessage &notify)
virtual void onNewSubscriptionFromRefer(ServerSubscriptionHandle, const SipMessage &sub)
virtual void onRefresh(ServerSubscriptionHandle, const SipMessage &sub)
virtual void onNotifyAccepted(ServerSubscriptionHandle, const SipMessage &msg)
virtual void onExpired(ServerSubscriptionHandle, SipMessage &notify)
virtual uint32_t getMinExpires() const
virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage &msg)
virtual void onError(ServerSubscriptionHandle, const SipMessage &msg)
const Mimes & getSupportedMimeTypes() const
virtual bool hasDefaultExpires() const
dcm! – a bit clunky, but really want these objects to not have state
virtual void onReadyToSend(ServerSubscriptionHandle, SipMessage &msg)
virtual uint32_t getMaxExpires() const
virtual void onTerminated(ServerSubscriptionHandle)=0
virtual void onPublished(ServerSubscriptionHandle associated, ServerPublicationHandle publication, const Contents *contents, const SecurityAttributes *attrs)
virtual uint32_t getDefaultExpires() const
virtual void getExpires(const SipMessage &msg, uint32_t &expires, int &errorResponseCode)
Default behavior is to use the expires value in the SipMessage, if it exists.
Represents a SIP message.
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition Stun.hxx:34