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

Working with Transactions 91
7
WORKING WITH TRANSACTIONS
INTRODUCTION A SIP transaction comprises all messages, from the first request sent by the
client to the server to a final (non-1xx) response to the request sent by the server
to the client.
The Transaction API of the SIP Stack contains a set of functions and function
callbacks that can be used for two purposes. The first is for handling
transactions that are related to the User Agent (UA) and not related to a call-leg.
An example of such a transaction is OPTIONS.
Using the Transaction API, you can create and initialize a transaction and
control a transaction according to the transaction state. You can create a
transaction with any method (except CANCEL and ACK that have a dedicated
API).
Note In order to send a transaction that is related to a call-leg, you should use
the Call-leg API. For more information, see the Working with Call-legs (Dialogs)
chapter.
The second purpose of the Transaction API is for writing a SIP server. Using the
Transaction API, you can implement a Proxy server, Redirect server and
Registrar. You can receive incoming requests and decide whether to redirect or
proxy the request according to the request method and the transaction state. The
Transaction API contains a set of functions and states dedicated specifically for
the purpose of writing a Proxy server. Using these functions, you can fully
implement both stateless and stateful proxies.