sipxtacklib
Version 3.3
|
Class for containing SIP dialog state information. More...
#include <SipSubscribeClient.h>
Public Types | |
enum | SubscriptionState { SUBSCRIPTION_UNKNOWN, SUBSCRIPTION_INITIATED, SUBSCRIPTION_SETUP, SUBSCRIPTION_FAILED, SUBSCRIPTION_TERMINATED } |
typedef void(* | SubscriptionStateCallback) (SipSubscribeClient::SubscriptionState newState, const char *earlyDialogHandle, const char *dialogHandle, void *applicationData, int responseCode, const char *responseText, long expiration, const SipMessage *subscribeResponse) |
typedef void(* | NotifyEventCallback) (const char *earlyDialogHandle, const char *dialogHandle, void *applicationData, const SipMessage *notifyRequest) |
Public Member Functions | |
SipSubscribeClient (SipUserAgent &userAgent, SipDialogMgr &dialogMgr, SipRefreshManager &refreshMgr) | |
Default Dialog constructor. More... | |
virtual | ~SipSubscribeClient () |
Destructor. More... | |
UtlBoolean | addSubscription (const char *resourceId, const char *eventHeaderValue, const char *acceptHeaderValue, const char *fromFieldValue, const char *toFieldValue, const char *contactFieldValue, int subscriptionPeriodSeconds, void *applicationData, const SubscriptionStateCallback subscriptionStateCallback, const NotifyEventCallback notifyEventsCallback, UtlString &earlyDialogHandle) |
Create a SIP event subscription for the given SUBSCRIBE header information. More... | |
UtlBoolean | addSubscription (SipMessage &subscriptionRequest, void *applicationData, const SubscriptionStateCallback subscriptionStateCallback, const NotifyEventCallback notifyEventsCallback, UtlString &earlyDialogHandle) |
Create a SIP event subscription for the given SUBSCRIBE request. More... | |
UtlBoolean | endSubscription (const char *dialogHandle) |
End the SIP event subscription indicated by the dialog handle. More... | |
void | endAllSubscriptions () |
End all subscriptions. More... | |
UtlBoolean | handleMessage (OsMsg &eventMessage) |
Handler for NOTIFY requests. More... | |
int | dumpStates (UtlString &dumpString) |
Create a debug dump of all the client states. More... | |
int | countSubscriptions () |
Get a count of the subscriptions which have been added. More... | |
Static Public Member Functions | |
static SipSubscribeClient * | buildBasicClient (SipUserAgent &userAgent) |
Create a SipDialogMgr, SipRefreshManager and construct a SipSubscribeClient. More... | |
static void | getSubscriptionStateEnumString (enum SubscriptionState stateValue, UtlString &stateString) |
Get a string representation of the client state enumeration. More... | |
Class for containing SIP dialog state information.
In SIP a dialog is defined by the SIP Call-Id header and the tag parameter from the SIP To and From header fields. An early dialog has has only the tag set on one side, the transaction originator side. In the initial transaction the the originator tag in in the From header field. The final destination sets the To header field tag in the initial transaction.
typedef void(* SubscriptionStateCallback) (SipSubscribeClient::SubscriptionState newState, const char *earlyDialogHandle, const char *dialogHandle, void *applicationData, int responseCode, const char *responseText, long expiration, const SipMessage *subscribeResponse) |
typedef void(* NotifyEventCallback) (const char *earlyDialogHandle,const char *dialogHandle,void *applicationData, const SipMessage *notifyRequest) |
enum SubscriptionState |
SipSubscribeClient | ( | SipUserAgent & | userAgent, |
SipDialogMgr & | dialogMgr, | ||
SipRefreshManager & | refreshMgr | ||
) |
Default Dialog constructor.
|
virtual |
Destructor.
|
static |
Create a SipDialogMgr, SipRefreshManager and construct a SipSubscribeClient.
UtlBoolean addSubscription | ( | const char * | resourceId, |
const char * | eventHeaderValue, | ||
const char * | acceptHeaderValue, | ||
const char * | fromFieldValue, | ||
const char * | toFieldValue, | ||
const char * | contactFieldValue, | ||
int | subscriptionPeriodSeconds, | ||
void * | applicationData, | ||
const SubscriptionStateCallback | subscriptionStateCallback, | ||
const NotifyEventCallback | notifyEventsCallback, | ||
UtlString & | earlyDialogHandle | ||
) |
Create a SIP event subscription for the given SUBSCRIBE header information.
Returns TRUE if the SUBSCRIBE request was sent and the Subscription state proceeded to SUBSCRIPTION_INITIATED. Returns FALSE if the SUBSCRIBE request was not able to be sent, the subscription state is set to SUSCRIPTION_FAILED.
UtlBoolean addSubscription | ( | SipMessage & | subscriptionRequest, |
void * | applicationData, | ||
const SubscriptionStateCallback | subscriptionStateCallback, | ||
const NotifyEventCallback | notifyEventsCallback, | ||
UtlString & | earlyDialogHandle | ||
) |
Create a SIP event subscription for the given SUBSCRIBE request.
Returns TRUE if the SUBSCRIBE request was sent and the Subscription state proceeded to SUBSCRIPTION_INITIATED. Returns FALSE if the SUBSCRIBE request was not able to be sent, the subscription state is set to SUSCRIPTION_FAILED.
UtlBoolean endSubscription | ( | const char * | dialogHandle | ) |
End the SIP event subscription indicated by the dialog handle.
If the given dialogHandle is an early dialog it will end any established or early dialog subscriptions. Typically the application SHOULD use the established dialog handle. This method can also be used to end one of the dialogs if multiple subsription dialogs were created as a result of a single subscribe request. The application will get multiple SUBSCRIPTION_SETUP SubscriptionStateCallback events when multiple dialogs are created as a result of a single SUBSCRIBE. To end one of the subscriptions the application should use the setup dialogHandle provided by the SubscriptionStateCallback.
void endAllSubscriptions | ( | ) |
End all subscriptions.
UtlBoolean handleMessage | ( | OsMsg & | eventMessage | ) |
Handler for NOTIFY requests.
int dumpStates | ( | UtlString & | dumpString | ) |
Create a debug dump of all the client states.
|
static |
Get a string representation of the client state enumeration.
int countSubscriptions | ( | ) |
Get a count of the subscriptions which have been added.