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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4010 - (hide annotations) (download)
Sat Mar 19 03:54:17 2005 UTC (14 years, 10 months ago) by jason
Original Path: main/sip/resiprocate/dum/SubscriptionHandler.hxx
File size: 5033 byte(s)
merged changes from b-teltel-20041118-invitesession 3484:HEAD into the trunk


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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27