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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8478 - (hide annotations) (download)
Wed May 6 20:50:59 2009 UTC (10 years, 8 months ago) by bcampen
File MIME type: text/plain
File size: 3638 byte(s)
Fixing ClientSubscription's reaction (or rather lack thereof) when the server never sends a NOTIFY.

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