Module livekit.api.sip_service

Global variables

var SVC

@private

Classes

class CreateSIPDispatchRuleRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var AttributesEntry

A ProtocolMessage

var DESCRIPTOR
class CreateSIPInboundTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class CreateSIPOutboundTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class CreateSIPParticipantRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
var HeadersEntry

A ProtocolMessage

var ParticipantAttributesEntry

A ProtocolMessage

class CreateSIPTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class DeleteSIPDispatchRuleRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class DeleteSIPTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPDispatchRuleRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPDispatchRuleResponse (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPInboundTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPInboundTrunkResponse (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPOutboundTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPOutboundTrunkResponse (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPTrunkRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class ListSIPTrunkResponse (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class SIPDispatchRuleInfo (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var AttributesEntry

A ProtocolMessage

var DESCRIPTOR
class SIPInboundTrunkInfo (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var AttributesToHeadersEntry

A ProtocolMessage

var DESCRIPTOR
var HeadersEntry

A ProtocolMessage

var HeadersToAttributesEntry

A ProtocolMessage

class SIPOutboundTrunkInfo (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var AttributesToHeadersEntry

A ProtocolMessage

var DESCRIPTOR
var HeadersEntry

A ProtocolMessage

var HeadersToAttributesEntry

A ProtocolMessage

class SIPParticipantInfo (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class SIPTrunkInfo (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
class SipService (session: aiohttp.client.ClientSession, url: str, api_key: str, api_secret: str)
Expand source code
class SipService(Service):
    """Client for LiveKit SIP Service API

    Recommended way to use this service is via `livekit.api.LiveKitAPI`:

    ```python
    from livekit import api
    lkapi = api.LiveKitAPI()
    sip_service = lkapi.sip
    ```
    """

    def __init__(
        self, session: aiohttp.ClientSession, url: str, api_key: str, api_secret: str
    ):
        super().__init__(session, url, api_key, api_secret)

    async def create_sip_trunk(self, create: CreateSIPTrunkRequest) -> SIPTrunkInfo:
        """
        @deprecated Use create_sip_inbound_trunk or create_sip_outbound_trunk instead
        """
        return await self._client.request(
            SVC,
            "CreateSIPTrunk",
            create,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPTrunkInfo,
        )

    async def create_sip_inbound_trunk(
        self, create: CreateSIPInboundTrunkRequest
    ) -> SIPInboundTrunkInfo:
        return await self._client.request(
            SVC,
            "CreateSIPInboundTrunk",
            create,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPInboundTrunkInfo,
        )

    async def create_sip_outbound_trunk(
        self, create: CreateSIPOutboundTrunkRequest
    ) -> SIPOutboundTrunkInfo:
        return await self._client.request(
            SVC,
            "CreateSIPOutboundTrunk",
            create,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPOutboundTrunkInfo,
        )

    async def list_sip_trunk(self, list: ListSIPTrunkRequest) -> ListSIPTrunkResponse:
        return await self._client.request(
            SVC,
            "ListSIPTrunk",
            list,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            ListSIPTrunkResponse,
        )

    async def list_sip_inbound_trunk(
        self, list: ListSIPInboundTrunkRequest
    ) -> ListSIPInboundTrunkResponse:
        return await self._client.request(
            SVC,
            "ListSIPInboundTrunk",
            list,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            ListSIPInboundTrunkResponse,
        )

    async def list_sip_outbound_trunk(
        self, list: ListSIPOutboundTrunkRequest
    ) -> ListSIPOutboundTrunkResponse:
        return await self._client.request(
            SVC,
            "ListSIPOutboundTrunk",
            list,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            ListSIPOutboundTrunkResponse,
        )

    async def delete_sip_trunk(self, delete: DeleteSIPTrunkRequest) -> SIPTrunkInfo:
        return await self._client.request(
            SVC,
            "DeleteSIPTrunk",
            delete,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPTrunkInfo,
        )

    async def create_sip_dispatch_rule(
        self, create: CreateSIPDispatchRuleRequest
    ) -> SIPDispatchRuleInfo:
        return await self._client.request(
            SVC,
            "CreateSIPDispatchRule",
            create,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPDispatchRuleInfo,
        )

    async def list_sip_dispatch_rule(
        self, list: ListSIPDispatchRuleRequest
    ) -> ListSIPDispatchRuleResponse:
        return await self._client.request(
            SVC,
            "ListSIPDispatchRule",
            list,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            ListSIPDispatchRuleResponse,
        )

    async def delete_sip_dispatch_rule(
        self, delete: DeleteSIPDispatchRuleRequest
    ) -> SIPDispatchRuleInfo:
        return await self._client.request(
            SVC,
            "DeleteSIPDispatchRule",
            delete,
            self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
            SIPDispatchRuleInfo,
        )

    async def create_sip_participant(
        self, create: CreateSIPParticipantRequest
    ) -> SIPParticipantInfo:
        return await self._client.request(
            SVC,
            "CreateSIPParticipant",
            create,
            self._auth_header(VideoGrants(), sip=SIPGrants(call=True)),
            SIPParticipantInfo,
        )

    async def transfer_sip_participant(
        self, transfer: TransferSIPParticipantRequest
    ) -> SIPParticipantInfo:
        return await self._client.request(
            SVC,
            "TransferSIPParticipant",
            transfer,
            self._auth_header(
                VideoGrants(
                    room_admin=True,
                    room=transfer.room_name,
                ),
                sip=SIPGrants(call=True),
            ),
            SIPParticipantInfo,
        )

Client for LiveKit SIP Service API

Recommended way to use this service is via LiveKitAPI:

from livekit import api
lkapi = api.LiveKitAPI()
sip_service = lkapi.sip

Ancestors

  • livekit.api._service.Service
  • abc.ABC

Methods

async def create_sip_dispatch_rule(self, create: sip.CreateSIPDispatchRuleRequest) ‑> sip.SIPDispatchRuleInfo
Expand source code
async def create_sip_dispatch_rule(
    self, create: CreateSIPDispatchRuleRequest
) -> SIPDispatchRuleInfo:
    return await self._client.request(
        SVC,
        "CreateSIPDispatchRule",
        create,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPDispatchRuleInfo,
    )
async def create_sip_inbound_trunk(self, create: sip.CreateSIPInboundTrunkRequest) ‑> sip.SIPInboundTrunkInfo
Expand source code
async def create_sip_inbound_trunk(
    self, create: CreateSIPInboundTrunkRequest
) -> SIPInboundTrunkInfo:
    return await self._client.request(
        SVC,
        "CreateSIPInboundTrunk",
        create,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPInboundTrunkInfo,
    )
async def create_sip_outbound_trunk(self, create: sip.CreateSIPOutboundTrunkRequest) ‑> sip.SIPOutboundTrunkInfo
Expand source code
async def create_sip_outbound_trunk(
    self, create: CreateSIPOutboundTrunkRequest
) -> SIPOutboundTrunkInfo:
    return await self._client.request(
        SVC,
        "CreateSIPOutboundTrunk",
        create,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPOutboundTrunkInfo,
    )
async def create_sip_participant(self, create: sip.CreateSIPParticipantRequest) ‑> sip.SIPParticipantInfo
Expand source code
async def create_sip_participant(
    self, create: CreateSIPParticipantRequest
) -> SIPParticipantInfo:
    return await self._client.request(
        SVC,
        "CreateSIPParticipant",
        create,
        self._auth_header(VideoGrants(), sip=SIPGrants(call=True)),
        SIPParticipantInfo,
    )
async def create_sip_trunk(self, create: sip.CreateSIPTrunkRequest) ‑> sip.SIPTrunkInfo
Expand source code
async def create_sip_trunk(self, create: CreateSIPTrunkRequest) -> SIPTrunkInfo:
    """
    @deprecated Use create_sip_inbound_trunk or create_sip_outbound_trunk instead
    """
    return await self._client.request(
        SVC,
        "CreateSIPTrunk",
        create,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPTrunkInfo,
    )

@deprecated Use create_sip_inbound_trunk or create_sip_outbound_trunk instead

async def delete_sip_dispatch_rule(self, delete: sip.DeleteSIPDispatchRuleRequest) ‑> sip.SIPDispatchRuleInfo
Expand source code
async def delete_sip_dispatch_rule(
    self, delete: DeleteSIPDispatchRuleRequest
) -> SIPDispatchRuleInfo:
    return await self._client.request(
        SVC,
        "DeleteSIPDispatchRule",
        delete,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPDispatchRuleInfo,
    )
async def delete_sip_trunk(self, delete: sip.DeleteSIPTrunkRequest) ‑> sip.SIPTrunkInfo
Expand source code
async def delete_sip_trunk(self, delete: DeleteSIPTrunkRequest) -> SIPTrunkInfo:
    return await self._client.request(
        SVC,
        "DeleteSIPTrunk",
        delete,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        SIPTrunkInfo,
    )
async def list_sip_dispatch_rule(self, list: sip.ListSIPDispatchRuleRequest) ‑> sip.ListSIPDispatchRuleResponse
Expand source code
async def list_sip_dispatch_rule(
    self, list: ListSIPDispatchRuleRequest
) -> ListSIPDispatchRuleResponse:
    return await self._client.request(
        SVC,
        "ListSIPDispatchRule",
        list,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        ListSIPDispatchRuleResponse,
    )
async def list_sip_inbound_trunk(self, list: sip.ListSIPInboundTrunkRequest) ‑> sip.ListSIPInboundTrunkResponse
Expand source code
async def list_sip_inbound_trunk(
    self, list: ListSIPInboundTrunkRequest
) -> ListSIPInboundTrunkResponse:
    return await self._client.request(
        SVC,
        "ListSIPInboundTrunk",
        list,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        ListSIPInboundTrunkResponse,
    )
async def list_sip_outbound_trunk(self, list: sip.ListSIPOutboundTrunkRequest) ‑> sip.ListSIPOutboundTrunkResponse
Expand source code
async def list_sip_outbound_trunk(
    self, list: ListSIPOutboundTrunkRequest
) -> ListSIPOutboundTrunkResponse:
    return await self._client.request(
        SVC,
        "ListSIPOutboundTrunk",
        list,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        ListSIPOutboundTrunkResponse,
    )
async def list_sip_trunk(self, list: sip.ListSIPTrunkRequest) ‑> sip.ListSIPTrunkResponse
Expand source code
async def list_sip_trunk(self, list: ListSIPTrunkRequest) -> ListSIPTrunkResponse:
    return await self._client.request(
        SVC,
        "ListSIPTrunk",
        list,
        self._auth_header(VideoGrants(), sip=SIPGrants(admin=True)),
        ListSIPTrunkResponse,
    )
async def transfer_sip_participant(self, transfer: sip.TransferSIPParticipantRequest) ‑> sip.SIPParticipantInfo
Expand source code
async def transfer_sip_participant(
    self, transfer: TransferSIPParticipantRequest
) -> SIPParticipantInfo:
    return await self._client.request(
        SVC,
        "TransferSIPParticipant",
        transfer,
        self._auth_header(
            VideoGrants(
                room_admin=True,
                room=transfer.room_name,
            ),
            sip=SIPGrants(call=True),
        ),
        SIPParticipantInfo,
    )
class TransferSIPParticipantRequest (*args, **kwargs)

A ProtocolMessage

Ancestors

  • google._upb._message.Message
  • google.protobuf.message.Message

Class variables

var DESCRIPTOR
var HeadersEntry

A ProtocolMessage