TelecomService

interface TelecomService

Service responsible for making and receiving calls.

Note that most actions on calls do not return an error state. The reason for this is the current call states is already reflected through the currentCalls property, which should be reflected by the UI directly. Any error handling would only make this complex and error prone. However the service implementation is encouraged to log any reason why an action might be ignored as a warning.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val currentCalls: MirrorableMap<CallId, Call>

Map of all calls in any state where the key is a unique identifier referring to a call and where the value is the data structure containing details about the Call.

Link copied to clipboard
abstract val isMuted: Boolean

The microphone muted state.

Functions

Link copied to clipboard
abstract suspend fun answerCall(callId: CallId)

Answers the call with the specified callId. The call should be in the ringing state.

Link copied to clipboard
abstract suspend fun endCall(callId: CallId)

Ends the call with the specified callId.

Link copied to clipboard
abstract suspend fun initiateCall(phoneUri: PhoneUri): Boolean

Initiates a call with the specified uri.

Link copied to clipboard
abstract suspend fun playDtmfTone(callId: CallId, dtmfTone: DtmfTone)

Instructs the call with specified callId to play a DTMF tone. The tone will be played for a fixed amount of time before being stopped. Any other currently playing DTMF tone in the specified call is immediately stopped.

Link copied to clipboard
abstract suspend fun rejectCall(callId: CallId)

Rejects the call with the specified callId. The call should be in the ringing state.

Link copied to clipboard
abstract suspend fun setCallOnHold(callId: CallId, onHold: Boolean)

Instructs the call with the specified callId to go on hold or go back to the active connected state.

Link copied to clipboard
abstract suspend fun setMuted(muted: Boolean)

Mutes or unmutes the microphone.