Class ConnectorServiceClient
- Namespace
- Livekit.Server.Sdk.Dotnet
- Assembly
- LivekitApi.dll
A client for interacting with the Connector service, which connects WhatsApp and Twilio calls to LiveKit rooms. Only available in LiveKit Cloud.
public class ConnectorServiceClient : BaseService
- Inheritance
-
ConnectorServiceClient
- Inherited Members
Constructors
ConnectorServiceClient(string, string, string, HttpClient)
Creates the client.
public ConnectorServiceClient(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
AcceptWhatsAppCall(AcceptWhatsAppCallRequest)
Accepts an inbound WhatsApp call.
public Task<AcceptWhatsAppCallResponse> AcceptWhatsAppCall(AcceptWhatsAppCallRequest request)
Parameters
requestAcceptWhatsAppCallRequestWhatsApp phone number ID, API key and the ID of the incoming call to accept.
Returns
- Task<AcceptWhatsAppCallResponse>
The accepted call.
ConnectTwilioCall(ConnectTwilioCallRequest)
Connects a Twilio call to a LiveKit room.
public Task<ConnectTwilioCallResponse> ConnectTwilioCall(ConnectTwilioCallRequest request)
Parameters
requestConnectTwilioCallRequestTwilio call direction and the room to connect the call to.
Returns
- Task<ConnectTwilioCallResponse>
The URL Twilio must connect the call to.
ConnectWhatsAppCall(ConnectWhatsAppCallRequest)
Connects an established WhatsApp call, for business-initiated calls.
public Task<ConnectWhatsAppCallResponse> ConnectWhatsAppCall(ConnectWhatsAppCallRequest request)
Parameters
requestConnectWhatsAppCallRequestWhatsApp call ID and the SDP of the call; optionally wait until it is answered.
Returns
- Task<ConnectWhatsAppCallResponse>
The connection details of the call.
DialWhatsAppCall(DialWhatsAppCallRequest)
Starts an outbound WhatsApp call.
public Task<DialWhatsAppCallResponse> DialWhatsAppCall(DialWhatsAppCallRequest request)
Parameters
requestDialWhatsAppCallRequestWhatsApp phone number ID, API key, the number to call and the room to connect the call to.
Returns
- Task<DialWhatsAppCallResponse>
The WhatsApp call ID and the room.
DisconnectWhatsAppCall(DisconnectWhatsAppCallRequest)
Disconnects an active WhatsApp call.
public Task<DisconnectWhatsAppCallResponse> DisconnectWhatsAppCall(DisconnectWhatsAppCallRequest request)
Parameters
requestDisconnectWhatsAppCallRequestWhatsApp call ID and the reason.
Returns
- Task<DisconnectWhatsAppCallResponse>
Empty response.