sipxtacklib
Version 3.3
|
A SipDialogMonitor object monitors the on/off hook status of all the SIP user agents for a set of URIs by subscribing to dialog events for the URIs and processing the resulting dialog events. More...
#include <SipDialogMonitor.h>
Public Member Functions | |
SipDialogMonitor (SipUserAgent *userAgent, UtlString &domainName, int hostPort, int refreshTimeout, bool toBePublished) | |
option to publish for other subscriptions More... | |
virtual | ~SipDialogMonitor () |
bool | addExtension (UtlString &groupName, Url &contactUrl) |
URIs are added and deleted from groups, which are identified by names. More... | |
bool | removeExtension (UtlString &groupName, Url &contactUrl) |
Remove a URI from a group to be monitored. More... | |
void | addStateChangeNotifier (const char *listUri, StateChangeNotifier *notifier) |
Register a StateChangeNotifier. More... | |
void | removeStateChangeNotifier (const char *listUri) |
Unregister a StateChangeNotifier. More... | |
Protected Member Functions | |
void | addDialogEvent (UtlString &contact, SipDialogEvent *dialogEvent, const char *earlyDialogHandle, const char *dialogHandle) |
Add 'dialogEvent' as the last dialog event for AOR 'contact'. More... | |
void | publishContent (UtlString &contact, SipDialogEvent *dialogEvent) |
Publish the dialog event package to the resource list. More... | |
void | notifyStateChange (UtlString &contact, StateChangeNotifier::Status) |
Send the state change to the notifier. More... | |
void | handleNotifyMessage (const SipMessage *notifyMessage, const char *earlyDialogHandle, const char *dialogHandle) |
Non-static callback to handle incoming NOTIFYs. More... | |
StateChangeNotifier::Status | mergeEventInformation (SipDialogEvent *dialogEvent, const char *earlyDialogHandle, const char *dialogHandle) |
Merge information from a dialogEvent into mDialogState. More... | |
void | createDialogState (UtlString *earlyDialogHandle) |
Create the dialog event state record for the SUBSCRIBE earlyDialogHandle. More... | |
void | destroyDialogState (UtlString *earlyDialogHandle) |
Delete the dialog event state record for the SUBSCRIBE earlyDialogHandle. More... | |
Static Protected Member Functions | |
static void | subscriptionStateCallback (SipSubscribeClient::SubscriptionState newState, const char *earlyDialogHandle, const char *dialogHandle, void *applicationData, int responseCode, const char *responseText, long expiration, const SipMessage *subscribeResponse) |
Callback to handle notification of changes in the states of subscriptions. More... | |
static void | notifyEventCallback (const char *earlyDialogHandle, const char *dialogHandle, void *applicationData, const SipMessage *notifyRequest) |
Callback to handle incoming NOTIFYs. More... | |
Friends | |
class | SipDialogMonitorTest |
A SipDialogMonitor object monitors the on/off hook status of all the SIP user agents for a set of URIs by subscribing to dialog events for the URIs and processing the resulting dialog events.
The URI is considered to be off-hook if there are any active dialogs (dialogs with state != 'terminated') on any of the UAs that send NOTIFYs in response to a SUBSCRIBE to the URI.
When status is updated, the information will be reported to all the notifiers that have been registered using addStateChangeNotifier.
Also, if toBePublished (mToBePublished) is set, the dialog status of any groups of URIs containing the URI that has changed will be published to any subscribers via a SipPublishContentMgr. (This is not completely implemented.)
SipDialogMonitor | ( | SipUserAgent * | userAgent, |
UtlString & | domainName, | ||
int | hostPort, | ||
int | refreshTimeout, | ||
bool | toBePublished | ||
) |
option to publish for other subscriptions
userAgent | Sip user agent for sending out SUBSCRIBEs and receiving NOTIFYs |
domainName | sipX domain name |
hostPort | Host port |
refreshTimeout | refresh timeout for SUBSCRIBEs |
|
virtual |
bool addExtension | ( | UtlString & | groupName, |
Url & | contactUrl | ||
) |
URIs are added and deleted from groups, which are identified by names.
Each group has independent membership, and they may overlap (which results in multiple subscriptions to that URI). Groups are not evident in the events presented to notifiers (except that a URI in multiple groups will be reported to a notifier multiply), but they are central to published status, as the groups are the "resource lists" which this object will be a subscription server for.
Note: Groups should not overlap, as mDialogHandleList is indexed by AOR only, and not group-and-AOR.Add a URI to a group to be monitored
bool removeExtension | ( | UtlString & | groupName, |
Url & | contactUrl | ||
) |
Remove a URI from a group to be monitored.
void addStateChangeNotifier | ( | const char * | listUri, |
StateChangeNotifier * | notifier | ||
) |
Register a StateChangeNotifier.
void removeStateChangeNotifier | ( | const char * | listUri | ) |
Unregister a StateChangeNotifier.
|
protected |
Add 'dialogEvent' as the last dialog event for AOR 'contact'.
|
protected |
Publish the dialog event package to the resource list.
|
protected |
Send the state change to the notifier.
|
staticprotected |
Callback to handle notification of changes in the states of subscriptions.
|
staticprotected |
Callback to handle incoming NOTIFYs.
|
protected |
Non-static callback to handle incoming NOTIFYs.
|
protected |
Merge information from a dialogEvent into mDialogState.
|
protected |
Create the dialog event state record for the SUBSCRIBE earlyDialogHandle.
|
protected |
Delete the dialog event state record for the SUBSCRIBE earlyDialogHandle.
|
friend |