Transport layer

class sipua.TransportLayer

SIP transport layer which handles the transmission of requests and responses over network transports.

See RFC 3261 Section 18.

async close() None

Close the transport layer.

async listen(address: TransportAddress) None

Start listening on the given transport address.

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

A coroutine which will be called whenever a request is received.

response_handler: Callable[[Response], Coroutine[None, None, None]] | None

A coroutine which will be called whenever a response is received.

async send_message(message: Message) bool

Send the given message and return whether the selected transport is reliable.

class sipua.TransportAddress(protocol: str, host: str, port: int)
host: str

The transport host, e.g. “127.0.0.1”.

port: int

The transport port, e.g. 5060.

protocol: str

The protocol, e.g. “udp”, “tcp” or “ws”.