<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [sip.js](./sip.js.md) &gt; [Transaction](./sip.js.transaction.md)

## Transaction class

Transaction.

<b>Signature:</b>

```typescript
export declare abstract class Transaction extends EventEmitter 
```

## Remarks

SIP is a transactional protocol: interactions between components take place in a series of independent message exchanges. Specifically, a SIP transaction consists of a single request and any responses to that request, which include zero or more provisional responses and one or more final responses. In the case of a transaction where the request was an INVITE (known as an INVITE transaction), the transaction also includes the ACK only if the final response was not a 2xx response. If the response was a 2xx, the ACK is not considered part of the transaction. https://tools.ietf.org/html/rfc3261\#section-17

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(\_transport, \_user, \_id, \_state, loggerCategory)](./sip.js.transaction._constructor_.md) |  | Constructs a new instance of the <code>Transaction</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [id](./sip.js.transaction.id.md) |  | <code>string</code> | Transaction id. |
|  [kind](./sip.js.transaction.kind.md) |  | <code>string</code> | Transaction kind. Deprecated. |
|  [logger](./sip.js.transaction.logger.md) |  | <code>Logger</code> |  |
|  [state](./sip.js.transaction.state.md) |  | <code>TransactionState</code> | Transaction state. |
|  [transport](./sip.js.transaction.transport.md) |  | <code>Transport</code> | Transaction transport. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [dispose()](./sip.js.transaction.dispose.md) |  | Destructor. Once the transaction is in the "terminated" state, it is destroyed immediately and there is no need to call <code>dispose</code>. However, if a transaction needs to be ended prematurely, the transaction user may do so by calling this method (for example, perhaps the UA is shutting down). No state transition will occur upon calling this method, all outstanding transmission timers will be cancelled, and use of the transaction after calling <code>dispose</code> is undefined. |
|  [logTransportError(error, message)](./sip.js.transaction.logtransporterror.md) |  |  |
|  [on(name, callback)](./sip.js.transaction.on.md) |  | Subscribe to 'stateChanged' event. |
|  [onTransportError(error)](./sip.js.transaction.ontransporterror.md) |  |  |
|  [send(message)](./sip.js.transaction.send.md) |  | Pass message to transport for transmission. If transport fails, the transaction user is notified by callback to onTransportError(). |
|  [setState(state)](./sip.js.transaction.setstate.md) |  |  |
|  [typeToString()](./sip.js.transaction.typetostring.md) |  |  |

