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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11213 - (show annotations) (download)
Mon Jun 16 13:46:20 2014 UTC (5 years, 5 months ago) by sgodin
File MIME type: text/plain
File size: 4810 byte(s)
-allow ServerSubscription::end to specify a Retry-After value - thanks to Roman Romanchenko 
1 #if !defined(RESIP_SERVERSUBSCRIPTION_HXX)
2 #define RESIP_SERVERSUBSCRIPTION_HXX
3
4 #include "resip/dum/BaseSubscription.hxx"
5
6 namespace resip
7 {
8
9 class DialogUsageManager;
10
11 //!dcm! -- no Subscription State expires parameter generation yet.
12 class ServerSubscription : public BaseSubscription
13 {
14 public:
15 typedef Handle<ServerSubscription> ServerSubscriptionHandle;
16 ServerSubscriptionHandle getHandle();
17
18 const Data& getSubscriber() const { return mSubscriber; }
19 UInt32 getTimeLeft();
20
21 //only 200 and 202 are permissable. SubscriptionState is not affected.
22 //currently must be called for a refresh as well as initial creation.
23 SharedPtr<SipMessage> accept(int statusCode = 202);
24 SharedPtr<SipMessage> reject(int responseCode);
25
26 //used to accept a reresh when there is no useful state to convey to the
27 //client
28 SharedPtr<SipMessage> neutralNotify();
29
30 void setSubscriptionState(SubscriptionState state);
31
32 SharedPtr<SipMessage> update(const Contents* document);
33 void end(TerminateReason reason, const Contents* document = 0, int retryAfter = 0);
34
35 virtual void end();
36 virtual void send(SharedPtr<SipMessage> msg);
37 virtual void sendCommand(SharedPtr<SipMessage> msg)
38 {
39 BaseSubscription::sendCommand(msg);
40 }
41
42 // void setTerminationState(TerminateReason reason);
43 // void setCurrentEventDocument(const Contents* document);
44
45 virtual void dispatch(const SipMessage& msg);
46 virtual void dispatch(const DumTimeout& timer);
47
48 virtual EncodeStream& dump(EncodeStream& strm) const;
49
50 protected:
51 virtual ~ServerSubscription();
52 virtual void dialogDestroyed(const SipMessage& msg);
53 void onReadyToSend(SipMessage& msg);
54 virtual void flowTerminated();
55
56 private:
57 friend class Dialog;
58
59 ServerSubscription(DialogUsageManager& dum, Dialog& dialog, const SipMessage& req);
60
61 void makeNotifyExpires();
62 void makeNotify();
63
64 bool shouldDestroyAfterSendingFailure(const SipMessage& msg);
65
66 Data mSubscriber;
67
68 // const Contents* mCurrentEventDocument;
69 SipMessage mLastSubscribe;
70
71 UInt32 mExpires;
72
73 // disabled
74 ServerSubscription(const ServerSubscription&);
75 ServerSubscription& operator=(const ServerSubscription&);
76 UInt64 mAbsoluteExpiry;
77 };
78
79 }
80
81 #endif
82
83 /* ====================================================================
84 * The Vovida Software License, Version 1.0
85 *
86 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
87 *
88 * Redistribution and use in source and binary forms, with or without
89 * modification, are permitted provided that the following conditions
90 * are met:
91 *
92 * 1. Redistributions of source code must retain the above copyright
93 * notice, this list of conditions and the following disclaimer.
94 *
95 * 2. Redistributions in binary form must reproduce the above copyright
96 * notice, this list of conditions and the following disclaimer in
97 * the documentation and/or other materials provided with the
98 * distribution.
99 *
100 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
101 * and "Vovida Open Communication Application Library (VOCAL)" must
102 * not be used to endorse or promote products derived from this
103 * software without prior written permission. For written
104 * permission, please contact vocal@vovida.org.
105 *
106 * 4. Products derived from this software may not be called "VOCAL", nor
107 * may "VOCAL" appear in their name, without prior written
108 * permission of Vovida Networks, Inc.
109 *
110 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
111 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
112 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
113 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
114 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
115 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
116 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
117 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
118 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
119 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
120 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
121 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
122 * DAMAGE.
123 *
124 * ====================================================================
125 *
126 * This software consists of voluntary contributions made by Vovida
127 * Networks, Inc. and many individuals on behalf of Vovida Networks,
128 * Inc. For more information on Vovida Networks, Inc., please see
129 * <http://www.vovida.org/>.
130 *
131 */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27