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

262 HP-UX C SIP Stack Programmers Guide
Out-of-Band Subscription
/*=========================================================================================*/
void AppCreateOutOfBandSubscription(
RvSipSubsMgrHandle hSubsMgr,
RvSipCallLegHandle hCallLeg,
RvSipSubscriptionType eSubsType,
RvChar* strEvent)
{
RvSipSubsHandle hSubs;
RvStatus rv;
RvSipEventHeaderHandle hEvent;
/*-----------------------------------
Creates an out-of-band subscription.
-------------------------------------*/
rv = RvSipSubsMgrCreateOutOfBandSubscription(hSubsMgr, hCallLeg, NULL, eSubsType, &hSubs);
if(rv != RV_OK)
{
printf("RvSipSubsMgrCreateOutOfBandSubscription failed");
return;
}
printf("An out-of-band subscription %x was created\n",hSubs);
/*------------------------------------------------------
Creates an Event header and sets it in the subscription.
--------------------------------------------------------*/
rv = RvSipSubsGetNewHeaderHandle(hSubs, RVSIP_HEADERTYPE_EVENT, (void**)&hEvent);
if(rv != RV_OK)
{
printf("RvSipSubsGetNewHeaderHandle failed ");
return;
}
rv = RvSipEventHeaderParseValue(hEvent, strEvent);
if(rv != RV_OK)
{
printf("RvSipEventHeaderParseValue failed ");
return;
}
rv = RvSipSubsSetEventHeader(hSubs, hEvent);
if(rv != RV_OK)
{