Skip to main content
A Call is the representation of an audio or video call between two browsers, SIP clients or phone numbers. The call object is created whenever a new call is initiated, either by you or the remote caller. You can access and act upon calls initiated by a remote caller in a telnyx.notification event handler. Examples To create a new call, i.e. dial:
To answer an incoming call:
Both the outgoing and incoming call has methods that can be hooked up to your UI.

Hierarchy

  • default Call

Table of contents

Properties

Accessors

Methods

Properties

direction

direction: Direction The direction of the call. Can be either inbound or outbound.

Inherited from

BaseCall.direction

id

id: string = '' The call identifier.

Inherited from

BaseCall.id

prevState

prevState: string = '' The previous state of the call. See Call.state for all possible values.

Inherited from

BaseCall.prevState

recoveredCallId

recoveredCallId: string = '' The call ID of the previous call that this call is recovering from. Present only when the call was created as part of a reattachment/recovery flow (e.g. after a network reconnection). Use this to match the new call object to the ended/destroyed call and prevent duplicate UI elements such as dialers. Example

Inherited from

BaseCall.recoveredCallId

state

state: string The state of the call.

Inherited from

BaseCall.state

Accessors

isAudioMuted

get isAudioMuted(): boolean Checks whether the microphone is muted.

Returns

boolean Examples

Inherited from

BaseCall.isAudioMuted

localStream

get localStream(): MediaStream Gets the local stream of the call. This can be used in a video/audio element to play the local media. See MediaStream.

Returns

MediaStream Examples

Inherited from

BaseCall.localStream

remoteStream

get remoteStream(): MediaStream Gets the remote stream of the call. This can be used in a video/audio element to play the remote media. See MediaStream.

Returns

MediaStream Examples

Inherited from

BaseCall.remoteStream

signalingStateClosed

get signalingStateClosed(): boolean Indicates if the peer connection’s signaling state has transitioned to ‘closed’ while the connection was previously active. Used to determine if the call can be recovered on reconnection.

Returns

boolean

Inherited from

BaseCall.signalingStateClosed

telnyxIDs

get telnyxIDs(): Object Gets Telnyx call IDs, if using Telnyx Call Control services. You can use these IDs to identify specific calls in your application code.

Returns

Object Examples

Inherited from

BaseCall.telnyxIDs

Methods

answer

answer(params?): Promise<void> Starts the process to answer the incoming call.

Parameters

Returns

Promise<void> Examples

Inherited from

BaseCall.answer

deaf

deaf(): void Turns off the remote stream audio.

Returns

void Examples

Inherited from

BaseCall.deaf

dtmf

dtmf(dtmf): void Sends dual-tone multi-frequency (DTMF) signal

Parameters

Returns

void Examples

Inherited from

BaseCall.dtmf

getStats

getStats(callback, constraints): void Registers callback for stats.

Parameters

Returns

void

Inherited from

BaseCall.getStats

hold

hold(): Promise<any> Holds the call.

Returns

Promise<any> Promise that resolves or rejects based on server response Examples Using async/await:
Using ES6 Promises:

Inherited from

BaseCall.hold

muteAudio

muteAudio(): void Turns off audio output, i.e. makes it so other call participants cannot hear your audio.

Returns

void Examples

Inherited from

BaseCall.muteAudio

muteVideo

muteVideo(): void Turns off the video output, i.e. hides video from other call participants.

Returns

void Examples
Deprecated

Inherited from

BaseCall.muteVideo

setAudioInDevice

setAudioInDevice(deviceId, muted?): Promise<void> Changes the audio input device (i.e. microphone) used for the call.

Parameters

Returns

Promise<void> Promise that resolves if the audio input device has been updated Examples Using async/await:
Using ES6 Promises:
Usage with .getAudioInDevices:

Inherited from

BaseCall.setAudioInDevice

setAudioOutDevice

setAudioOutDevice(deviceId): Promise<boolean> Changes the audio output device (i.e. speaker) used for the call.

Parameters

Returns

Promise<boolean> Promise that returns a boolean Examples Using async/await:
Using ES6 Promises:
Usage with .getAudioOutDevices:

setVideoDevice

setVideoDevice(deviceId): Promise<void> Changes the video device (i.e. webcam) used for the call.

Parameters

Returns

Promise<void> Promise that resolves if the video device has been updated Examples Using async/await:
Using ES6 Promises:
Usage with .getVideoDevices:
Deprecated

Inherited from

BaseCall.setVideoDevice

toggleAudioMute

toggleAudioMute(): void Toggles the audio output on/off.

Returns

void Examples

Inherited from

BaseCall.toggleAudioMute

toggleDeaf

toggleDeaf(): void Toggles the remote stream audio.

Returns

void Examples

Inherited from

BaseCall.toggleDeaf

toggleHold

toggleHold(): Promise<any> Toggles hold state of the call.

Returns

Promise<any> Promise that resolves or rejects based on server response Examples Using async/await:

Inherited from

BaseCall.toggleHold

toggleVideoMute

toggleVideoMute(): void Toggles the video output on/off.

Returns

void Examples
Deprecated

Inherited from

BaseCall.toggleVideoMute

undeaf

undeaf(): void Turns on the remote stream audio.

Returns

void Examples

Inherited from

BaseCall.undeaf

unhold

unhold(): Promise<any> Removes hold from the call.

Returns

Promise<any> Promise that resolves or rejects based on server response Examples Using async/await:
Using ES6 Promises:

Inherited from

BaseCall.unhold

unmuteAudio

unmuteAudio(): void Turns on audio output, i.e. makes it so other call participants can hear your audio.

Returns

void Examples

Inherited from

BaseCall.unmuteAudio

unmuteVideo

unmuteVideo(): void Turns on the video output, i.e. makes video visible to other call participants.

Returns

void Examples
Deprecated

Inherited from

BaseCall.unmuteVideo