Transaction layer

class sipua.TransactionLayer(transport_layer: TransportLayer)

SIP transaction layer, which handles matching responses to requests, retransmissions and timeouts.

See RFC 3261 Section 17.

request_handler: Callable[[Request], Coroutine[None, None, None]] | None

A coroutine which will be called whenever a request is received which creates a new server transaction.

async send_request(request: Request) Response

Send the request in a transaction and return the final response.

If a fatal transport error occurs, a 503 response will be returned.

If a timeout occurs, a 408 response will be returned.

async send_response(response: Response) None

Send the response.