From 86b95bfcab686de5c452d42e9cdbfcbeda96a882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Tue, 16 Apr 2024 22:54:36 +0200 Subject: [PATCH 1/3] export sip stuff --- livekit-api/livekit/api/__init__.py | 1 + livekit-api/livekit/api/livekit_api.py | 6 ++++++ livekit-protocol/livekit/protocol/__init__.py | 3 ++- livekit-rtc/livekit/rtc/__init__.py | 3 ++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/livekit-api/livekit/api/__init__.py b/livekit-api/livekit/api/__init__.py index ad035c0b..fe07d3cb 100644 --- a/livekit-api/livekit/api/__init__.py +++ b/livekit-api/livekit/api/__init__.py @@ -21,6 +21,7 @@ from livekit.protocol.models import * from livekit.protocol.room import * from livekit.protocol.webhook import * +from livekit.protocol.sip import * from .twirp_client import TwirpError, TwirpErrorCode from .livekit_api import LiveKitAPI diff --git a/livekit-api/livekit/api/livekit_api.py b/livekit-api/livekit/api/livekit_api.py index bfb5be80..efe00ff8 100644 --- a/livekit-api/livekit/api/livekit_api.py +++ b/livekit-api/livekit/api/livekit_api.py @@ -3,6 +3,7 @@ from .room_service import RoomService from .egress_service import EgressService from .ingress_service import IngressService +from .sip_service import SipService from typing import Optional @@ -29,6 +30,7 @@ def __init__( self._room = RoomService(self._session, url, api_key, api_secret) self._ingress = IngressService(self._session, url, api_key, api_secret) self._egress = EgressService(self._session, url, api_key, api_secret) + self._sip = SipService(self._session, url, api_key, api_secret) @property def room(self): @@ -42,5 +44,9 @@ def ingress(self): def egress(self): return self._egress + @property + def sip(self): + return self._sip + async def aclose(self): await self._session.close() diff --git a/livekit-protocol/livekit/protocol/__init__.py b/livekit-protocol/livekit/protocol/__init__.py index aeb26522..b6e0b419 100644 --- a/livekit-protocol/livekit/protocol/__init__.py +++ b/livekit-protocol/livekit/protocol/__init__.py @@ -5,4 +5,5 @@ from . import models from . import room from . import webhook -from .version import __version__ \ No newline at end of file +from . import sip +from .version import __version__ diff --git a/livekit-rtc/livekit/rtc/__init__.py b/livekit-rtc/livekit/rtc/__init__.py index 5242cf8c..e556e187 100644 --- a/livekit-rtc/livekit/rtc/__init__.py +++ b/livekit-rtc/livekit/rtc/__init__.py @@ -39,7 +39,7 @@ KeyProviderOptions, ) from .participant import LocalParticipant, Participant, RemoteParticipant -from .room import ConnectError, DataPacket, Room, RoomOptions, RtcConfiguration +from .room import ConnectError, DataPacket, Room, RoomOptions, RtcConfiguration, SipDTMF from .track import ( AudioTrack, LocalAudioTrack, @@ -90,6 +90,7 @@ "Room", "RoomOptions", "RtcConfiguration", + "SipDTMF", "DataPacket", "LocalAudioTrack", "LocalVideoTrack", From 466c39acf786b2e0d01ae062abc63b89e17460f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Tue, 16 Apr 2024 22:55:38 +0200 Subject: [PATCH 2/3] fmt --- livekit-rtc/livekit/rtc/room.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/livekit-rtc/livekit/rtc/room.py b/livekit-rtc/livekit/rtc/room.py index 2221eb41..16141e7f 100644 --- a/livekit-rtc/livekit/rtc/room.py +++ b/livekit-rtc/livekit/rtc/room.py @@ -82,9 +82,9 @@ class RoomOptions: class DataPacket: data: bytes kind: proto_room.DataPacketKind.ValueType - participant: Optional[RemoteParticipant] = ( - None # None when the data has been sent by a server SDK - ) + participant: Optional[ + RemoteParticipant + ] = None # None when the data has been sent by a server SDK topic: Optional[str] = None @@ -92,9 +92,9 @@ class DataPacket: class SipDTMF: code: int digit: str - participant: Optional[RemoteParticipant] = ( - None # None when the data has been sent by a server SDK - ) + participant: Optional[ + RemoteParticipant + ] = None # None when the data has been sent by a server SDK class ConnectError(Exception): From d6d4b292200bd0ffb49302ff4544ad36addc5220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Tue, 16 Apr 2024 22:58:35 +0200 Subject: [PATCH 3/3] Revert "fmt" This reverts commit 466c39acf786b2e0d01ae062abc63b89e17460f2. --- livekit-rtc/livekit/rtc/room.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/livekit-rtc/livekit/rtc/room.py b/livekit-rtc/livekit/rtc/room.py index 16141e7f..2221eb41 100644 --- a/livekit-rtc/livekit/rtc/room.py +++ b/livekit-rtc/livekit/rtc/room.py @@ -82,9 +82,9 @@ class RoomOptions: class DataPacket: data: bytes kind: proto_room.DataPacketKind.ValueType - participant: Optional[ - RemoteParticipant - ] = None # None when the data has been sent by a server SDK + participant: Optional[RemoteParticipant] = ( + None # None when the data has been sent by a server SDK + ) topic: Optional[str] = None @@ -92,9 +92,9 @@ class DataPacket: class SipDTMF: code: int digit: str - participant: Optional[ - RemoteParticipant - ] = None # None when the data has been sent by a server SDK + participant: Optional[RemoteParticipant] = ( + None # None when the data has been sent by a server SDK + ) class ConnectError(Exception):