Call

Represents an audio or video call.
View as Markdown

The Call object represents one audio or video call leg in a VoxEngine scenario. It is typically received from call events or returned by dialing APIs, then methods such as answer, sendMediaTo, record, and addEventListener are called on that call instance. Related event names, event payloads, and parameter objects are documented on this page because they describe the same call lifecycle.

Contents

  • Methods: answer, reject, bridge media, record, play audio, and control call state.
  • CallEvents: event names and callback payload fields for the call lifecycle.
  • Parameter types: option objects used by Call methods.

Methods

addEventListener

Adds a handler for the specified CallEvents event. Use only functions as handlers; anything except a function leads to the error and scenario termination when a handler is called.

1addEventListener(event: CallEvents | string, callback: (event: object) => any): void

Parameters

ParameterTypeReq.Description
eventCallEvents | stringEvent constant or event name to subscribe to.
callback(event: object) => anyFunction called when the event is emitted.

Returns

TypeDescription
voidDoes not return a value.

answer

Answers the incoming call. Use it only for non-P2P call legs connection. Remember that you can use the Call.startEarlyMedia method before answering a call.

1answer(extraHeaders?: { [header: string]: string }, parameters?: CallAnswerParameters): void

Parameters

ParameterTypeReq.Description
extraHeaders{ [header: string]: string }
parametersCallAnswerParameters

Returns

TypeDescription
voidDoes not return a value.

answerDirect

Answer the incoming call in the peer-to-peer mode. Use it only for P2P call legs connection.

1answerDirect(peerCall: Call, extraHeaders?: { [header: string]: string }, parameters?: CallAnswerParameters): void

Parameters

ParameterTypeReq.Description
peerCallCall
extraHeaders{ [header: string]: string }
parametersCallAnswerParameters

Returns

TypeDescription
voidDoes not return a value.

callerid

Returns the callerID of the caller, which is displayed to the callee. Normally it is some phone number that can be used for callback. IMPORTANT: test numbers rented from Voximplant cannot be used as CallerIDs, the values can be only real numbers.

1callerid(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

clientType

Returns a type of the client. The possible values are: ‘pstn’, ‘sip’, ‘user’, ‘wab’.

1clientType(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

customData

Sets or gets a custom string associated with the particular call (the Call object). The customData value could be sent from WEB/iOS/Android SDKs, and then it becomes the customData value in the Call instance. Note that if you receive a value from an SDK, you can always replace it manually. SDKs can pass customData in two ways:

  1. when SDK calls the Voximplant cloud
  2. when SDK answers the call from the Voximplant cloud. See the syntax and details in the corresponding references: WEB SDK call() / WEB SDK answer() / iOS call:settings: / iOS answerWithSettings / Android call() / Android answer()
1customData(customData?: string): string

Parameters

ParameterTypeReq.Description
customDatastring

Returns

TypeDescription
stringThe requested string value.

decline

Deprecated

Use Call.reject instead

Rejects the incoming call.

1decline(code: number, extraHeaders?: { [header: string]: string }): void

Parameters

ParameterTypeReq.Description
codenumber
extraHeaders{ [header: string]: string }

Returns

TypeDescription
voidDoes not return a value.

disableBeepDetection

Disables beep detection in a call.

1disableBeepDetection(): void

Parameters

This method does not accept parameters.

Returns

TypeDescription
voidDoes not return a value.

displayName

Returns the name of the caller, which is displayed to the callee. Normally it is a human-readable version of Call.callerid, e.g. a person’s name.

1displayName(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

enableBeepDetection

Enables beep detection in a call. The beep detection is used to detect beeps in the call audio stream.

1enableBeepDetection(parameters: CallEnableBeepDetectionParameters): void

Parameters

ParameterTypeReq.Description
parametersCallEnableBeepDetectionParameters

Returns

TypeDescription
voidDoes not return a value.

handleBlindTransfer

Whether to enable blind transfers. When enabled, the CallEvents.BlindTransferRequested event is triggered to request for the third call leg within an existing session and notify the transfer initiator of the result.

1handleBlindTransfer(handle: boolean): void

Parameters

ParameterTypeReq.Description
handleboolean

Returns

TypeDescription
voidDoes not return a value.

handleMicStatus

Whether to enable detection of microphone status in the call. If detection is enabled, the CallEvents.MicStatusChange event is triggered at each status’ change.

1handleMicStatus(handle: boolean): void

Parameters

ParameterTypeReq.Description
handleboolean

Returns

TypeDescription
voidDoes not return a value.

handleTones

Changes DTMF processing mode (in-band DTMF, RFC 2833 DTMF and DTMF over SIP INFO) telephony signals. If true, each received DTMF signal triggers the CallEvents.ToneReceived and removes from audio stream.

1handleTones(doHandle: boolean, supportedDtmfTypes?: DTMFType): void

Parameters

ParameterTypeReq.Description
doHandleboolean
supportedDtmfTypesDTMFType

Returns

TypeDescription
voidDoes not return a value.

hangup

Attempts finishing the current call. Triggers one of the following events:

  1. CallEvents.Disconnected if the call is active before hangup.
  2. CallEvents.Failed if it is an outgoing call that is not connected previously. If there are no other active calls and/or SmartQueue requests in the call session, the AppEvents.Terminating and AppEvents.Terminated events are triggered in 60 seconds (see the session limits for details).
1hangup(extraHeaders?: { [header: string]: string }): void

Parameters

ParameterTypeReq.Description
extraHeaders{ [header: string]: string }

Returns

TypeDescription
voidDoes not return a value.

id

Returns the call’s id. Each call in a JavaScript session has its own unique id.

1id(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

incoming

Whether the call is incoming.

1incoming(): boolean

Parameters

This method does not accept parameters.

Returns

TypeDescription
booleanThe requested boolean value.

monitorMediaStatistics

Enables the retrieval of multimedia statistics during a call. When enabled, the CallEvents.MediaStatisticsReceived event is triggered and retrieves multimedia statistics during a call.

1monitorMediaStatistics(parameters: MonitorMediaStatisticsParameters): void

Parameters

ParameterTypeReq.Description
parametersMonitorMediaStatisticsParameters

Returns

TypeDescription
voidDoes not return a value.

notifyBlindTransferFailed

Sends a notification about a failed call transfer with an error code and reason.

1notifyBlindTransferFailed(code: number, reason: string): void

Parameters

ParameterTypeReq.Description
codenumber
reasonstring

Returns

TypeDescription
voidDoes not return a value.

notifyBlindTransferSuccess

Sends a notification of a successful call transfer with the 200 OK message.

1notifyBlindTransferSuccess(): void

Parameters

This method does not accept parameters.

Returns

TypeDescription
voidDoes not return a value.

number

Returns a dialed number of the incoming or outgoing call.

1number(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

playProgressTone

Provides country-specific dial tones. The method sends a command to the Voximplant cloud to start playing dial tones in the call. The dial tones fully depend on the Voximplant cloud. Note that in order to work properly in a call that is not connected yet, you need to call the Call.startEarlyMedia method before using this function. IMPORTANT: each call object can send media to any number of other calls (media units), but can receive only one audio stream. A new incoming stream always replaces the previous one.

1playProgressTone(country: string): void

Parameters

ParameterTypeReq.Description
countrystring

Returns

TypeDescription
voidDoes not return a value.

record

Starts recording the incoming and outgoing audio for this call. This method triggers the CallEvents.RecordStarted event. The default quality is 8kHz / 32kbps; the format is mp3.

1record(parameters: CallRecordParameters): void

Parameters

ParameterTypeReq.Description
parametersCallRecordParameters

Returns

TypeDescription
voidDoes not return a value.

reject

Rejects the incoming call. First it triggers the CallEvents.Disconnected event immediately. The AppEvents.Terminating and AppEvents.Terminated events are triggered in 60 seconds.

1reject(code: number, extraHeaders?: { [header: string]: string }): void

Parameters

ParameterTypeReq.Description
codenumber
extraHeaders{ [header: string]: string }

Returns

TypeDescription
voidDoes not return a value.

removeEventListener

Removes a handler for the specified CallEvents event.

1removeEventListener(event: CallEvents | string, callback?: (event: object) => any): void

Parameters

ParameterTypeReq.Description
eventCallEvents | stringEvent constant or event name to subscribe to.
callback(event: object) => anyFunction called when the event is emitted.

Returns

TypeDescription
voidDoes not return a value.

ring

Plays dial tones for the incoming call. The method sends a low-level command to the endpoint device to start playing dial tones for the call. So the dial tones depend on endpoint device’s behavior rather than on the Voximplant cloud. IMPORTANT: each call object can send media to any number of other calls (media units), but can receive only one audio stream. A new incoming stream always replaces the previous one.

1ring(extraHeaders?: { [header: string]: string }): void

Parameters

ParameterTypeReq.Description
extraHeaders{ [header: string]: string }

Returns

TypeDescription
voidDoes not return a value.

say

Say some text to the CallEvents.Connected call. If text length exceeds 1500 characters the PlayerEvents.PlaybackFinished event is triggered with error description. IMPORTANT: each call object can send media to any number of other calls (media units), but can receive only one audio stream. A new incoming stream always replaces the previous one.

1say(text: string, parameters?: CallSayParameters): void

Parameters

ParameterTypeReq.Description
textstring
parametersCallSayParameters

Returns

TypeDescription
voidDoes not return a value.

sendDigits

Sends DTMF digits to the remote peer.

1sendDigits(digits: string): void

Parameters

ParameterTypeReq.Description
digitsstring

Returns

TypeDescription
voidDoes not return a value.

sendInfo

Sends info (SIP INFO) message to the call.

1sendInfo(mimeType: string, body: string, headers?: { [header: string]: string }): void

Parameters

ParameterTypeReq.Description
mimeTypestring
bodystring
headers{ [header: string]: string }

Returns

TypeDescription
voidDoes not return a value.

sendMediaTo

Starts sending media (voice and video) from the call to the media unit. The target call has to be CallEvents.Connected earlier. IMPORTANT: each call object can send media to any number of the media units, but can receive only one audio stream. A new incoming stream always replaces the previous one.

1sendMediaTo(mediaUnit: VoxMediaUnit, parameters?: SendMediaParameters): void

Parameters

ParameterTypeReq.Description
mediaUnitVoxMediaUnit
parametersSendMediaParameters

Returns

TypeDescription
voidDoes not return a value.

sendMessage

Sends a text message to the call.

1sendMessage(text: string): void

Parameters

ParameterTypeReq.Description
textstring

Returns

TypeDescription
voidDoes not return a value.

startEarlyMedia

Informs the call endpoint that early media is sent before accepting the call. It allows playing voicemail prompt or music before establishing the connection. It does not allow to listen to call endpoint. Note that unanswered call can be in “early media” state only for 60 seconds, see the session limits for details.

1startEarlyMedia(extraHeaders?: { [header: string]: string }, scheme?: string, maxVideoBitrate?: number, audioLevelExtension?: boolean, conferenceCall?: boolean, disableDtxForAudio?: boolean): void

Parameters

ParameterTypeReq.Description
extraHeaders{ [header: string]: string }
schemestring
maxVideoBitratenumber
audioLevelExtensionboolean
conferenceCallboolean
disableDtxForAudioboolean

Returns

TypeDescription
voidDoes not return a value.

startPlayback

Starts to play an audio file to the answered call. You can stop playback manually via the Call.stopPlayback method. You can attach media streams later via the Call.sendMediaTo method etc. IMPORTANT: each call object can send media to any number of other calls (media units), but can receive only one audio stream. A new incoming stream always replaces the previous one.

1startPlayback(url: string, parameters?: StartPlaybackParameters): void

Parameters

ParameterTypeReq.Description
urlstring
parametersStartPlaybackParameters

Returns

TypeDescription
voidDoes not return a value.

state

Returns the current state of the call. Possible values are: TERMINATED | CONNECTED | PROGRESSING | ALERTING.

1state(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

stopMediaTo

Stops sending media (voice and video) from the call to media unit.

1stopMediaTo(mediaUnit: VoxMediaUnit): void

Parameters

ParameterTypeReq.Description
mediaUnitVoxMediaUnit

Returns

TypeDescription
voidDoes not return a value.

stopPlayback

Stops audio playback started before via the Call.startPlayback method.

1stopPlayback(): void

Parameters

This method does not accept parameters.

Returns

TypeDescription
voidDoes not return a value.

toString

Returns the human-readable description of the call’s status.

1toString(): string

Parameters

This method does not accept parameters.

Returns

TypeDescription
stringThe requested string value.

transferTo

Transfers a SIP call to a 3rd party provider which supports the REFER command. If the transfer is successful, Voximplant disconnects from handling this call and the CallEvents.TransferComplete event is triggered. Otherwise, the CallEvents.TransferFailed event is triggered.

1transferTo(parameters: TransferToParameters): void

Parameters

ParameterTypeReq.Description
parametersTransferToParameters

Returns

TypeDescription
voidDoes not return a value.

vad

Returns VAD (Voice Activity Detection) status. The including of the ASR also activates VAD so in that case vad() returns true.

1vad(): boolean

Parameters

This method does not accept parameters.

Returns

TypeDescription
booleanThe requested boolean value.

CallEvents

Subscribe with Call.addEventListener. Each event callback receives an object with the fields documented below.

Triggers after remote peer answered the call or set the call into the Call.startEarlyMedia state. Note that event is not triggered in P2P mode.

This event occurs after receiving the 183 Session Progress SIP message regardless of receiving actual media packets.

Event constant: CallEvents.AudioStarted

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)

Triggers when voicemail detection system connects to the VMD/AMD server and starts detecting voicemail.

Event constant: CallEvents.AudioIdentificationStarted

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers when voicemail detection ends detecting voicemail and the audio identification result is received.

Event constant: CallEvents.AudioIdentificationResult

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
audioTypeAMD.ResultClass
audioSubTypeAMD.ResultSubtype
confidencenumber

Triggers when voicemail detection stops detecting voicemail.

Event constant: CallEvents.AudioIdentificationStopped

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers when voicemail detection occurs an error.

Event constant: CallEvents.AudioIdentificationError

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggered when blind transfers are enabled by Call.handleBlindTransfer.

Event constant: CallEvents.BlindTransferRequested

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
transferTostringUsername

Triggers after an incoming/outgoing call is connected. For incoming call, it happens after the Call.answer is called. For outgoing call, it happens when a remote peer answers the call.

Event constant: CallEvents.Connected

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
customDatastringCustom data that was passed from the client with call accept command
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
scheme{ [id: string]: { audio: any, video: any } }Internal information about codecs.

Triggers on an incoming/outgoing call forwarding.

Event constant: CallEvents.Forwarding

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggered when a call is terminated.

Most frequent status codes (returned when a call is terminated before being answered):

CodeDescription

408Call is not answered within 60 seconds 603Call is rejected 486Destination number is busy 487Request terminated

You can find the complete list of rfc3261 response codes on Wikipedia.

Note that this event does not mean the end of the JavaScript session. The session without calls and/or ACD requests are automatically terminated after some time (see the session limits for details). It is a good idea to explicitly terminate the session with VoxEngine.terminate(/docs/references/voxengine/voxengine/terminate) after it is no longer needed.

Event constant: CallEvents.Disconnected

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
internalCodenumberStatus code of the call (i.e., 486)
reasonstringReason of the call failure
durationnumberTotal call duration in seconds
costnumberCall cost in account currency
directionstringCall direction type according to billing

Triggered when an outgoing call is terminated before connection. Most frequent status codes:

CodeDescription

486Destination number is busy 487Request terminated 404Invalid number 480Destination number is unavailable 402Insufficient funds 603Call was rejected 408Call was not answered within 60 seconds

Event constant: CallEvents.Failed

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
codenumberStatus code of the call (i.e., 486)
reasonstringStatus message of call failure

Triggered when an INFO message is received.

Event constant: CallEvents.InfoReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
mimeTypestringMIME type of INFO message
bodystringContent of the message

Triggered when a text message is received.

Event constant: CallEvents.MessageReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
textstringContent of the message

Triggers each time when microphone status changes. There is the method for enabling status analyzing - Call.handleMicStatus.

Event constant: CallEvents.MicStatusChange

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
activebooleanWhether the microphone is active

Triggered when a call is taken off hold.

Event constant: CallEvents.OffHold

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggered when a call is put on hold.

Event constant: CallEvents.OnHold

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggered when the audio/voice playback is completed. Note that the Call.stopPlayback method finishes any media**, so the CallEvents.PlaybackFinished event is not triggered. The playback may be started by the Call.say or Call.startPlayback methods.

Event constant: CallEvents.PlaybackFinished

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
errorstringError that occurred during the playback

Triggers by the Call.startPlayback and Call.say methods when:

  1. the audio file download to the Voximplant cache is finished;
  2. the audio file is found in the cache (i.e., it is in the cache before).

Event constant: CallEvents.PlaybackReady

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers by the Call.startPlayback and Call.say methods when audio/voice playback is started.

Event constant: CallEvents.PlaybackStarted

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
durationnumberPlayback duration

Triggered when a push notification is sent.

Event constant: CallEvents.PushSent

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
resultstring

Triggered when the Voximplant cloud receives the ReInviteAccepted message. This message means that a call received video from the other participant.

Event constant: CallEvents.ReInviteAccepted

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
mimeTypestringMIME type of INFO message
bodystringContent of the message

Triggered when the Voximplant cloud receives the ReInviteReceived message. This message means that a caller:

  1. started sending video;
  2. started/stopped screensharing;
  3. put a call on hold / took a call off hold.

Event constant: CallEvents.ReInviteReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
mimeTypestringMIME type of INFO message
bodystringContent of the message

Triggered when the Voximplant cloud receives the ReInviteRejected message. This message means that a call does not receive video from the other participant.

Event constant: CallEvents.ReInviteRejected

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)

Triggered when call recording is started. The recording may be started by the Call.record method.

Event constant: CallEvents.RecordStarted

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
urlstringLink to the record file.

Triggered when call recording is stopped. This happens after the CallEvents.Disconnected event is triggered.

Event constant: CallEvents.RecordStopped

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
urlstringLink to the record file.
coststringRecord cost (in the account’s currency: USD, EUR or RUB)
durationnumberRecord duration (sec)

Triggers in case of errors during the recording process.

Event constant: CallEvents.RecordError

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
errorstringTriggers in case of errors during the recording process

Triggers after outgoing call receives progress signal from a remote peer.

Event constant: CallEvents.Ringing

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)

Triggered when a call status is changed.

Event constant: CallEvents.StateChanged

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
oldStatestring
newStatestring

Triggered when call statistics change.

Event constant: CallEvents.Statistics

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggered when a call dial tone is detected (either dial tone or busy tone). There is the deprecated method for enabling the tone detection - ‘Call.detectProgressTone’. Note that:

  1. triggers only if the CallEvents.Connected event is triggered;
  2. the event is only triggered once in a call session.

Event constant: CallEvents.ToneDetected

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
ProgressTonebooleanWhether the detected tone is a dial tone.
VoicemailTonebooleanWhether the detected tone is a voicemail tone.

Triggered when a DTMF signal is received. Note that by default DTMF signals do not trigger this event, this behavior needs to be set explicitly via the Call.handleTones method.

Event constant: CallEvents.ToneReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
tonestringTone received in this event. The possible values are: 0-9,*,#
typestringType of the received tone. The possible values are: 1 (rfc 2833), 2 (Inband), 3 (SipInfo)

Triggered when a call transfer is complete.

Event constant: CallEvents.TransferComplete

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
role’transferor’ | ‘target’ | ‘transferee’The transfer roles.

Triggered when a call transfer is failed.

Event constant: CallEvents.TransferFailed

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
headers{ [header: string]: string }SIP headers received with the message (the ones starting with “X-”)
role’transferor’ | ‘target’ | ‘transferee’The transfer roles.
codenumberFailed transfer’s status (e.g., 486)
reasonstringFailed transfer’s status message

Triggers after the video track is created. This could happen only if the Call.record method with {video: true} parameters is called.

Event constant: CallEvents.VideoTrackCreated

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
urlstringRecord URL

Triggers after the first audio packet is received.

Event constant: CallEvents.FirstAudioPacketReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers after the first video packet is received.

Event constant: CallEvents.FirstVideoPacketReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers within 7 seconds after the RTP/RTCP has stopped. Applies to all types of calls (users, SIP, and PSTN).

Event constant: CallEvents.RtpStopped

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers after the RTP resumed.

Event constant: CallEvents.RtpResumed

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID

Triggers after the beep detection is complete. The beep detection may be started by the Call.enableBeepDetection method.

Event constant: CallEvents.BeepDetectionComplete

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
frequenciesnumber[]Array of frequencies detected during the beep detection in Hz.
timeoutbooleanWhether the timeout occurred during beep detection.

Error during beep detection.

Event constant: CallEvents.BeepDetectionError

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
reasonstringBeep detection failure reason.

Triggers after the audio quality detected.

Event constant: CallEvents.AudioQualityDetected

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
qualityCallAudioQualityThe audio quality. Allowed values are listed in CallAudioQuality: HD, STANDARD.

Triggers after media statistics has been recieved. To enable, call the Call.monitorMediaStatistics method.

Event constant: CallEvents.MediaStatisticsReceived

Payload

FieldTypeReq.Description
callCallCall that triggered the event
namestringThe name of the event
idstringThe call’s ID
audioCallMediaStatisticsStatistical information about the audio channels. Contains metrics for both incoming and outgoing streams.

Parameter types

CallAnswerParameters

The parameters can be passed as arguments to the Call.answer method.

PropertyTypeReq.Description
conferenceCallbooleaninherited from BaseCallParameters Whether the call is coming from a conference. The default value is false.
disableDtxForAudiobooleaninherited from BaseCallParameters Disables DTX for audio. The default value is false.
disableExtPlayoutDelaybooleaninherited from BaseCallParameters Whether to disable the RTP header extension to control playout delay if provided.
disableExtVideoOffsetbooleaninherited from BaseCallParameters Whether to disable the RTP header extension for transmission offset if provided.
disableExtVideoOrientationbooleaninherited from BaseCallParameters Whether to disable the RTP header extension for video orientation, 3gpp:video-orientation, if provided. Browsers that do not support that extension display the video correctly, however, the battery consumption is higher.
disableExtVideoTimingbooleaninherited from BaseCallParameters Whether to disable the RTP header extension for video timing if provided.
displayNamestringinherited from BaseCallParameters Name of the caller that is displayed to the user. Normally it is a human-readable version of CallerID, e.g. a person’s name.
maxVideoBitratenumberinherited from BaseCallParameters Sets the maximum possible video bitrate for the customer device in kbps.
scheme{ [id: string]: { audio: any, video: any } }inherited from BaseCallParameters Internal information about codecs.

CallEnableBeepDetectionParameters

Parameters for the Call.enableBeepDetection method.

PropertyTypeReq.Description
frequenciesnumber[]Array of frequencies to detect in Hz.
timeoutnumberTimeout in milliseconds to wait for the beep detection.

CallRecordParameters

The parameters can be passed as arguments to the Call.record method.

PropertyTypeReq.Description
dictASRDictionary | string[]Transcription dictionary. Array of words that are possible values. Note that dict does not limit the transcription to the specific list. Instead, words in the specified list have a higher chance to be selected. Note that the parameter does not affect the Recorder module because the transcription is not available for it.
expireRecordExpireTimeinherited from BaseRecorderParameters Storage time for recorded files. The default value is RecordExpireTime.THREEMONTHS(/docs/references/voxengine/recordexpiretime#threemonths).
formatstringTranscription format. Could be specified as “json”. In that case the transcription result is saved in JSON format. The parameter is not available for the Recorder module.
hd_audiobooleaninherited from BaseRecorderParameters Whether to use the HD audio. The default value is false. If set to false, 8 KHz / 32 kbps mp3 file is generated. If set to true, “wideband audio” 48 KHz / 192 kbps mp3 file is generated. Note that transcription’s quality does not depend on this parameter. The parameter is not compatible with lossless: true parameter.
labelsstring[]An array of two strings. Each string names the label in resulting transcription: the first string names a call/stream that initiated recording, the second string names the other call. If there is only one string in the array or the parameter is not specified at all, the recording’s initiate call has the “Left” name and the second stream has the “Right” name. The parameter requires the transcribe: true parameter. The parameter is not available for the Recorder module.
languageASRLanguageinherited from BaseRecorderParameters Transcription language. The parameter uses ASRLanguage from the ASR module as possible values. Note that it is necessary to include the ASR module in the scenario to use the language constants. The parameter is not available for the Recorder module.
losslessbooleaninherited from BaseRecorderParameters Whether to save the record in flac format. The default value is false. The parameter is not compatible with hd_audio: true parameter.
providerTranscriptionProviderTranscription provider.
recordNamePrefixstringinherited from BaseRecorderParameters The prefix to add to the record names when storing to your S3 storage. Works only for custom S3-compatible storages.
securebooleaninherited from BaseRecorderParameters Whether to restrict access to the record without management API authorization (available only in the VoxEngine.createRecorder method).
stereobooleanWhether the sound is stereo. The default value is false. The parameter does not change anything for the Recorder module: it records stereo with mixed streams in both channels. For the Call.record method it works in another way: 1. if it is False, it records stereo with mixed streams in both channels 2. if it is True, the Audio stream from a call endpoint to voximplant cloud is recorded into left channel. Audio stream from voximplant cloud to a call endpoint is recorded into right channel.
transcribebooleaninherited from BaseRecorderParameters Whether to create the call record transcription. Note that transcription is not available for the Recorder module. See the details in the article.
videobooleaninherited from BaseRecorderParameters Whether to record video. The default value is false.
videoParametersRecorderVideoParametersinherited from BaseRecorderParameters Recorder video parameters.

CallSayParameters

The parameters can be passed as arguments to the Call.say method.

PropertyTypeReq.Description
progressivePlaybackbooleanWhether to use progressive playback. If true, the generated speech is delivered in chunks which reduces delay before a method call and playback. The default value is false. Available for providers: Amazon, Google, IBM, Microsoft, SaluteSpeech, T-Bank, Yandex.
requestObjectProvide the TTS parameters directly to the provider in this parameter. Find more information in the documentation(/docs/guides/speech/tts#passing-parameters-directly-to-the-provider). Available for providers: Google, SaluteSpeech, T-Bank, YandexV3.
ttsOptionsTTSOptionsParameters for TTS. Note that support of the TTSOptions.pitch parameter depends on the language and dictionary used. For unsupported combinations the CallEvents.PlaybackFinished event is triggered with error 400. Available for providers: Amazon, Google, IBM, Microsoft, SaluteSpeech, T-Bank, Yandex.
voiceVoiceVoice for TTS. List of all supported voices: VoiceList. The default value is VoiceList.Amazon.en_US_Joanna. Available for providers: Amazon, Google, IBM, Microsoft, SaluteSpeech, T-Bank, Yandex, ElevenLabs.

SendMediaParameters

Custom parameters for WebSocket interaction. Can be passed as arguments to the VoxMediaUnit sendMediaTo method.

PropertyTypeReq.Description
customParametersany
encodingWebSocketAudioEncoding
tagstring

StartPlaybackParameters

The parameters can be passed as arguments to the Call.startPlayback method.

PropertyTypeReq.Description
loopbooleanWhether to loop playback.
progressivePlaybackbooleanWhether to use progressive playback. If true, the file is delivered in chunks which reduces delay before a method call and playback. The default value is false.

TransferToParameters

The parameters can be passed as arguments to the Call.transferTo method.

PropertyTypeReq.Description
callCallCall (for ‘attendant transfer’ only)
headers{ [header: string]: string }Custom parameters (SIP headers) that should be passed with a call (INVITE) message. Custom header names have to begin with the ‘X-’ prefix except the ‘VI-CallTimeout’: ‘60’ which hangs up if there is no answer after the timeout (in seconds, the default value is 60, must not be less than 10 or greater than 400). The “X-” headers can be handled by a SIP phone or WEB SDK (e.g. see the incomingCall(/docs/references/websdk/voximplant/events#incomingcall) event). Example: {‘X-header’:‘value’}.
tostringSIP(S) URI to make a call to. Example of an external call: sip:alice@example.org. Examples with the usage of TLS: sips:alice@example.org:5061 ; alice@example.org:5061;transport=tls. The format for calls to another user of the same Voximplant application: user-of-the-application@application-name.account-name.voximplant.com

MonitorMediaStatisticsParameters

The parameters can be passed as arguments to the Call.monitorMediaStatistics method.

PropertyTypeReq.Description
intervalnumberInterval between messages (in seconds). The value must not be less than 3 or greater than 10.
monitorbooleanEnables or disables media statistics monitoring.