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

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 holdCall(callId: CallId)

Puts the active call with the specified callId on hold when another incoming call arrives allowing the end-user to take the other call. If there is a second call which is already on hold, this call will be made active, effectively swapping the calls.

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 muteMicrophone()

Mutes the microphone.

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 unholdCall(callId: CallId)

Activates a call with the specified callId which is currently on hold. Allowing the end-user to resume the call. If there is a second call which is active, this call will be put on hold, effectively swapping the calls.

Link copied to clipboard
abstract suspend fun unmuteMicrophone()

Unmutes the microphone.