HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
256 HP-UX C SIP Stack Programmer’s Guide
Exchanging Handles with the Application
RVSIP_SUBS_NOTIFY_STATUS_REQUEST_SENT
Upon sending a NOTIFY request, the notification informs the application of the
Request-Sent status. At this stage, the notification waits for a response.
RVSIP_SUBS_NOTIFY_STATUS_FINAL_RESPONSE_SENT
Upon sending a NOTIFY response, the notification informs the application of
the Final-Response-Sent status. After this, the notification is terminated and the
application is informed of the Terminated status.
EXCHANGING
H
ANDLES WITH THE
APPLICATION
The SIP Stack enables you to create your own handle to a subscription. This will
prove useful when you have your own application subscription database. You
can provide the SIP Stack with your subscription handle, which the Stack must
supply when calling your application callbacks.
You can use RvSipSubsMgrCreateSubscription() to exchange handles for
subscriber subscriptions and RvSipSubsCreatedEv() to exchange handles for
notifier subscription.
INITIATING A
S
UBSCRIPTION
The following steps describe how to initiate a subscription:
To initiate a subscription
1. Declare a handle for the new subscription.
2. Call RvSipSubsMgrCreateSubscription(). This function
enables you to exchange handles with the SIP Stack.
3. Call RvSipSubsInit() or RvSipSubsInitStr(). These functions
initialize the subscription with To, From, Event and Expires
headers.
4. Call RvSipSubsRvSipSubsSubscribe(). This function sends a
SUBSCRIBE request to the remote party.
Sample Code
The following sample code demonstrates an implementation of the subscription
creation procedure.
/*==================================================================================*/
void AppCreateSubscription(IN RvSipSubsMgrHandle hSubsMgr)
{
/*The handle to the subscription.*/
RvSipSubsHandle hSubs;