Table of Contents

Class LiveKitSipService

Namespace
LiveKit.Services
Assembly
LiveKit.AspNetCore.ServerSdk.dll

Service for managing SIP trunks, dispatch rules, and participants.

Provides methods for SIP integration, including managing trunks, dispatch rules, and making SIP calls. See LiveKit SIP Service Documentation for more information.

public sealed class LiveKitSipService : TwirpClient, ILiveKitSipService
Inheritance
LiveKitSipService
Implements
Inherited Members

Constructors

LiveKitSipService(HttpClient, ILogger<LiveKitSipService>, ILiveKitTokenService)

Initializes a new instance of the LiveKitSipService class.

public LiveKitSipService(HttpClient httpClient, ILogger<LiveKitSipService> logger, ILiveKitTokenService _tokenService)

Parameters

httpClient HttpClient
logger ILogger<LiveKitSipService>
_tokenService ILiveKitTokenService

Methods

CreateSIPDispatchRuleAsync(CreateSIPDispatchRuleRequest, CancellationToken)

Creates a new SIP dispatch rule.

public Task<SIPDispatchRuleInfo> CreateSIPDispatchRuleAsync(CreateSIPDispatchRuleRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateSIPDispatchRuleRequest
cancellationToken CancellationToken

Returns

Task<SIPDispatchRuleInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

CreateSIPInboundTrunkAsync(CreateSIPInboundTrunkRequest, CancellationToken)

Creates a new SIP inbound trunk.

public Task<SIPInboundTrunkInfo> CreateSIPInboundTrunkAsync(CreateSIPInboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateSIPInboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<SIPInboundTrunkInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

CreateSIPOutboundTrunkAsync(CreateSIPOutboundTrunkRequest, CancellationToken)

Creates a new SIP outbound trunk.

public Task<SIPOutboundTrunkInfo> CreateSIPOutboundTrunkAsync(CreateSIPOutboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateSIPOutboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<SIPOutboundTrunkInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

CreateSIPParticipantAsync(CreateSIPParticipantRequest, CancellationToken)

Creates a SIP participant to make an outbound call.

public Task<SIPParticipantInfo> CreateSIPParticipantAsync(CreateSIPParticipantRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateSIPParticipantRequest
cancellationToken CancellationToken

Returns

Task<SIPParticipantInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeleteSIPDispatchRuleAsync(DeleteSIPDispatchRuleRequest, CancellationToken)

Deletes a SIP dispatch rule by ID.

public Task<SIPDispatchRuleInfo> DeleteSIPDispatchRuleAsync(DeleteSIPDispatchRuleRequest request, CancellationToken cancellationToken = default)

Parameters

request DeleteSIPDispatchRuleRequest
cancellationToken CancellationToken

Returns

Task<SIPDispatchRuleInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeleteSIPTrunkAsync(DeleteSIPTrunkRequest, CancellationToken)

Deletes a SIP trunk by ID.

public Task<SIPTrunkInfo> DeleteSIPTrunkAsync(DeleteSIPTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request DeleteSIPTrunkRequest
cancellationToken CancellationToken

Returns

Task<SIPTrunkInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

GetSIPInboundTrunkAsync(GetSIPInboundTrunkRequest, CancellationToken)

Gets a SIP inbound trunk by ID.

public Task<GetSIPInboundTrunkResponse> GetSIPInboundTrunkAsync(GetSIPInboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request GetSIPInboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<GetSIPInboundTrunkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

GetSIPOutboundTrunkAsync(GetSIPOutboundTrunkRequest, CancellationToken)

Gets a SIP outbound trunk by ID.

public Task<GetSIPOutboundTrunkResponse> GetSIPOutboundTrunkAsync(GetSIPOutboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request GetSIPOutboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<GetSIPOutboundTrunkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListSIPDispatchRuleAsync(ListSIPDispatchRuleRequest, CancellationToken)

Lists SIP dispatch rules.

public Task<ListSIPDispatchRuleResponse> ListSIPDispatchRuleAsync(ListSIPDispatchRuleRequest request, CancellationToken cancellationToken = default)

Parameters

request ListSIPDispatchRuleRequest
cancellationToken CancellationToken

Returns

Task<ListSIPDispatchRuleResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListSIPInboundTrunkAsync(ListSIPInboundTrunkRequest, CancellationToken)

Lists SIP inbound trunks.

public Task<ListSIPInboundTrunkResponse> ListSIPInboundTrunkAsync(ListSIPInboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request ListSIPInboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<ListSIPInboundTrunkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListSIPOutboundTrunkAsync(ListSIPOutboundTrunkRequest, CancellationToken)

Lists SIP outbound trunks.

public Task<ListSIPOutboundTrunkResponse> ListSIPOutboundTrunkAsync(ListSIPOutboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request ListSIPOutboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<ListSIPOutboundTrunkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListSIPTrunkAsync(ListSIPTrunkRequest, CancellationToken)

Lists SIP trunks (deprecated, use ListSIPInboundTrunk or ListSIPOutboundTrunk).

[Obsolete("Use ListSIPInboundTrunk or ListSIPOutboundTrunk instead")]
public Task<ListSIPTrunkResponse> ListSIPTrunkAsync(ListSIPTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request ListSIPTrunkRequest
cancellationToken CancellationToken

Returns

Task<ListSIPTrunkResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

TransferSIPParticipantAsync(TransferSIPParticipantRequest, CancellationToken)

Transfers an active SIP participant to another number.

public Task TransferSIPParticipantAsync(TransferSIPParticipantRequest request, CancellationToken cancellationToken = default)

Parameters

request TransferSIPParticipantRequest
cancellationToken CancellationToken

Returns

Task

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateSIPDispatchRuleAsync(UpdateSIPDispatchRuleRequest, CancellationToken)

Updates an existing SIP dispatch rule.

public Task<SIPDispatchRuleInfo> UpdateSIPDispatchRuleAsync(UpdateSIPDispatchRuleRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateSIPDispatchRuleRequest
cancellationToken CancellationToken

Returns

Task<SIPDispatchRuleInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateSIPInboundTrunkAsync(UpdateSIPInboundTrunkRequest, CancellationToken)

Updates an existing SIP inbound trunk.

public Task<SIPInboundTrunkInfo> UpdateSIPInboundTrunkAsync(UpdateSIPInboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateSIPInboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<SIPInboundTrunkInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

UpdateSIPOutboundTrunkAsync(UpdateSIPOutboundTrunkRequest, CancellationToken)

Updates an existing SIP outbound trunk.

public Task<SIPOutboundTrunkInfo> UpdateSIPOutboundTrunkAsync(UpdateSIPOutboundTrunkRequest request, CancellationToken cancellationToken = default)

Parameters

request UpdateSIPOutboundTrunkRequest
cancellationToken CancellationToken

Returns

Task<SIPOutboundTrunkInfo>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.