HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
REFER 273
REFER-Subscription API
RvSipSubsReferInit()
Initializes a subscription with the Refer-To and Referred-By headers. To send a
REFER Request, you must first create a subscription using the
RvSipSubsMgrCreateSubscription() function. If the subscription is not in the
context of an existing dialog, you must also initialize the To and From headers
of the subscription and optionally initialize its contact addresses using the
RvSipSubsDialogInit() function. Only then is the subscription ready for REFER
initialization. By calling the RvSipSubsReferInit() function, you can set both
Refer-To and Referred-By headers to the refer-subscription. The Referred-By
header is optional and you can supply NULL if you do not wish to use it. Both
headers will be copied to the outgoing REFER request.
RvSipSubsReferInitStr()
Has the same functionality as the RvSipSubsReferInit() function. This function
initializes a subscription with the Refer-To and Referred-By headers. However,
when calling RvSipSubsReferInitStr(), you supply the Refer-To and the
Referred-By headers in string format. You may also supply a Replaces header
string that the SIP Stack will set in the Refer-To header.
RvSipSubsRefer()
Generates and sends a REFER message. After creating a subscription and
initializing it with the necessary information, including the Refer-To header and
optionally the Referred-By header, you can call the RvSipSubsRefer() function.
Calling this function will cause a REFER request to be sent to the remote party.
The REFER request will include the Refer-To and Referred-by headers that you
set to the refer-subscription. After sending the REFER request, the subscription
will assume the RVSIP_SUBS_STATE_SUBS_SENT state.
RvSipSubsReferAccept()
Generates and sends a 202 response to an incoming REFER request. When a
REFER message is received, a new refer-subscription is created and the
RvSipSubsCreatedEv() callback is called. The refer-subscription then changes
its state to RVSIP_SUBS_STATE_SUBS_RCVD with the
RVSIP_SUBS_REASON_REFER_RCVD reason. At this point, the application
can call the RvSipSubsReferAccept() function and accept the REFER request.
Calling RvSipSubsReferAccept() causes a 202 response to be sent to the remote
party. This function also returns a handle to a newly created object that will be
used to contact the referenced party. In a typical situation, a call-leg will be