跳转到内容

Calls WebSocket reference

此内容尚不支持你的语言。

SocketDetailsDescription
controlpath /v1/accounts/{a}/calls/socket, scope calls, protocol 4Call commands and events as JSON text. Send call.hello within five seconds of connecting, then wait for hello. Authenticate with an Authorization: Bearer header or a single-use ?ticket= issued by POST /v1/accounts/{a}/calls/tickets.
mediapath /v1/accounts/{a}/calls/{call}/media, scope calls, protocol 4Audio and video for one call you own. Send media.attach within five seconds of connecting, then wait for media.ready. JSON text messages carry track lifecycle and keyframe requests; binary messages carry a 36-byte big-endian WXCM v3 header followed by PCM16 audio or Annex-B H.265/H.264 or JPEG video bytes. Authenticate with an Authorization: Bearer header or a single-use ?ticket= issued by POST /v1/accounts/{a}/calls/tickets.

Messages you send

call.hello

Announce the protocol versions this client supports. Send it within five seconds of opening the control socket, before any command. (message, socket control, rejects unknown fields)

FieldTypeDescription
supportedProtocolVersionsarray of integer, required, items min 0, items format uint32One to eight distinct positive version numbers. The daemon picks the highest supported version (currently 3 or 4) and answers protocol.error when the list does not include one it speaks.

call.answer

Answer the incoming call. The first client to answer owns the call; others get already_claimed. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the offered call.
cameraEnabledboolean, nullableInitial camera state when answering a video call. Defaults to true for video calls, ignored for voice calls.
expectedRevisioninteger, required, min 0, format uint32The latest offer revision you received. A stale revision is rejected.
mutedboolean, nullableInitial microphone mute state when answering. Omitted means false.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.camera

Turn your outgoing camera on or off during a video or conference call. Starts a new video send generation, announced by track.updated. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
enabledboolean, requiredTrue to enable outgoing video, false to disable it.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.cancel

Cancel your outgoing call before the other side picks up. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of your outgoing call.
expectedRevisioninteger, required, min 0, format uint32The latest call revision you received. A stale revision is rejected.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.clear_audio

Discard queued outgoing audio, for example to interrupt a reply. This starts a new send generation, announced by track.updated. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.clear_video

Discard queued outgoing video without turning the camera off for the remote party, for example to interrupt a synthetic video reply. Starts a new video send generation announced by track.updated and asks the sender for a fresh keyframe with parameter sets. Requires call protocol version 4 or newer. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.dial

Start an outgoing call. The socket becomes the call’s owner. (message, socket control, rejects unknown fields)

FieldTypeDescription
callTypestring, required, values voice|videoWhether to place a voice or video call.
cameraEnabledboolean, nullableInitial camera state for video calls. Defaults to true when callType is video, ignored for voice calls.
mutedboolean, nullableInitial microphone mute state. Omitted means false.
requestIdstring, requiredYour ID for this command. The command.result repeats it.
targetobject, requiredWho to call.
target.contactIdstring, required, when kind directThe contact to call. A group ID is not accepted.
target.groupIdstring, required, when kind conferenceThe group to call, whose ID ends in @chatroom.
target.inviteesarray of string, required, when kind conferenceContacts to invite: between 1 and 100.
target.kindstring, required, values direct|conferencedirect: A direct call with one contact; conference: A new conference call in a group

call.hangup

End a call after answering or connecting. In a conference this leaves the call without ending it for the others. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
expectedRevisioninteger, required, min 0, format uint32The latest call revision you received. A stale revision is rejected.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.invite

Invite more contacts into a connected conference call you own. Results arrive as call.invitation_result. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the conference call.
contactIdsarray of string, requiredContacts to invite: between 1 and 100.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.join

Join a conference call from one of the listed invitations. The socket becomes the call’s owner, as with call.dial. (message, socket control, rejects unknown fields)

FieldTypeDescription
cameraEnabledboolean, nullableWhether to join with your camera enabled. Omitted means false.
invitationIdstring, requiredThe invitationId of an entry in conferenceInvitations.
invitationRevisioninteger, required, min 0, format uint32The revision of that entry. A stale or used invitation fails with offer_expired.
mutedboolean, nullableWhether to join with your microphone muted. Omitted means false.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.mute

Mute or unmute your outgoing audio. This also clears queued audio and starts a new send generation, announced by track.updated. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
mutedboolean, requiredTrue to mute, false to unmute.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.ready

Advertise or withdraw readiness to handle call media. A new connection is passive until it advertises readiness. (message, socket control, rejects unknown fields)

FieldTypeDescription
formatobject, required, rejects unknown fieldsThe PCM format you will send and receive. It must match the daemon’s audio format.
format.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
format.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
format.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
readyboolean, requiredTrue to advertise readiness, false to withdraw it.
requestIdstring, requiredYour ID for this command. The command.result repeats it.
scopeobject, nullableWhich calls readiness covers. Omitted means all. Ignored when withdrawing readiness.
scope.callIdstring, required, when kind offerID of the pending incoming call.
scope.expectedRevisioninteger, required, min 0, format uint32, when kind offerThe offer revision you expect; a different revision is rejected.
scope.kindstring, required, values all|outgoing|offerall: Incoming and outgoing calls; outgoing: Outgoing calls only; offer: One pending incoming call
videoobject, nullable, rejects unknown fieldsVideo codecs and bounds this client supports. Omitted for audio-only clients.
video.maxFpsinteger, nullable, min 0, max 255, format uint8Maximum frame rate in frames per second. Omitted when no cap is specified.
video.maxHeightinteger, nullable, min 0, max 65535, format uint16Maximum frame height in pixels. Omitted when no cap is specified.
video.maxWidthinteger, nullable, min 0, max 65535, format uint16Maximum frame width in pixels. Omitted when no cap is specified.
video.receiveCodecsarray of string, default []Video codecs deliverable to a receiving client, in preference order.
video.receiveCodecs[]string, values h265|h264|jpegVideo codec exchanged on a call media track.
video.sendCodecsarray of string, default []Video codecs accepted from a sending client, in preference order.
video.sendCodecs[]string, values h265|h264|jpegVideo codec exchanged on a call media track.

call.reject

Reject the incoming call. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the offered call.
expectedRevisioninteger, required, min 0, format uint32The latest offer revision you received. A stale revision is rejected.
requestIdstring, requiredYour ID for this command. The command.result repeats it.

call.watch

Say whether you are watching the video you receive. Watching is on for every call until you turn it off. While it is off, the daemon doesn’t decode or deliver video and asks for less of it; audio and your camera are unaffected. Turning it on again asks for a full picture. Daemons older than 3.6.0 don’t know this command and close the socket, which ends your call. (message, socket control, rejects unknown fields)

FieldTypeDescription
callIdstring, requiredID of the call.
enabledboolean, requiredTrue to watch, false to stop watching.
requestIdstring, requiredYour ID for this command. The command.result repeats it.
trackIdinteger, nullable, min 0, format uint32The receive video track this applies to. Omitted means every track, including those added later, and replaces what you set for single tracks.

media.attach

Attach the socket to a call you own. Send it first, within five seconds of connecting; the daemon answers media.ready. (message, socket media, rejects unknown fields)

FieldTypeDescription
clientIdstring, requiredThe clientId from the control socket’s hello.
maxSyncSkewMsinteger, nullable, min 0, format uint32Maximum audio/video arrival skew in milliseconds absorbed in shared_clock mode (0..=1000, default 400). Valid only when mediaSync is set on call protocol v4+.
mediaSyncstring, nullable, values shared_clockOptional cross-stream audio/video pacing mode (call protocol v4+). Omit for ordinary live microphone and camera calls.
ownerTokenstring, requiredThe secret ownerToken from the command.result that claimed the call. Do not log it.
supportedProtocolVersionsarray of integer, required, items min 0, items format uint32The protocol versions you support.

track.start

Start sending media on one of your send tracks for a generation. Send it before the first binary frame, and again after each new generation. (message, socket media, rejects unknown fields)

FieldTypeDescription
generationinteger, required, min 0, format uint32The generation to start.
trackIdinteger, required, min 0, format uint32The send track’s ID.

video.request_keyframe

Ask the remote sender of a receive video track to emit a fresh keyframe. (message, socket media, rejects unknown fields)

FieldTypeDescription
trackIdinteger, required, min 0, format uint32The receive video track’s ID.

Messages the daemon sends

call.control

The other party of a direct call changed a control, such as muting their microphone. It needs no reply. (message, socket control)

FieldTypeDescription
callIdstring, requiredID of the direct call.
controlobject, requiredThe control and its new value.
control.enabledboolean, required, when kind cameraTrue when the camera is sending video.
control.kindstring, required, values microphone|cameramicrophone: The participant’s microphone; camera: The participant’s camera
control.mutedboolean, required, when kind microphoneTrue when the microphone is muted.
participantIdstring, requiredThe contact whose control changed.

call.error

A failure that is not tied to a command, such as an invalid message or a missing permission. The daemon then closes the socket, except for outcome_unknown, which follows hello and leaves it open. (message, sockets control|media)

FieldTypeDescription
codestring, required, values invalid_request|busy|already_claimed|offer_expired|not_owner|unsupported|media_not_ready|outcome_unknown|capacity|stale|forbidden|closedWhat went wrong.

call.invitation_result

The outcome of each invited contact for a create or invite command, sent to the call’s owner. (message, socket control)

FieldTypeDescription
callIdstring, requiredID of the conference call.
requestIdstring, requiredThe requestId of the create or invite command.
resultsarray of object, requiredOne result per invited contact.
results[]objectThe outcome of inviting one contact. It does not mean the contact joined.
results[].contactIdstring, requiredThe contact this result is for.
results[].serviceCodeinteger, nullable, min 0, format uint32The code the service returned. Omitted when unavailable.
results[].statusstring, required, values submitted|rejected|unknown|uncertainWhat happened to the invitation.
results[].verificationRequiredboolean, requiredTrue when the service asked for a verification step. The event carries no verification link.

call.offered

An incoming call that can be answered or rejected now. (message, socket control)

FieldTypeDescription
offerobject, requiredThe offer. Send its revision in call.answer or call.reject.
offer.callIdstring, requiredID of the offered call.
offer.callTypestring, required, values voice|videoWhether the call is voice or video.
offer.callerIdstring, requiredContact ID of the caller.
offer.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
offer.revisioninteger, required, min 0, format uint32Increases when the offer changes. Send the latest value as expectedRevision when answering or rejecting.

call.peer_status

The other party of a direct call changed signaling status, such as acknowledging ringing, joining, rejecting, being busy, not answering, or leaving. It needs no reply. (message, socket control)

FieldTypeDescription
callIdstring, requiredID of the direct call.
participantIdstring, requiredContact ID of the other party.
statusobject, requiredSignaling status reported by the service.
status.codeinteger, required, min 0, format uint32The status number the service reported. Keep it for codes kind does not name.
status.kindstring, required, values undefined|joined|invited|acknowledged|left|cancelled|busy|rejected|no_response|unknownWhat the code means.

call.pending

An incoming call that cannot be answered yet, or null when none is pending. (message, socket control)

FieldTypeDescription
offerobject, required, nullableThe pending call, or null to clear it.
offer.callIdstring, requiredID of the incoming call.
offer.callTypestring, required, values voice|videoWhether the call is voice or video.
offer.callerIdstring, requiredContact ID of the caller.
offer.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
offer.phasestring, required, values waiting_for_ready|preparingWhat the call is waiting for.
offer.revisioninteger, required, min 0, format uint32Increases when the offer changes.

call.state

The call changed. Sent to every client of the same account. (message, socket control)

FieldTypeDescription
callobject, requiredThe call as it is now.
call.callIdstring, requiredID of the call.
call.callTypestring, required, values voice|videoWhether the call is voice or video.
call.controlsarray of objectThe latest controls reported by the other party of a direct call, also given to a newly connected observer. Omitted until one is reported.
call.controls[]objectA control reported by one participant.
call.controls[].controlobject, requiredThe control and its value.
call.controls[].control.enabledboolean, required, when kind cameraTrue when the camera is sending video.
call.controls[].control.kindstring, required, values microphone|cameramicrophone: The participant’s microphone; camera: The participant’s camera
call.controls[].control.mutedboolean, required, when kind microphoneTrue when the microphone is muted.
call.controls[].participantIdstring, requiredThe participant the control belongs to. In a direct call this is the contact ID.
call.directionstring, required, values incoming|outgoingWhether this account placed the call or received it.
call.groupIdstring, nullableThe group of a conference call. Omitted for a direct call.
call.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
call.ownedByThisClientboolean, requiredTrue when this connection owns the call. Always false in HTTP snapshots.
call.participantsarray of objectThe latest conference roster. Omitted for a direct call.
call.participants[]objectOne participant in a conference call.
call.participants[].cameraEnabledboolean, nullableWhether the participant’s camera is on. Omitted until the server reports it; an omitted value is unknown, not false.
call.participants[].contactIdstring, requiredContact ID of the participant.
call.participants[].membershipstring, required, values joined|invited|left|unknownWhether the participant is in the room.
call.participants[].microphoneEnabledboolean, nullableWhether the participant’s microphone is on. Omitted until the server reports it; an omitted value is unknown, not false.
call.participants[].participantIdstring, requiredID of the participant within this call. It is not a contact ID; use it to match audio tracks to participants.
call.participants[].statusobject, nullableSignaling progress, separate from membership. Omitted until reported.
call.participants[].status.codeinteger, required, min 0, format uint32The status number the service reported. Keep it for codes kind does not name.
call.participants[].status.kindstring, required, values undefined|joined|invited|acknowledged|left|cancelled|busy|rejected|no_response|unknownWhat the code means.
call.revisioninteger, required, min 0, format uint32Increases each time the call changes. Send the latest value as expectedRevision.
call.statestring, required, values offered|dialing|ringing|connecting|connected|ending|ended|uncertainWhere the call is in its life.

calls.availability

Whether this account is in a call changed. (message, socket control)

FieldTypeDescription
availabilityobject, requiredThe new availability.
availability.busyboolean, requiredTrue while this account has a call, including one whose outcome is unresolved, so a new call cannot start.
availability.ownedByThisClientboolean, requiredTrue when this connection owns that call.

command.result

The result of a command, matched to it by requestId. Acceptance starts the operation; it does not mean the call connected. (message, socket control)

FieldTypeDescription
callIdstring, required, nullableThe call the command claimed. Null unless it was a dial, answer or join that succeeded.
codestring, required, nullable, values invalid_request|busy|already_claimed|offer_expired|not_owner|unsupported|media_not_ready|outcome_unknown|capacity|stale|forbidden|closedWhy the command failed. Null unless status is error.
ownerTokenstring, required, nullableSecret token for media.attach on the claimed call. Null unless a call was claimed. Do not log it.
requestIdstring, requiredThe requestId of the command.
statusstring, required, values accepted|replayed|errorWhether the command was accepted, repeated or rejected.

conference.invitations

Replaces the list of conference calls this account can join. An empty list clears it. (message, socket control)

FieldTypeDescription
invitationsarray of object, requiredThe current invitations.
invitations[]objectA conference call this account can join. It carries no room credentials.
invitations[].callerIdstring, requiredContact ID of the caller.
invitations[].groupIdstring, requiredThe group the conference call is in.
invitations[].invitationIdstring, requiredOpaque ID for this account. Send it in call.join.
invitations[].revisioninteger, required, min 0, format uint32Revision of the invitation. Send it in call.join exactly as listed.

hello

The first event on the control socket: this connection’s ID and the current calling state. Check protocolVersion before sending commands. (message, socket control)

FieldTypeDescription
audioFormatobject, requiredThe PCM format used for call audio.
audioFormat.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
audioFormat.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
audioFormat.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
availabilityobject, requiredWhether this account is in a call.
availability.busyboolean, requiredTrue while this account has a call, including one whose outcome is unresolved, so a new call cannot start.
availability.ownedByThisClientboolean, requiredTrue when this connection owns that call.
capabilitiesobject, requiredCalling operations that are available.
capabilities.conferenceAudiobooleanAudio in conference calls is available.
capabilities.conferenceCreatebooleanStarting a conference call in a group is available.
capabilities.conferenceInvitebooleanInviting more contacts into a connected conference call is available.
capabilities.conferenceJoinbooleanJoining a conference call from an invitation is available.
capabilities.conferenceVideobooleanVideo in conference calls is available.
capabilities.directAudiobooleanDirect voice calls with one contact are available.
capabilities.directVideobooleanDirect video calls are available.
clientIdstring, requiredID of this connection. Send it as clientId in media.attach.
conferenceInvitationsarray of object, requiredConference calls this account can join.
conferenceInvitations[]objectA conference call this account can join. It carries no room credentials.
conferenceInvitations[].callerIdstring, requiredContact ID of the caller.
conferenceInvitations[].groupIdstring, requiredThe group the conference call is in.
conferenceInvitations[].invitationIdstring, requiredOpaque ID for this account. Send it in call.join.
conferenceInvitations[].revisioninteger, required, min 0, format uint32Revision of the invitation. Send it in call.join exactly as listed.
currentCallobject, required, nullableThe active call, or null.
currentCall.callIdstring, requiredID of the call.
currentCall.callTypestring, required, values voice|videoWhether the call is voice or video.
currentCall.controlsarray of objectThe latest controls reported by the other party of a direct call, also given to a newly connected observer. Omitted until one is reported.
currentCall.controls[]objectA control reported by one participant.
currentCall.controls[].controlobject, requiredThe control and its value.
currentCall.controls[].control.enabledboolean, required, when kind cameraTrue when the camera is sending video.
currentCall.controls[].control.kindstring, required, values microphone|cameramicrophone: The participant’s microphone; camera: The participant’s camera
currentCall.controls[].control.mutedboolean, required, when kind microphoneTrue when the microphone is muted.
currentCall.controls[].participantIdstring, requiredThe participant the control belongs to. In a direct call this is the contact ID.
currentCall.directionstring, required, values incoming|outgoingWhether this account placed the call or received it.
currentCall.groupIdstring, nullableThe group of a conference call. Omitted for a direct call.
currentCall.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
currentCall.ownedByThisClientboolean, requiredTrue when this connection owns the call. Always false in HTTP snapshots.
currentCall.participantsarray of objectThe latest conference roster. Omitted for a direct call.
currentCall.participants[]objectOne participant in a conference call.
currentCall.participants[].cameraEnabledboolean, nullableWhether the participant’s camera is on. Omitted until the server reports it; an omitted value is unknown, not false.
currentCall.participants[].contactIdstring, requiredContact ID of the participant.
currentCall.participants[].membershipstring, required, values joined|invited|left|unknownWhether the participant is in the room.
currentCall.participants[].microphoneEnabledboolean, nullableWhether the participant’s microphone is on. Omitted until the server reports it; an omitted value is unknown, not false.
currentCall.participants[].participantIdstring, requiredID of the participant within this call. It is not a contact ID; use it to match audio tracks to participants.
currentCall.participants[].statusobject, nullableSignaling progress, separate from membership. Omitted until reported.
currentCall.participants[].status.codeinteger, required, min 0, format uint32The status number the service reported. Keep it for codes kind does not name.
currentCall.participants[].status.kindstring, required, values undefined|joined|invited|acknowledged|left|cancelled|busy|rejected|no_response|unknownWhat the code means.
currentCall.revisioninteger, required, min 0, format uint32Increases each time the call changes. Send the latest value as expectedRevision.
currentCall.statestring, required, values offered|dialing|ringing|connecting|connected|ending|ended|uncertainWhere the call is in its life.
currentOfferobject, required, nullableThe incoming call that can be answered now, or null.
currentOffer.callIdstring, requiredID of the offered call.
currentOffer.callTypestring, required, values voice|videoWhether the call is voice or video.
currentOffer.callerIdstring, requiredContact ID of the caller.
currentOffer.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
currentOffer.revisioninteger, required, min 0, format uint32Increases when the offer changes. Send the latest value as expectedRevision when answering or rejecting.
currentPendingOfferobject, required, nullableAn incoming call that cannot be answered yet, or null.
currentPendingOffer.callIdstring, requiredID of the incoming call.
currentPendingOffer.callTypestring, required, values voice|videoWhether the call is voice or video.
currentPendingOffer.callerIdstring, requiredContact ID of the caller.
currentPendingOffer.kindstring, required, values direct|conferenceWhether the call is direct or a conference.
currentPendingOffer.phasestring, required, values waiting_for_ready|preparingWhat the call is waiting for.
currentPendingOffer.revisioninteger, required, min 0, format uint32Increases when the offer changes.
protocolVersioninteger, required, min 0, format uint32The protocol version the daemon speaks on this socket.
videoCapabilitiesobject, nullableVideo codecs and bounds this daemon can exchange. Omitted when video is unavailable.
videoCapabilities.maxFpsinteger, nullable, min 0, max 255, format uint8Maximum frame rate in frames per second. Omitted when no cap is specified.
videoCapabilities.maxHeightinteger, nullable, min 0, max 65535, format uint16Maximum frame height in pixels. Omitted when no cap is specified.
videoCapabilities.maxWidthinteger, nullable, min 0, max 65535, format uint16Maximum frame width in pixels. Omitted when no cap is specified.
videoCapabilities.receiveCodecsarray of string, requiredVideo codecs deliverable to a receiving client, in preference order.
videoCapabilities.receiveCodecs[]string, values h265|h264|jpegVideo codec exchanged on a call media track.
videoCapabilities.sendCodecsarray of string, requiredVideo codecs accepted from a sending client, in preference order.
videoCapabilities.sendCodecs[]string, values h265|h264|jpegVideo codec exchanged on a call media track.

media.ready

Sent on the media socket after media.attach succeeds: the audio and video tracks to use. (message, socket media)

FieldTypeDescription
protocolVersioninteger, required, min 0, format uint32The protocol version the daemon speaks on the media socket.
receiveTracksarray of object, requiredThe tracks for media you receive, one per audio or video source.
receiveTracks[]objectOne audio or video stream: a track you send, or one source you receive.
receiveTracks[].activeboolean, required, when media videoTrue when this video track is currently active.
receiveTracks[].directionstring, required, values send|receiveWhether you send or receive media on this track.
receiveTracks[].generationinteger, required, min 0, format uint32Version of the stream. Frames for an older generation are discarded; a new generation starts after call.clear_audio, call.clear_video, a mute change, a camera toggle, or a format change.
receiveTracks[].idinteger, required, min 0, format uint32Track ID to use in track.start, video.request_keyframe and binary WXCM frames.
receiveTracks[].mediastring, required, values audio|videoaudio: One PCM audio stream; video: One video stream
receiveTracks[].participantIdstring, nullableThe conference participant this track carries. Omitted when the track is not tied to a participant.
receiveTracks[][audio].formatobject, required, when media audioThe PCM format of the track.
receiveTracks[][audio].format.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
receiveTracks[][audio].format.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
receiveTracks[][audio].format.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
receiveTracks[][video].formatobject, required, when media videoThe negotiated video codec, mode and bounds of the track.
receiveTracks[][video].format.bitrateKbpsinteger, nullable, min 0, format uint32Target bitrate in kbps when encoding or transcoding. Omitted for pass-through or JPEG.
receiveTracks[][video].format.codecstring, required, values h265|h264|jpegCodec carried on this track.
receiveTracks[][video].format.maxFpsinteger, required, min 0, max 255, format uint8Maximum frame rate in frames per second for this track.
receiveTracks[][video].format.maxHeightinteger, required, min 0, max 65535, format uint16Maximum frame height in pixels for this track.
receiveTracks[][video].format.maxWidthinteger, required, min 0, max 65535, format uint16Maximum frame width in pixels for this track.
receiveTracks[][video].format.modestring, required, values passthrough|transcodedWhether this track passes wire frames straight through or transcodes them.
sendTracksarray of object, requiredThe tracks for media you send (audio, plus video when negotiated).
sendTracks[]objectOne audio or video stream: a track you send, or one source you receive.
sendTracks[].activeboolean, required, when media videoTrue when this video track is currently active.
sendTracks[].directionstring, required, values send|receiveWhether you send or receive media on this track.
sendTracks[].generationinteger, required, min 0, format uint32Version of the stream. Frames for an older generation are discarded; a new generation starts after call.clear_audio, call.clear_video, a mute change, a camera toggle, or a format change.
sendTracks[].idinteger, required, min 0, format uint32Track ID to use in track.start, video.request_keyframe and binary WXCM frames.
sendTracks[].mediastring, required, values audio|videoaudio: One PCM audio stream; video: One video stream
sendTracks[].participantIdstring, nullableThe conference participant this track carries. Omitted when the track is not tied to a participant.
sendTracks[][audio].formatobject, required, when media audioThe PCM format of the track.
sendTracks[][audio].format.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
sendTracks[][audio].format.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
sendTracks[][audio].format.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
sendTracks[][video].formatobject, required, when media videoThe negotiated video codec, mode and bounds of the track.
sendTracks[][video].format.bitrateKbpsinteger, nullable, min 0, format uint32Target bitrate in kbps when encoding or transcoding. Omitted for pass-through or JPEG.
sendTracks[][video].format.codecstring, required, values h265|h264|jpegCodec carried on this track.
sendTracks[][video].format.maxFpsinteger, required, min 0, max 255, format uint8Maximum frame rate in frames per second for this track.
sendTracks[][video].format.maxHeightinteger, required, min 0, max 65535, format uint16Maximum frame height in pixels for this track.
sendTracks[][video].format.maxWidthinteger, required, min 0, max 65535, format uint16Maximum frame width in pixels for this track.
sendTracks[][video].format.modestring, required, values passthrough|transcodedWhether this track passes wire frames straight through or transcodes them.

participant.updated

A conference participant’s membership or microphone changed. A call.state with the new roster follows. (message, socket control)

FieldTypeDescription
callIdstring, requiredID of the conference call.
participantobject, requiredThe participant as it is now.
participant.cameraEnabledboolean, nullableWhether the participant’s camera is on. Omitted until the server reports it; an omitted value is unknown, not false.
participant.contactIdstring, requiredContact ID of the participant.
participant.membershipstring, required, values joined|invited|left|unknownWhether the participant is in the room.
participant.microphoneEnabledboolean, nullableWhether the participant’s microphone is on. Omitted until the server reports it; an omitted value is unknown, not false.
participant.participantIdstring, requiredID of the participant within this call. It is not a contact ID; use it to match audio tracks to participants.
participant.statusobject, nullableSignaling progress, separate from membership. Omitted until reported.
participant.status.codeinteger, required, min 0, format uint32The status number the service reported. Keep it for codes kind does not name.
participant.status.kindstring, required, values undefined|joined|invited|acknowledged|left|cancelled|busy|rejected|no_response|unknownWhat the code means.
revisioninteger, required, min 0, format uint32The call revision after this change.

protocol.error

The protocol version could not be agreed. The daemon then closes the socket with WebSocket code 1002. (message, sockets control|media)

FieldTypeDescription
clientVersionsarray of integer, required, items min 0, items format uint32The versions the client announced. Empty when the list was invalid.
codestring, required, values unsupported_protocol_version|invalid_protocol_versionWhy the versions were refused.
serverVersionsarray of integer, required, items min 0, items format uint32The versions the daemon supports.

track.added

A receive audio or video track appeared. Frames for it follow. (message, sockets control|media)

FieldTypeDescription
callIdstring, requiredID of the call.
trackobject, requiredThe new track.
track.activeboolean, required, when media videoTrue when this video track is currently active.
track.directionstring, required, values send|receiveWhether you send or receive media on this track.
track.generationinteger, required, min 0, format uint32Version of the stream. Frames for an older generation are discarded; a new generation starts after call.clear_audio, call.clear_video, a mute change, a camera toggle, or a format change.
track.idinteger, required, min 0, format uint32Track ID to use in track.start, video.request_keyframe and binary WXCM frames.
track.mediastring, required, values audio|videoaudio: One PCM audio stream; video: One video stream
track.participantIdstring, nullableThe conference participant this track carries. Omitted when the track is not tied to a participant.
track[audio].formatobject, required, when media audioThe PCM format of the track.
track[audio].format.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
track[audio].format.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
track[audio].format.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
track[video].formatobject, required, when media videoThe negotiated video codec, mode and bounds of the track.
track[video].format.bitrateKbpsinteger, nullable, min 0, format uint32Target bitrate in kbps when encoding or transcoding. Omitted for pass-through or JPEG.
track[video].format.codecstring, required, values h265|h264|jpegCodec carried on this track.
track[video].format.maxFpsinteger, required, min 0, max 255, format uint8Maximum frame rate in frames per second for this track.
track[video].format.maxHeightinteger, required, min 0, max 65535, format uint16Maximum frame height in pixels for this track.
track[video].format.maxWidthinteger, required, min 0, max 65535, format uint16Maximum frame width in pixels for this track.
track[video].format.modestring, required, values passthrough|transcodedWhether this track passes wire frames straight through or transcodes them.

track.removed

A receive track ended. Frames for that generation stop. (message, sockets control|media)

FieldTypeDescription
callIdstring, requiredID of the call.
generationinteger, required, min 0, format uint32The generation that ended.
reasonstring, requiredWhy the track ended. Currently source_unavailable.
trackIdinteger, required, min 0, format uint32ID of the track that ended.

track.updated

A track moved to a new generation or state, for example after call.clear_audio, call.clear_video, a mute change, or call.camera. Send new frames on the new generation. (message, sockets control|media)

FieldTypeDescription
callIdstring, requiredID of the call.
trackobject, requiredThe track with its new generation or state.
track.activeboolean, required, when media videoTrue when this video track is currently active.
track.directionstring, required, values send|receiveWhether you send or receive media on this track.
track.generationinteger, required, min 0, format uint32Version of the stream. Frames for an older generation are discarded; a new generation starts after call.clear_audio, call.clear_video, a mute change, a camera toggle, or a format change.
track.idinteger, required, min 0, format uint32Track ID to use in track.start, video.request_keyframe and binary WXCM frames.
track.mediastring, required, values audio|videoaudio: One PCM audio stream; video: One video stream
track.participantIdstring, nullableThe conference participant this track carries. Omitted when the track is not tied to a participant.
track[audio].formatobject, required, when media audioThe PCM format of the track.
track[audio].format.channelsinteger, required, min 0, max 255, format uint8Number of interleaved channels.
track[audio].format.frameMsinteger, required, min 0, max 65535, format uint16Length of one audio frame in milliseconds.
track[audio].format.sampleRateinteger, required, min 0, format uint32Samples per second, per channel.
track[video].formatobject, required, when media videoThe negotiated video codec, mode and bounds of the track.
track[video].format.bitrateKbpsinteger, nullable, min 0, format uint32Target bitrate in kbps when encoding or transcoding. Omitted for pass-through or JPEG.
track[video].format.codecstring, required, values h265|h264|jpegCodec carried on this track.
track[video].format.maxFpsinteger, required, min 0, max 255, format uint8Maximum frame rate in frames per second for this track.
track[video].format.maxHeightinteger, required, min 0, max 65535, format uint16Maximum frame height in pixels for this track.
track[video].format.maxWidthinteger, required, min 0, max 65535, format uint16Maximum frame width in pixels for this track.
track[video].format.modestring, required, values passthrough|transcodedWhether this track passes wire frames straight through or transcodes them.

video.keyframe_requested

Sent on the media socket when the remote party asks your video encoder for a fresh keyframe (IDR with inline parameter sets). (message, socket media)

FieldTypeDescription
callIdstring, requiredID of the call.
generationinteger, required, min 0, format uint32Generation of your outgoing video track.
trackIdinteger, required, min 0, format uint32ID of your outgoing video track.