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

Working with Transactions 125
Using Transactions
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
Accept: application
Accept-Encoding: gzip
To add the headers
1. Get the outbound message from the transaction using the
RvSipTransactionGetOutboundMsg() function.
2. Use the message API functions to add the above headers.
3. Send the 200 response using the RvSipTransactionRespond()
function.
Sample Code
The following code demonstrates the steps described above.
Note The different fields of the Allow header should be added as separate Allow
headers. However, when the message is encoded, all the methods are gathered in
one Allow header.
Note In this sample, the return value of the Stack API functions is not checked
for simplicity. You must always check return values.
*/==================================================================================*/
void RVCALLCONV AppTransactionStateChangedEvHandler(
IN RvSipTranscHandle hTransc,
IN RvSipTranscOwnerHandle hAppTransc,
IN RvSipTransactionState eState,
IN RvSipTransactionStateChangeReason eReason)
{
RvSipMsgHandle hMsg = NULL;
RvSipOtherHeaderHandle hHeader;
RvSipAllowHeaderHandle hAllow;
switch(eState)
{
case RVSIP_TRANSC_STATE_SERVER_GEN_REQUEST_RCVD: