HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with Transactions 123
Using Transactions
/*==================================================================================*/
void SetTransactionEvHandlers(RvSipTranscMgrHandle hMgr)
{
/*step 1*/
RvSipTransactionEvHandlers appEvHandlers;
/*step 2*/
memset(&appEvHandlers,0,sizeof (RvSipTransactionEvHandlers));
/*step 3*/
appEvHandlers.pfnEvTransactionCreated = AppTransactionCreatedEvHandler;
appEvHandlers.pfnEvStateChanged = AppTransactionStateChangedEvHandler;
/*step 4*/
RvSipTransactionMgrSetEvHandlers(hMgr,NULL,&appEvHandlers,
sizeof(RvSipTransactionEvHandlers));
}
/*==================================================================================*/
EXCHANGING H ANDLES
WITH THE APPLICATION
If you wish to handle a transaction, you become the owner of the transaction
and you can create your own handle to the transaction. This will prove useful
when you have your own application transactions database.
You can provide the SIP Stack with your transaction handle, which it must
supply when calling your application callbacks.
You can use the RvSipTranscMgrCreateTransaction() API function to exchange
handles for a client transaction and the RvSipTransactionCreatedEv() callback
to exchange handles for a server transaction.
SENDING A REQUEST The following steps describe how to send a request.
To send a request
1. Declare a handle for the new transaction.
2. Call the RvSipTranscMgrCreateTransaction() function. This
enables you to exchange handles with the SIP Stack.
3. Call the RvSipTransactionMake() function. This function
sends the request to the remote party.
Sample Code
The following code demonstrates an implementation of a call request.