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

124 HP-UX C SIP Stack Programmers Guide
Using Transactions
/*========================================================================*/
RvStatus AppSendOptionsRequest(RvSipTranscMgrHandle hMgr)
{
RvSipTranscHandle hTransc; /*Handle to the transaction.*/
RvStatus rv;
RvChar *strFrom = "From:sip:user1@172.20.0.1:5060";
RvChar *strTo = "To:sip:user2@172.20.10.11:5060";
RvChar *strRequestUri = "sip:172.20.0.1:5060";
RvChar *strMethod = "OPTIONS";
RvInt32 cseq = 5;
/*--------------------------
Creates a new transaction.
----------------------------*/
rv =
RvSipTranscMgrCreateTransaction(hMgr,NULL,&hTransc);
if(rv != RV_OK)
{
printf("Failed to create a new transaction");
return rv;
}
/*----------------------------------------------------
Sends the request by calling the “make” function.
-----------------------------------------------------*/
rv = RvSipTransactionMake(hTransc,
strFrom,
strTo,
strRequestUri,
cseq,
strMethod);
if(rv != RV_OK)
{
printf("Transaction Make failed");
return rv;
}
return RV_OK;
}
/*==========================================================================*/
USING THE OUTBOUND
M
ESSAGE MECHANISM
The following steps describes how to use the outbound message mechanism to
add the headers listed below to the 200 response of an OPTIONS request: