HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
266 HP-UX C SIP Stack Programmer’s Guide
Support for Subscription Forking
SUBSCRIPTION
F
ORKING EVENTS
The Subscription API includes the following event for forking-support
implementation.
RvSipSubsCreatedDueToForkingEv()
A NOTIFY request that is received as a result of SUBSCRIBE sending may
create a forked subscription. This event informs the user of the creation of a new
forked subscription, and exchanges handle with the application. If the user does
not wish to handle this forked subscription, the user can indicate that the
SIP Stack should terminate the new forked subscription. In this case, the new
(forked) subscription will be destructed immediately. Otherwise, the new forked
subscription will handle the NOTIFY request, update its state machine, send a
200 response to the request, and call to all the regular subscription callback
functions.
SUBSCRIPTION
FORKING API
The Subscription API includes the following set of functions dedicated to
forking-support implementation.
RvSipSubsGetOriginalSubs()
Returns the handle to the original subscription that is related to a given forked
subscription. If the given subscription is an original subscription, NULL will be
returned.
RvSipSubsSetForkingEnabledFlag(), RvSipSubsGetForkingEnabledFlag()
Functions for setting/getting the subscription forking-enabled flag. The forking-
enabled-flag defines the subscription behavior on receiving multiple NOTIFY
request due to proxy forking of the initial SUBSCRIBE request.
If this flag is set to TRUE in the original subscription, a new forked subscription
will be created for every NOTIFY request. If this flag is set to FALSE in the
original subscription, only completely matched NOTIFY requests will be
handled by the subscription. Other NOTIFY requests will be rejected with a 481
response code. The default value for the forking-enabled flag is RV_TRUE.
SUBSCRIPTION
F
ORKING STATE
M
ACHINE
The Forked Subscription state machine is identical to the Subscription state
machine in Figure 12-3 with one exception—a forked subscription moves from
the IDLE state directly to the 2XX_RCVD state immediately after the
RvSipSubsCreatedDueToForkingEv() callback is called. Since a forked
subscription did not initiate the SUBSCRIBE request, it will never receive a
2XX response for it and therefore will never assume the SUBS_SENT,
REDIRECTED and NOTIFY_BEFORE_2XX_RCVD states.