Class SipServiceClient
- Namespace
- Livekit.Server.Sdk.Dotnet
- Assembly
- LivekitApi.dll
Client of the LiveKit SIP service: inbound and outbound trunks, dispatch rules and SIP participants (outbound calls, transfers).
public class SipServiceClient : BaseService
- Inheritance
-
SipServiceClient
- Inherited Members
Constructors
SipServiceClient(string, string, string, HttpClient)
Creates the client.
public SipServiceClient(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)
Parameters
hoststringURL of the LiveKit server,
http(s)://orws(s)://; a subpath such ashttps://host/livekitis kept.apiKeystringAPI key; the
LIVEKIT_API_KEYenvironment variable when omitted.apiSecretstringAPI secret; the
LIVEKIT_API_SECRETenvironment variable when omitted.clientHttpClientOptional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.
Methods
CreateSIPDispatchRule(CreateSIPDispatchRuleRequest)
Creates a SIP dispatch rule, which decides the room an inbound call joins.
public Task<SIPDispatchRuleInfo> CreateSIPDispatchRule(CreateSIPDispatchRuleRequest request)
Parameters
requestCreateSIPDispatchRuleRequestRule to create: the trunks it applies to, how calls are dispatched (a shared room or one room per caller), participant settings.
Returns
- Task<SIPDispatchRuleInfo>
The created rule.
CreateSIPInboundTrunk(CreateSIPInboundTrunkRequest)
Creates a SIP inbound trunk.
public Task<SIPInboundTrunkInfo> CreateSIPInboundTrunk(CreateSIPInboundTrunkRequest request)
Parameters
requestCreateSIPInboundTrunkRequestTrunk to create: name, numbers, allowed addresses and numbers, authentication, media options.
Returns
- Task<SIPInboundTrunkInfo>
The created trunk.
CreateSIPOutboundTrunk(CreateSIPOutboundTrunkRequest)
Creates a SIP outbound trunk.
public Task<SIPOutboundTrunkInfo> CreateSIPOutboundTrunk(CreateSIPOutboundTrunkRequest request)
Parameters
requestCreateSIPOutboundTrunkRequestTrunk to create: name, SIP address, numbers, authentication, media options.
Returns
- Task<SIPOutboundTrunkInfo>
The created trunk.
CreateSIPParticipant(CreateSIPParticipantRequest)
Places an outbound call through a SIP trunk and adds the callee to a room as a SIP participant.
public Task<SIPParticipantInfo> CreateSIPParticipant(CreateSIPParticipantRequest request)
Parameters
requestCreateSIPParticipantRequestOutbound call to place: trunk ID, number to call, room and participant identity, DTMF to dial, options.
Returns
- Task<SIPParticipantInfo>
The SIP participant placing the call.
DeleteSIPDispatchRule(DeleteSIPDispatchRuleRequest)
Deletes a SIP dispatch rule.
public Task<SIPDispatchRuleInfo> DeleteSIPDispatchRule(DeleteSIPDispatchRuleRequest request)
Parameters
requestDeleteSIPDispatchRuleRequestRule ID.
Returns
- Task<SIPDispatchRuleInfo>
The deleted rule.
DeleteSIPTrunk(DeleteSIPTrunkRequest)
Deletes a SIP trunk.
public Task<SIPTrunkInfo> DeleteSIPTrunk(DeleteSIPTrunkRequest request)
Parameters
requestDeleteSIPTrunkRequestTrunk ID.
Returns
- Task<SIPTrunkInfo>
The deleted trunk.
GetSIPInboundTrunk(GetSIPInboundTrunkRequest)
Gets a SIP inbound trunk by ID.
public Task<GetSIPInboundTrunkResponse> GetSIPInboundTrunk(GetSIPInboundTrunkRequest request)
Parameters
requestGetSIPInboundTrunkRequestTrunk ID.
Returns
- Task<GetSIPInboundTrunkResponse>
The trunk.
GetSIPOutboundTrunk(GetSIPOutboundTrunkRequest)
Gets a SIP outbound trunk by ID.
public Task<GetSIPOutboundTrunkResponse> GetSIPOutboundTrunk(GetSIPOutboundTrunkRequest request)
Parameters
requestGetSIPOutboundTrunkRequestTrunk ID.
Returns
- Task<GetSIPOutboundTrunkResponse>
The trunk.
ListSIPDispatchRule(ListSIPDispatchRuleRequest)
Lists the SIP dispatch rules, optionally filtered.
public Task<ListSIPDispatchRuleResponse> ListSIPDispatchRule(ListSIPDispatchRuleRequest request)
Parameters
requestListSIPDispatchRuleRequestOptional filters: rule IDs, trunk IDs, page.
Returns
- Task<ListSIPDispatchRuleResponse>
The matching rules.
ListSIPInboundTrunk(ListSIPInboundTrunkRequest)
Lists the SIP inbound trunks.
public Task<ListSIPInboundTrunkResponse> ListSIPInboundTrunk(ListSIPInboundTrunkRequest request)
Parameters
requestListSIPInboundTrunkRequestOptional filters: trunk IDs, numbers, page.
Returns
- Task<ListSIPInboundTrunkResponse>
The matching trunks.
ListSIPOutboundTrunk(ListSIPOutboundTrunkRequest)
Lists the SIP outbound trunks.
public Task<ListSIPOutboundTrunkResponse> ListSIPOutboundTrunk(ListSIPOutboundTrunkRequest request)
Parameters
requestListSIPOutboundTrunkRequestOptional filters: trunk IDs, numbers, page.
Returns
- Task<ListSIPOutboundTrunkResponse>
The matching trunks.
ListSIPTrunk(ListSIPTrunkRequest)
Lists the legacy SIP trunks. Deprecated by LiveKit: use ListSIPInboundTrunk(ListSIPInboundTrunkRequest) or ListSIPOutboundTrunk(ListSIPOutboundTrunkRequest).
[Obsolete("This method is obsolete. Call ListSIPInboundTrunk or ListSIPOutboundTrunk instead.", false)]
public Task<ListSIPTrunkResponse> ListSIPTrunk(ListSIPTrunkRequest request)
Parameters
requestListSIPTrunkRequestEmpty request.
Returns
- Task<ListSIPTrunkResponse>
The legacy trunks.
TransferSIPParticipant(TransferSIPParticipantRequest)
Transfers the call of a SIP participant to another phone number or SIP URI, with a SIP REFER.
public Task<TransferSIPParticipantResponse> TransferSIPParticipant(TransferSIPParticipantRequest request)
Parameters
requestTransferSIPParticipantRequestRoom name, participant identity and the number or SIP URI to transfer the call to.
Returns
- Task<TransferSIPParticipantResponse>
The outcome of the transfer.
UpdateSIPDispatchRule(UpdateSIPDispatchRuleRequest)
Updates an existing SIP dispatch rule.
public Task<SIPDispatchRuleInfo> UpdateSIPDispatchRule(UpdateSIPDispatchRuleRequest request)
Parameters
requestUpdateSIPDispatchRuleRequestRule ID and the fields to change, or a full replacement.
Returns
- Task<SIPDispatchRuleInfo>
The updated rule.
UpdateSIPInboundTrunk(UpdateSIPInboundTrunkRequest)
Updates an existing SIP inbound trunk.
public Task<SIPInboundTrunkInfo> UpdateSIPInboundTrunk(UpdateSIPInboundTrunkRequest request)
Parameters
requestUpdateSIPInboundTrunkRequestTrunk ID and the fields to change, or a full replacement.
Returns
- Task<SIPInboundTrunkInfo>
The updated trunk.
UpdateSIPOutboundTrunk(UpdateSIPOutboundTrunkRequest)
Updates an existing SIP outbound trunk.
public Task<SIPOutboundTrunkInfo> UpdateSIPOutboundTrunk(UpdateSIPOutboundTrunkRequest request)
Parameters
requestUpdateSIPOutboundTrunkRequestTrunk ID and the fields to change, or a full replacement.
Returns
- Task<SIPOutboundTrunkInfo>
The updated trunk.