Skip to content

Commit 1dcb8ec

Browse files
authored
feat: add outbound trunk config for create_sip_participant. (#523)
1 parent d62b2e6 commit 1dcb8ec

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

livekit-api/livekit/api/sip_service.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from livekit.protocol.models import ListUpdate
88
from livekit.protocol.sip import (
9+
SIPOutboundConfig,
910
SIPTrunkInfo,
1011
CreateSIPInboundTrunkRequest,
1112
UpdateSIPInboundTrunkRequest,
@@ -755,12 +756,16 @@ async def create_sip_participant(
755756
create: CreateSIPParticipantRequest,
756757
*,
757758
timeout: Optional[float] = None,
759+
trunk_id: Optional[str] = None,
760+
outbound_trunk_config: Optional[SIPOutboundConfig] = None,
758761
) -> SIPParticipantInfo:
759762
"""Create a new SIP participant.
760763
761764
Args:
762765
create: Request containing participant details
763766
timeout: Optional request timeout in seconds
767+
trunk_id: Optional SIP trunk ID to use for the participant
768+
outbound_trunk_config: Optional outbound trunk configuration for the participant
764769
765770
Returns:
766771
Created SIP participant
@@ -781,6 +786,12 @@ async def create_sip_participant(
781786
):
782787
client_timeout = aiohttp.ClientTimeout(total=20)
783788

789+
if trunk_id:
790+
create.sip_trunk_id = trunk_id
791+
792+
if outbound_trunk_config:
793+
create.trunk = outbound_trunk_config
794+
784795
return await self._client.request(
785796
SVC,
786797
"CreateSIPParticipant",

0 commit comments

Comments
 (0)