/[resiprocate]/main/resip/dum/test/RegEventClient.hxx
ViewVC logotype

Contents of /main/resip/dum/test/RegEventClient.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9493 - (show annotations) (download)
Sat Apr 7 10:56:50 2012 UTC (7 years, 2 months ago) by dpocock
File MIME type: text/plain
File size: 3687 byte(s)
Include config.h from even more places where it may be needed
1 #if !defined(RESIP_RegEventClient_hxx)
2 #define RESIP_RegEventClient_hxx
3
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
7
8 #include "resip/dum/SubscriptionHandler.hxx"
9 #include "resip/dum/RegistrationHandler.hxx"
10 #include "resip/dum/Handles.hxx"
11 #include "resip/dum/DialogUsageManager.hxx"
12 #include "resip/dum/DumThread.hxx"
13 #include "resip/stack/SipStack.hxx"
14 #include "resip/stack/StackThread.hxx"
15 #include "rutil/SharedPtr.hxx"
16
17 namespace resip
18 {
19 class NameAddr;
20 class SipMessage;
21 class Security;
22 class MasterProfile;
23 }
24
25 class RegEventClient : public resip::ClientSubscriptionHandler,
26 public resip::ClientRegistrationHandler
27 {
28 public:
29 RegEventClient(resip::SharedPtr<resip::MasterProfile> profile);
30 virtual ~RegEventClient();
31
32 void run();
33
34 void watchAor(const resip::Uri& aor);
35 //void unwatchAor(const resip::Uri& aor);
36
37 virtual void onRegEvent(const resip::Data& aor, const resip::Data& reg)=0;
38 virtual void onRegEventError(const resip::Data& aor, const resip::Data& reg)=0;
39
40 protected:
41 virtual void onUpdatePending(resip::ClientSubscriptionHandle,
42 const resip::SipMessage& notify,
43 bool outOfOrder);
44 virtual void onUpdateActive(resip::ClientSubscriptionHandle,
45 const resip::SipMessage& notify,
46 bool outOfOrder);
47 virtual void onUpdateExtension(resip::ClientSubscriptionHandle,
48 const resip::SipMessage& notify,
49 bool outOfOrder);
50 virtual int onRequestRetry(resip::ClientSubscriptionHandle,
51 int retrySeconds,
52 const resip::SipMessage& notify);
53 virtual void onTerminated(resip::ClientSubscriptionHandle,
54 const resip::SipMessage* msg);
55 virtual void onNewSubscription(resip::ClientSubscriptionHandle,
56 const resip::SipMessage& notify);
57
58
59 virtual void onSuccess(resip::ClientRegistrationHandle,
60 const resip::SipMessage& response)
61 {
62 }
63
64 virtual void onRemoved(resip::ClientRegistrationHandle,
65 const resip::SipMessage& response)
66 {
67 }
68
69 virtual int onRequestRetry(resip::ClientRegistrationHandle,
70 int retrySeconds,
71 const resip::SipMessage& response)
72 {
73 return -1;
74 }
75
76 virtual void onFailure(resip::ClientRegistrationHandle,
77 const resip::SipMessage& response)
78 {
79 }
80
81
82 protected:
83 resip::Security* mSecurity;
84 resip::SipStack mStack;
85 resip::StackThread mStackThread;
86 resip::DialogUsageManager mDum;
87 resip::DumThread mDumThread;
88
89 resip::SharedPtr<resip::MasterProfile> mProfile;
90 friend class AddAor;
91 };
92
93 class AddAor : public resip::DumCommand
94 {
95 public:
96 AddAor(RegEventClient& client, const resip::Uri& aor);
97 virtual void executeCommand();
98
99 virtual resip::Message* clone() const;
100 #ifdef RESIP_USE_STL_STREAMS
101 virtual std::ostream& encode(std::ostream&) const;
102 virtual std::ostream& encodeBrief(std::ostream&) const;
103 #else
104 virtual resip::ResipFastOStream& encode(resip::ResipFastOStream&) const;
105 virtual resip::ResipFastOStream& encodeBrief(resip::ResipFastOStream&) const;
106 #endif
107
108 private:
109 RegEventClient& mClient;
110 const resip::Uri mAor;
111 };
112
113 #endif

Properties

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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.26