HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
232 HP-UX C SIP Stack Programmer’s Guide
SIP Stack Event Notification Feature
Since the application is aware of the resource state it is under, its responsibility
is to initiate the NOTFIY messages in all situations. The SIP Stack does not
send Notify messages automatically. For example, after accepting a
SUBSCRIBE request, the application must immediately send a NOTIFY
request.
SUBSCRIPTION
E
NTITIES
The Subscription API of the SIP Stack relates to the following entities:
Subscription Manager (SubscriptionMgr)
Subscription (subscription)
Notification (notification)
S
UBSCRIPTION MANAGER The SubscriptionMgr manages the collection of all subscriptions and
notifications. The SubscriptionMgr is mainly used for creating new
subscriptions.
S
UBSCRIPTION A subscription represents a SIP Subscription as defined in RFC 3265. A
subscription is associated with a dialog. (Every subscription must be related to a
dialog. A dialog, however, may hold several subscriptions.) A subscription can
be created inside a call-leg, using the call-leg dialog, or it can be created
independently with its own dialog.
A subscription is uniquely identified by the Call-ID, From and To headers which
identify the dialog, and by the Event header which identifies the subscription in
this dialog. Your application can create a subscription, refresh it, send
notifications and terminate it using the Subscription API.
A subscription is a stateful object that can assume any state from a set defined in
the Subscription API. A subscription state represents the state of the
subscription setup between two SIP User Agents.
N
OTIFICATION A notification manages the NOTIFY request and NOTIFY response. Each
subscription holds a list of notifications. The notifications hold the notify
transaction and inform of the notification status.
A notification exists as long as the notify transaction exists. After sending or
receiving a response for the NOTIFY request, the notification is destructed, and
removed from subscription list.
Your application can initiate notification, send NOTIFY requests and respond to
incoming NOTIFY requests using the Subscription Notify API.
Figure 12-2 shows the relationship of the objects. (Note that hCallLeg in the
subscription represents a dialog.)