High level API

class sipua.Application

Convenience class to facilitate creating a SIP user agent.

async close() None

Close the transport layer.

async connect_websocket(addr: str) None

Establish an outgoing WebSocket connection.

async handle_request(request: Request) None

Handle a request which does not match an existing dialog.

You can override this by subclassing Application, for instance to handle incoming calls.

async listen(address: TransportAddress) None

Start listening on given transport address.

class sipua.Call

A SIP call with support for RTP.

async accept(request: Request) None

Accept an incoming call by sending a 200 response.

property audioTransceiver: RTCRtpTransceiver

The RTP transceiver used for audio.

classmethod create_uac(*, dialog_layer: DialogLayer, local_address: Address, remote_address: Address, route_set: list[Address] = [], **kwargs: object) T

Create a client dialog.

The initial request will neeed to be constructed using create_request().

classmethod create_uas(*, dialog_layer: DialogLayer, request: Request, **kwargs: object) T

Create a server dialog based on a received request.

async hangup() None

Hangup the call by sending a BYE request.

async invite(extra_headers: list[tuple[str, str]] = []) None

Make an outgoing call by sending an INVITE request.

If you wish to send additional headers in the INVITE, specify them in extra_headers.