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 |
dlb |
4052 |
virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage& notify)=0; |
24 |
|
|
|
25 |
derek |
3066 |
//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 |
derek |
3570 |
virtual void onNewSubscription(ClientSubscriptionHandle, const SipMessage& notify)=0; |
29 |
jason |
2727 |
}; |
30 |
|
|
|
31 |
|
|
class ServerSubscriptionHandler |
32 |
|
|
{ |
33 |
derek |
3067 |
public: |
34 |
derek |
3058 |
virtual void onNewSubscription(ServerSubscriptionHandle, const SipMessage& sub)=0; |
35 |
derek |
3450 |
virtual void onRefresh(ServerSubscriptionHandle, const SipMessage& sub); |
36 |
jason |
3545 |
virtual void onPublished(ServerSubscriptionHandle associated, |
37 |
|
|
ServerPublicationHandle publication, |
38 |
|
|
const Contents* contents, |
39 |
|
|
const SecurityAttributes* attrs); |
40 |
derek |
3066 |
|
41 |
derek |
3676 |
virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage& msg); |
42 |
|
|
|
43 |
derek |
3066 |
//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 |
derek |
3676 |
//will be called when a NOTIFY is not delivered(with a usage terminating |
49 |
|
|
//statusCode), or the Dialog is destroyed |
50 |
derek |
3067 |
virtual void onError(ServerSubscriptionHandle, const SipMessage& msg); |
51 |
derek |
3066 |
|
52 |
jason |
3433 |
//app can synchronously decorate terminating NOTIFY messages. The only |
53 |
derek |
3066 |
//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 |
derek |
3450 |
|
58 |
|
|
virtual bool hasDefaultExpires() const; |
59 |
|
|
virtual int getDefaultExpires() const; |
60 |
derek |
3570 |
|
61 |
|
|
const Mimes& getSupportedMimeTypes() const; |
62 |
jason |
2727 |
}; |
63 |
|
|
|
64 |
|
|
} |
65 |
|
|
|
66 |
derek |
3058 |
#endif |
67 |
jason |
4010 |
|
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 |
|
|
*/ |