HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
REFER 281
Implementing REFER-related Application Callbacks
}
/* Accept incoming refer */
rv = RvSipSubsReferAccept(hSubs, NULL, eObjType, &eObjType, (void**)&hCallLeg);
if(rv != RV_OK)
{
printf("Failed to accept the refer request\n");
return;
}
/* Connect the new call-leg, to the refer-to party */
rv = RvSipCallLegConnect(hCallLeg);
if(rv != RV_OK)
{
printf("Failed to connect the new call\n");
return;
}
}
}
/*===================================================================================*/
RvSipSubsReferNotifyReadyEv() Callback Implementation
The following sample code is an implementation of the Notify-Ready event
callback. The sample demonstrates how to create, initialize and send a NOTIFY
request to the REFER initiator. This sample also checks the supplied reason, and
sets the NOTIFY parameters accordingly.
For example, if the reason is 1XX_RESPONSE_MSG_RCVD, the NOTIFY
request should include the following Subscription-State header:
“
Subscription-State: active;expires=50” and a message body that
includes the response code.
Sample Code
/*=========================================================================================*/
void RVCALLCONV AppSubsReferNotifyReadyEv(
IN RvSipSubsHandle hSubs,
IN RvSipAppSubsHandle hAppSubs,
IN RvSipSubsReferNotifyReadyReason eReason,
IN RvInt16 responseCode,
IN RvSipMsgHandle hResponseMsg)
{