HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
122 HP-UX C SIP Stack Programmer’s Guide
Using Transactions
/*===================================================================*/
void RVCALLCONV AppTransactionStateChangedEvHandler(
IN RvSipTranscHandle hTransc,
IN RvSipTranscOwnerHandle hAppTransc,
IN RvSipTransactionState eState,
IN RvSipTransactionStateChangeReason eReason)
{
RvStatus rv;
switch(eState)
{
case RVSIP_TRANSC_STATE_SERVER_GEN_REQUEST_RCVD:
rv = RvSipTransactionRespond(hTransc,200,NULL);
if(rv!= RV_OK)
{
printf("Failed to respond to the request");
}
break;
default:
break;
}
}
/*===================================================================*/
The following steps describe how to register your application callbacks.
To register application callbacks
1. Declare a RvSipTransactionEvHandlers structure.
2. Initialize all the structure members to zero using memset().
3. Set the application defined callback in
RvSipTransactionEvHandlers.
4. Call RvSipTransactionMgrSetEvHandlers().
Sample Code
The following code demonstrates an application implementation of callback
registration.