sipXcallLib home page


SipPresenceMonitor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _SIPPRESENCEMONITOR_H_
12 #define _SIPPRESENCEMONITOR_H_
13 
14 // SYSTEM INCLUDES
15 //#include <...>
16 
17 // APPLICATION INCLUDES
18 #include <os/OsBSem.h>
19 #include <net/StateChangeNotifier.h>
21 #include <net/SipUserAgent.h>
22 #include <net/SipDialogMgr.h>
23 #include <net/SipSubscriptionMgr.h>
24 #include <net/SipSubscribeServerEventHandler.h>
25 #include <net/SipSubscribeServer.h>
26 #include <net/SipRefreshManager.h>
27 #include <net/SipPublishContentMgr.h>
28 #include <net/SipPresenceEvent.h>
29 #include <utl/UtlSList.h>
30 #include <utl/UtlHashMap.h>
31 #include <cp/CallManager.h>
32 #include <net/SdpCodecFactory.h>
33 
34 // DEFINES
35 // EXTERNAL FUNCTIONS
36 // EXTERNAL VARIABLES
37 // CONSTANTS
38 // STRUCTS
39 // TYPEDEFS
40 // FORWARD DECLARATIONS
41 
52 class SipPresenceMonitor : public StateChangeNotifier
53 {
54  public:
55 
56  SipPresenceMonitor(SipUserAgent* userAgent,
60  UtlString& domainName,
61  int hostPort,
62  UtlString& configFile,
63  bool toBePublished);
64 
65  virtual ~SipPresenceMonitor();
66 
68  bool addExtension(UtlString& groupName, Url& contactUrl);
69 
71  bool removeExtension(UtlString& groupName, Url& contactUrl);
72 
74  void addStateChangeNotifier(const char* fileUrl, StateChangeNotifier* notifier);
75 
77  void removeStateChangeNotifier(const char* fileUrl);
78 
80  virtual bool setStatus(const Url& aor, const Status value);
81 
82  protected:
83 
85  bool addPresenceEvent(UtlString& contact, SipPresenceEvent* presenceEvent);
86 
88  void publishContent(UtlString& contact, SipPresenceEvent* presenceEvent);
89 
91  void notifyStateChange(UtlString& contact, SipPresenceEvent* presenceEvent);
92 
93  private:
94 
96  SdpCodecFactory mCodecFactory;
98  SipUserAgent* mpUserAgent;
99  UtlString mDomainName;
101 
102  OsBSem mLock;
103 
104  SipDialogMgr mDialogMgr;
105  SipSubscriptionMgr* mpSubscriptionMgr;
106  SipSubscribeServerEventHandler mPolicyHolder;
107  SipPublishContentMgr mSipPublishContentMgr;
108  SipSubscribeServer* mpSubscribeServer;
109 
110  UtlHashMap mMonitoredLists;
111  UtlHashMap mPresenceEventList;
113 
115  SipPresenceMonitor(const SipPresenceMonitor& rSipPresenceMonitor);
116 
119 };
120 
121 #endif // _SIPPRESENCEMONITOR_H_
SipPresenceMonitor(SipUserAgent *userAgent, UtlString &domainName, int hostPort, UtlString &configFile, bool toBePublished)
option to publish for other subscriptions
Definition: SipPresenceMonitor.cpp:50
SipPresenceMonitor & operator=(const SipPresenceMonitor &rhs)
Disabled assignment operator.
SipPublishContentMgr mSipPublishContentMgr
Definition: SipPresenceMonitor.h:107
bool removeExtension(UtlString &groupName, Url &contactUrl)
Remove an extension from a group to be monitored.
Definition: SipPresenceMonitor.cpp:216
virtual ~SipPresenceMonitor()
Definition: SipPresenceMonitor.cpp:135
SdpCodecFactory mCodecFactory
Definition: SipPresenceMonitor.h:96
UtlString mDomainName
Definition: SipPresenceMonitor.h:99
CallManager * mpCallManager
Definition: SipPresenceMonitor.h:95
void removeStateChangeNotifier(const char *fileUrl)
Unregistered a StateChangeNotifier.
Definition: SipPresenceMonitor.cpp:396
UtlHashMap mMonitoredLists
Definition: SipPresenceMonitor.h:110
void addStateChangeNotifier(const char *fileUrl, StateChangeNotifier *notifier)
Registered a StateChangeNotifier.
Definition: SipPresenceMonitor.cpp:387
PresenceDialInServer * mpDialInServer
Definition: SipPresenceMonitor.h:97
SipDialogMgr mDialogMgr
Definition: SipPresenceMonitor.h:104
UtlHashMap mPresenceEventList
Definition: SipPresenceMonitor.h:111
Definition: CallManager.h:69
bool addExtension(UtlString &groupName, Url &contactUrl)
Add an extension to a group to be monitored.
Definition: SipPresenceMonitor.cpp:167
A PresenceDialInServer is an object that allows an extension to sign in and sign off to a ACD queue b...
Definition: PresenceDialInServer.h:40
bool addPresenceEvent(UtlString &contact, SipPresenceEvent *presenceEvent)
Add the contact and presence event to the subscribe list.
Definition: SipPresenceMonitor.cpp:252
SipSubscribeServer * mpSubscribeServer
Definition: SipPresenceMonitor.h:108
virtual bool setStatus(const Url &aor, const Status value)
Set the status value.
Definition: SipPresenceMonitor.cpp:443
SipSubscriptionMgr * mpSubscriptionMgr
Definition: SipPresenceMonitor.h:105
bool mToBePublished
Definition: SipPresenceMonitor.h:100
UtlHashMap mStateChangeNotifiers
Definition: SipPresenceMonitor.h:112
SipUserAgent * mpUserAgent
Definition: SipPresenceMonitor.h:98
void publishContent(UtlString &contact, SipPresenceEvent *presenceEvent)
Publish the presence event package to the resource list.
Definition: SipPresenceMonitor.cpp:314
SipSubscribeServerEventHandler mPolicyHolder
Definition: SipPresenceMonitor.h:106
A SipPresenceMonitor is an object that is used for keeping track of the SIP user agents&#39; presence sta...
Definition: SipPresenceMonitor.h:52
OsBSem mLock
Definition: SipPresenceMonitor.h:102
void notifyStateChange(UtlString &contact, SipPresenceEvent *presenceEvent)
Send the state change to the notifier.
Definition: SipPresenceMonitor.cpp:404