/[resiprocate]/main/resip/dum/SubscriptionHandler.hxx
ViewVC logotype

Contents of /main/resip/dum/SubscriptionHandler.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4599 - (show annotations) (download)
Wed May 11 23:10:19 2005 UTC (14 years, 7 months ago) by derek
Original Path: main/sip/resiprocate/dum/SubscriptionHandler.hxx
File size: 5146 byte(s)
set svn:eol-style to LF
1 #if !defined(RESIP_SUBSCRIPTIONHANDLER_HXX)
2 #define RESIP_SUBSCRIPTIONHANDLER_HXX
3
4 #include "resiprocate/dum/Handles.hxx"
5 #include "resiprocate/Mime.hxx"
6
7 namespace resip
8 {
9 class SipMessage;
10 class SecurityAttributes;
11
12 class ClientSubscriptionHandler
13 {
14 public:
15 virtual void onRefreshRejected(ClientSubscriptionHandle, const SipMessage& rejection)=0;
16
17 //Client must call acceptUpdate or rejectUpdate for any onUpdateFoo
18 virtual void onUpdatePending(ClientSubscriptionHandle, const SipMessage& notify)=0;
19 virtual void onUpdateActive(ClientSubscriptionHandle, const SipMessage& notify)=0;
20 //unknown Subscription-State value
21 virtual void onUpdateExtension(ClientSubscriptionHandle, const SipMessage& notify)=0;
22
23 virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage& notify)=0;
24
25 //subscription can be ended through a notify or a failure response.
26 virtual void onTerminated(ClientSubscriptionHandle, const SipMessage& msg)=0;
27 //not sure if this has any value.
28 virtual void onNewSubscription(ClientSubscriptionHandle, const SipMessage& notify)=0;
29 };
30
31 class ServerSubscriptionHandler
32 {
33 public:
34 virtual void onNewSubscription(ServerSubscriptionHandle, const SipMessage& sub)=0;
35 virtual void onRefresh(ServerSubscriptionHandle, const SipMessage& sub);
36 virtual void onPublished(ServerSubscriptionHandle associated,
37 ServerPublicationHandle publication,
38 const Contents* contents,
39 const SecurityAttributes* attrs);
40
41 virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage& msg);
42
43 //called when this usage is destroyed for any reason. One of the following
44 //three methods will always be called before this, but this is the only
45 //method that MUST be implemented by a handler
46 virtual void onTerminated(ServerSubscriptionHandle)=0;
47
48 //will be called when a NOTIFY is not delivered(with a usage terminating
49 //statusCode), or the Dialog is destroyed
50 virtual void onError(ServerSubscriptionHandle, const SipMessage& msg);
51
52 //app can synchronously decorate terminating NOTIFY messages. The only
53 //graceful termination mechanism is expiration, but the client can
54 //explicity end a subscription with an Expires header of 0.
55 virtual void onExpiredByClient(ServerSubscriptionHandle, const SipMessage& sub, SipMessage& notify);
56 virtual void onExpired(ServerSubscriptionHandle, SipMessage& notify);
57
58 virtual bool hasDefaultExpires() const;
59 virtual int getDefaultExpires() const;
60
61 const Mimes& getSupportedMimeTypes() const;
62 };
63
64 }
65
66 #endif
67
68 /* ====================================================================
69 * The Vovida Software License, Version 1.0
70 *
71 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
72 *
73 * Redistribution and use in source and binary forms, with or without
74 * modification, are permitted provided that the following conditions
75 * are met:
76 *
77 * 1. Redistributions of source code must retain the above copyright
78 * notice, this list of conditions and the following disclaimer.
79 *
80 * 2. Redistributions in binary form must reproduce the above copyright
81 * notice, this list of conditions and the following disclaimer in
82 * the documentation and/or other materials provided with the
83 * distribution.
84 *
85 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
86 * and "Vovida Open Communication Application Library (VOCAL)" must
87 * not be used to endorse or promote products derived from this
88 * software without prior written permission. For written
89 * permission, please contact vocal@vovida.org.
90 *
91 * 4. Products derived from this software may not be called "VOCAL", nor
92 * may "VOCAL" appear in their name, without prior written
93 * permission of Vovida Networks, Inc.
94 *
95 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
96 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
97 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
98 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
99 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
100 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
101 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
102 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
103 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
104 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
105 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
106 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
107 * DAMAGE.
108 *
109 * ====================================================================
110 *
111 * This software consists of voluntary contributions made by Vovida
112 * Networks, Inc. and many individuals on behalf of Vovida Networks,
113 * Inc. For more information on Vovida Networks, Inc., please see
114 * <http://www.vovida.org/>.
115 *
116 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27