HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with Transactions 121
Using Transactions
/*==========================================================================*/
static void RVCALLCONV AppTransactionCreatedEvHandler(
IN RvSipTranscHandle hTransc,
IN void *context,
OUT RvSipTranscOwnerHandle *phAppTransc,
OUT RvBool *b_handleTransc)
{
RvChar strMethod[20];
*phAppTransc = NULL;
*b_handleTransc = RV_FALSE;
RvSipTransactionGetMethodStr(hTransc,20,strMethod);
if(strcmp(strMethod,”OPTIONS”) == 0)
{
*b_handleTransc = RV_TRUE;
}
}
/*==========================================================================*/
Sample Code
The following sample code demonstrates an implementation of the
RvSipTransactionStateChangedEv() callback function. Since, in the above
sample code, the application requested to handle only the OPTIONS requests, it
will be notified of the state of the OPTIONS transactions only. (Therefore there
is no need to query the transaction method again.) In this sample, the
application responds with 200 to the request.