sipxtacklib  Version 3.3
Public Member Functions | List of all members
SipSubscriptionMgr Class Reference

Class for maintaining SUBSCRIBE dialog information in subscription server. More...

#include <SipSubscriptionMgr.h>

Public Member Functions

 SipSubscriptionMgr ()
 Default constructor. More...
 
virtual ~SipSubscriptionMgr ()
 Destructor. More...
 
virtual UtlBoolean updateDialogInfo (const SipMessage &subscribeRequest, const UtlString &resourceId, const UtlString &eventTypeKey, OsMsgQ *subscriptionTimeoutQueue, UtlString &subscribeDialogHandle, UtlBoolean &isNew, UtlBoolean &isExpired, SipMessage &subscribeResponse)
 Add/Update subscription for the given SUBSCRIBE request. More...
 
virtual UtlBoolean getNotifyDialogInfo (const UtlString &subscribeDialogHandle, SipMessage &notifyRequest)
 Set the subscription dialog information and cseq for the next NOTIFY request. More...
 
virtual UtlBoolean createNotifiesDialogInfo (const char *resourceId, const char *eventTypeKey, int &numNotifiesCreated, UtlString **&acceptHeaderValuesArray, SipMessage **&notifyArray)
 Construct a NOTIFY request for each subscription/dialog subscribed to the given resourceId and eventTypeKey. More...
 
virtual void freeNotifies (int numNotifies, UtlString **acceptHeaderValues, SipMessage **notifiesArray)
 frees up the notifies created in createNotifiesDialogInfo More...
 
virtual UtlBoolean endSubscription (const UtlString &dialogHandle)
 End the dialog for the subscription indicated, by the dialog handle. More...
 
int dumpOldSubscriptions (long oldEpochTimeSeconds)
 Dump to syslog states considered old. More...
 
int removeOldSubscriptions (long oldEpochTimeSeconds)
 Remove old subscriptions that expired before given date. More...
 
void setMaxExpiration (int expiresSeconds)
 Set maximum subscription period in seconds. More...
 
SipDialogMgrgetDialogMgr ()
 Get the dialog manager. More...
 
int getStateCount ()
 Get count of subscription states/dialogs being managed. More...
 
virtual UtlBoolean dialogExists (UtlString &dialogHandle)
 inquire if the dialog exists More...
 
virtual UtlBoolean isExpired (UtlString &dialogHandle)
 inquire if the dialog has already expired More...
 

Detailed Description

Class for maintaining SUBSCRIBE dialog information in subscription server.

Constructor & Destructor Documentation

Default constructor.

~SipSubscriptionMgr ( )
virtual

Destructor.

Member Function Documentation

UtlBoolean updateDialogInfo ( const SipMessage subscribeRequest,
const UtlString &  resourceId,
const UtlString &  eventTypeKey,
OsMsgQ *  subscriptionTimeoutQueue,
UtlString &  subscribeDialogHandle,
UtlBoolean &  isNew,
UtlBoolean &  isExpired,
SipMessage subscribeResponse 
)
virtual

Add/Update subscription for the given SUBSCRIBE request.

UtlBoolean getNotifyDialogInfo ( const UtlString &  subscribeDialogHandle,
SipMessage notifyRequest 
)
virtual

Set the subscription dialog information and cseq for the next NOTIFY request.

UtlBoolean createNotifiesDialogInfo ( const char *  resourceId,
const char *  eventTypeKey,
int &  numNotifiesCreated,
UtlString **&  acceptHeaderValuesArray,
SipMessage **&  notifyArray 
)
virtual

Construct a NOTIFY request for each subscription/dialog subscribed to the given resourceId and eventTypeKey.

Allocates a SipMessage* array and allocates a SipMessage and sets the dialog information for the NOTIFY request for each subscription.

Parameters
numNotifiesCreated- number of pointers to NOTIFY requests in the returned notifyArray
notifyArray- if numNotifiesCreated > 0 array is allocated of sufficient size to hold a SipMessage for each subscription.
void freeNotifies ( int  numNotifies,
UtlString **  acceptHeaderValues,
SipMessage **  notifiesArray 
)
virtual

frees up the notifies created in createNotifiesDialogInfo

UtlBoolean endSubscription ( const UtlString &  dialogHandle)
virtual

End the dialog for the subscription indicated, by the dialog handle.

Finds a matching dialog and expires the subscription if it has not already expired.

Parameters
dialogHandle- a fully established SIP dialog handle Returns TRUE if a matching dialog was found regardless of whether the subscription was already expired or not.
int dumpOldSubscriptions ( long  oldEpochTimeSeconds)

Dump to syslog states considered old.

int removeOldSubscriptions ( long  oldEpochTimeSeconds)

Remove old subscriptions that expired before given date.

void setMaxExpiration ( int  expiresSeconds)

Set maximum subscription period in seconds.

SipDialogMgr * getDialogMgr ( )

Get the dialog manager.

WARNING: the application must be aware of the lifetime of the dialog manager, as no reference counting is done on the dialog manager. The application is responsible for knowing when the dialog manager will go way.

int getStateCount ( )

Get count of subscription states/dialogs being managed.

UtlBoolean dialogExists ( UtlString &  dialogHandle)
virtual

inquire if the dialog exists

UtlBoolean isExpired ( UtlString &  dialogHandle)
virtual

inquire if the dialog has already expired


sipXtackLib home page