HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

REFER 275
REFER-Subscription API
REFER-
S
UBSCRIPTION EVENTS
The following callback function was added to the Subscription layer for REFER
control:
RvSipSubsReferNotifyReadyEv()
This event informs the application that it should send a NOTIFY request on a
refer-subscription. The callback is called in the following three stages:
Immediately after accepting a REFER request. At this point the
application should send the initial NOTIFY request.
After a provisional response was received from the referenced
party. At this point the application should send a NOTIFY
request indicating that a provisional response was received.
After a final response was received from the referenced party.
At this point the application should send a NOTIFY that
includes the final status of the reference attempt. If, however,
the object that was used to contact the referenced party was
terminated with an error before a final response was received,
the callback will also be called and the application should send
a NOTIFY that indicates this failure.
This callback function supplies you with a reason that indicates at which stage
the subscription currently is, and the status code that should be set in the body of
the NOTIFY request.
When this callback is called, the application should send a NOTIFY request
using the following steps:
1. Create a notification in the refer-subscription, using
RvSipSubsCreateNotify().
2. Set the Subscription-State header in the NOTIFY request,
using RvSipNotifySetSubscriptionStateParams(). In the final
notify request (stage 3), the Subscription-State header value
should be “terminated”. Elsewhere it should be “active”.
3. Set the correct body in the NOTIFY request, using
RvSipNotifySetReferNotifyBody(). You should supply this
function the status code supplied by this callback function.
4. Use the Notify object to send the NOTIFY request using
RvSipNotifySend().
REFER COMPLETE
P
ROCESS FLOW
Figure 13-1 illustrates a complete REFER scenario in an established call.