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

Advanced Features 365
Extension Support
Sample Code
The following sample code demonstrates how to identify and reject a request
with an unsupported extension when working with the Transaction layer. The
request is handled in the context of the transaction state changed callback.
/*===================================================================================*/
void RVCALLCONV AppTransactionStateChangedEvHandler(
IN RvSipTranscHandle hTransc,
IN RvSipTranscOwnerHandle hAppTransc,
IN RvSipTransactionState eState,
IN RvSipTransactionStateChangeReason eReason)
{
RvBool bIsUnsupportedRequired = RV_FALSE;
switch(eState)
{
case RVSIP_TRANSC_STATE_SERVER_GEN_REQUEST_RCVD:
RvSipTransactionIsUnsupportedExtRequired(hTransc,&bIsUnsupportedRequired);
if(bIsUnsupportedRequired == RV_TRUE)
{
RvSipTransactionRespond(hTransc,420,NULL);
}
else
{
RvSipTransactionRespond(hTransc,200,NULL);
}
break;
default:
break;
}
}
/*===================================================================================*/