/[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 6057 - (show annotations) (download)
Sat Mar 4 23:46:50 2006 UTC (13 years, 9 months ago) by jason
File size: 2639 byte(s)
added a simple class to test the Reg event package (RFC 3680)

1 #if !defined(RESIP_RegEventClient_hxx)
2 #define RESIP_RegEventClient_hxx
3
4 #include "resip/dum/SubscriptionHandler.hxx"
5 #include "resip/dum/Handles.hxx"
6 #include "resip/dum/DialogUsageManager.hxx"
7 #include "resip/dum/DumThread.hxx"
8 #include "resip/stack/SipStack.hxx"
9 #include "resip/stack/StackThread.hxx"
10 #include "rutil/SharedPtr.hxx"
11
12 namespace resip
13 {
14 class NameAddr;
15 class SipMessage;
16 class Security;
17 class MasterProfile;
18 }
19
20 class RegEventClient : public resip::ClientSubscriptionHandler
21 {
22 public:
23 RegEventClient(resip::SharedPtr<resip::MasterProfile> profile);
24 virtual ~RegEventClient();
25
26 void run();
27
28 void watchAor(const resip::Uri& aor);
29 //void unwatchAor(const resip::Uri& aor);
30
31 virtual void onRegEvent(const resip::Data& aor, const resip::Data& reg)=0;
32 virtual void onRegEventError(const resip::Data& aor, const resip::Data& reg)=0;
33
34 protected:
35 virtual void onUpdatePending(resip::ClientSubscriptionHandle,
36 const resip::SipMessage& notify,
37 bool outOfOrder);
38 virtual void onUpdateActive(resip::ClientSubscriptionHandle,
39 const resip::SipMessage& notify,
40 bool outOfOrder);
41 virtual void onUpdateExtension(resip::ClientSubscriptionHandle,
42 const resip::SipMessage& notify,
43 bool outOfOrder);
44 virtual int onRequestRetry(resip::ClientSubscriptionHandle,
45 int retrySeconds,
46 const resip::SipMessage& notify);
47 virtual void onTerminated(resip::ClientSubscriptionHandle,
48 const resip::SipMessage& msg);
49 virtual void onNewSubscription(resip::ClientSubscriptionHandle,
50 const resip::SipMessage& notify);
51
52 private:
53 resip::Security* mSecurity;
54 resip::SipStack mStack;
55 resip::StackThread mStackThread;
56 resip::DialogUsageManager mDum;
57 resip::DumThread mDumThread;
58
59 resip::SharedPtr<resip::MasterProfile> mProfile;
60 friend class AddAor;
61 };
62
63 class AddAor : public resip::DumCommand
64 {
65 public:
66 AddAor(RegEventClient& client, const resip::Uri& aor);
67 virtual void executeCommand();
68
69 virtual resip::Message* clone() const;
70 virtual std::ostream& encode(std::ostream&) const;
71 virtual std::ostream& encodeBrief(std::ostream&) const;
72
73 private:
74 RegEventClient& mClient;
75 const resip::Uri mAor;
76 };
77
78 #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27