跳转到内容

Calls

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

GET /v1/accounts/{a}/calls/current

Show whether the account is in a call, the incoming offer and the available call features.

Scope: calls

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Response: CallSnapshot

GET /v1/accounts/{a}/calls/socket

Open the call control WebSocket for commands and events. See calls-websocket.txt.

Scope: calls

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

POST /v1/accounts/{a}/calls/tickets

Issue a short-lived single-use ticket for opening a call WebSocket from a browser.

Scope: calls

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: CallTicketRequest

Response: CallTicketResponse

GET /v1/accounts/{a}/calls/{call}/media

Open the call media WebSocket that carries binary audio and video for a call you own. See calls-websocket.txt.

Scope: calls

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
call (required)pathstringCall ID.

Types

CallAudioFormat

The PCM format of call audio. The daemon currently supports only 16,000 Hz, mono, 20 ms frames.

FieldTypeDescription
channels (required)integerNumber of interleaved channels.
frameMs (required)integerLength of one audio frame in milliseconds.
sampleRate (required)integerSamples per second, per channel.

CallCapabilities

Calling operations that are available. A missing flag means unavailable.

FieldTypeDescription
conferenceAudiobooleanAudio in conference calls is available.
conferenceCreatebooleanStarting a conference call in a group is available.
conferenceInvitebooleanInviting more contacts into a connected conference call is available.
conferenceJoinbooleanJoining a conference call from an invitation is available.
conferenceVideobooleanVideo in conference calls is available.
directAudiobooleanDirect voice calls with one contact are available.
directVideobooleanDirect video calls are available.

CallConferenceInvitation

A conference call this account can join. It carries no room credentials.

FieldTypeDescription
callerId (required)stringContact ID of the caller.
groupId (required)stringThe group the conference call is in.
invitationId (required)stringOpaque ID for this account. Send it in call.join.
revision (required)integerRevision of the invitation. Send it in call.join exactly as listed.

CallControl

A control a call participant can report. A microphone or camera update does not reset the call’s audio format.

ValueDescription
objectThe participant’s microphone.
objectThe participant’s camera.

CallDirection

Whether this account placed the call or received it.

ValueDescription
”incoming”Another party called this account.
”outgoing”This account placed the call.

CallKind

Whether a call is with one contact or with a group.

ValueDescription
”direct”A call with one contact.
”conference”A call in a group.

CallMembership

Whether a participant is in a conference call.

ValueDescription
”joined”In the room.
”invited”Invited but not in the room.
”left”Was in the room and left.
”unknown”The server has not said.

CallOffer

An incoming call that can be answered or rejected now.

FieldTypeDescription
callId (required)stringID of the offered call.
callType (required)CallTypeWhether the call is voice or video.
callerId (required)stringContact ID of the caller.
kind (required)CallKindWhether the call is direct or a conference.
revision (required)integerIncreases when the offer changes. Send the latest value as expectedRevision when answering or rejecting.

CallParticipant

One participant in a conference call.

FieldTypeDescription
cameraEnabledboolean, nullableWhether the participant’s camera is on. Omitted until the server reports it; an omitted value is unknown, not false.
contactId (required)stringContact ID of the participant.
membership (required)CallMembershipWhether the participant is in the room.
microphoneEnabledboolean, nullableWhether the participant’s microphone is on. Omitted until the server reports it; an omitted value is unknown, not false.
participantId (required)stringID of the participant within this call. It is not a contact ID; use it to match audio tracks to participants.
statusCallParticipantStatus or , nullableSignaling progress, separate from membership. Omitted until reported.

CallParticipantControl

A control reported by one participant.

FieldTypeDescription
control (required)CallControlThe control and its value.
participantId (required)stringThe participant the control belongs to. In a direct call this is the contact ID.

CallParticipantStatus

Signaling progress of a participant, independent of membership.

FieldTypeDescription
code (required)integerThe status number the service reported. Keep it for codes kind does not name.
kind (required)CallParticipantStatusKindWhat the code means.

CallParticipantStatusKind

What a participant status code means. Cancelled, busy, rejected and no response do not by themselves mean a participant left.

ValueDescription
”undefined”Code 0: no state reported.
”joined”Code 1: in the room.
”invited”Code 2: invited, not in the room.
”acknowledged”Code 3: invited and acknowledged, not in the room.
”left”Code 4: left the room.
”cancelled”Code 5: cancelled.
”busy”Code 6: busy.
”rejected”Code 7: rejected.
”no_response”Code 8: no response.
”unknown”Any other code. No join or departure is implied.

CallPendingOffer

An incoming call that cannot be answered yet, because it is waiting for a ready client or for the daemon to finish preparing it.

FieldTypeDescription
callId (required)stringID of the incoming call.
callType (required)CallTypeWhether the call is voice or video.
callerId (required)stringContact ID of the caller.
kind (required)CallKindWhether the call is direct or a conference.
phase (required)CallPendingPhaseWhat the call is waiting for.
revision (required)integerIncreases when the offer changes.

CallPendingPhase

How far along an incoming call is before it can be answered.

ValueDescription
”waiting_for_ready”Waiting for a client to advertise readiness.
”preparing”The daemon is preparing the call.

CallSnapshot

The state of calling for one account, as returned by the HTTP snapshot route. The hello event carries the same fields.

FieldTypeDescription
audioFormat (required)CallAudioFormatThe PCM format used for call audio.
availability (required)CallsAvailabilityWhether this account is in a call.
capabilities (required)CallCapabilitiesCalling operations that are available.
conferenceInvitations (required)array of CallConferenceInvitationConference calls this account can join.
currentCall (required)CallView or , nullableThe active call, or null.
currentOffer (required)CallOffer or , nullableThe incoming call that can be answered now, or null.
currentPendingOffer (required)CallPendingOffer or , nullableAn incoming call that cannot be answered yet, or null.
videoCapabilitiesCallVideoCapabilities or , nullableVideo codecs and bounds this daemon can exchange. Omitted when video is unavailable.

CallState

Where a call is in its life. Stop sending audio at ending, and keep the control socket connected while the daemon finishes cleanup.

ValueDescription
”offered”An incoming call is waiting to be answered or rejected.
”dialing”An outgoing call is being placed.
”ringing”The other side is ringing.
”connecting”The call was accepted and audio is being set up.
”connected”The call is up and audio can flow.
”ending”The call is being hung up.
”ended”The call is over.
”uncertain”The outcome could not be confirmed.

CallTicketRequest

Request body for issuing a short-lived single-use browser WebSocket ticket.

FieldTypeDescription
callIdstring, nullableRequired when socket is media; omitted when socket is control.
socket (required)CallTicketSocketWhich calls WebSocket this ticket authorizes.

CallTicketResponse

Response returned when issuing a single-use browser WebSocket ticket.

FieldTypeDescription
callIdstring, nullableBound call ID when socket is media. Omitted for control.
expiresAt (required)integerUnix timestamp in seconds when the ticket expires.
expiresInSeconds (required)integerTicket lifetime in seconds from issuance.
socket (required)CallTicketSocketWhich calls WebSocket this ticket authorizes.
ticket (required)stringOpaque single-use ticket to pass as ?ticket= on the matching WebSocket URL. Do not log it.

CallTicketSocket

Which calls WebSocket a single-use browser ticket authorizes.

ValueDescription
”control”The call control WebSocket (/v1/accounts/{a}/calls/socket).
“media”The call media WebSocket (/v1/accounts/{a}/calls/{call}/media).

CallType

Whether a call is voice or video, independent of the media currently negotiated. A video call can continue with audio only.

ValueDescription
”voice”A voice call.
”video”A video call.

CallVideoCapabilities

Video codecs and bounds advertised by the daemon or a ready client.

FieldTypeDescription
maxFpsinteger, nullableMaximum frame rate in frames per second. Omitted when no cap is specified.
maxHeightinteger, nullableMaximum frame height in pixels. Omitted when no cap is specified.
maxWidthinteger, nullableMaximum frame width in pixels. Omitted when no cap is specified.
receiveCodecs (required)array of CallVideoCodecVideo codecs deliverable to a receiving client, in preference order.
sendCodecs (required)array of CallVideoCodecVideo codecs accepted from a sending client, in preference order.

CallVideoCodec

Video codec exchanged on a call media track.

ValueDescription
”h265”Annex-B H.265 / HEVC frames.
”h264”Annex-B H.264 / AVC frames.
”jpeg”Standalone JPEG still frames.

CallView

A call this account is in.

FieldTypeDescription
callId (required)stringID of the call.
callType (required)CallTypeWhether the call is voice or video.
controlsarray of CallParticipantControlThe latest controls reported by the other party of a direct call, also given to a newly connected observer. Omitted until one is reported.
direction (required)CallDirectionWhether this account placed the call or received it.
groupIdstring, nullableThe group of a conference call. Omitted for a direct call.
kind (required)CallKindWhether the call is direct or a conference.
ownedByThisClient (required)booleanTrue when this connection owns the call. Always false in HTTP snapshots.
participantsarray of CallParticipantThe latest conference roster. Omitted for a direct call.
revision (required)integerIncreases each time the call changes. Send the latest value as expectedRevision.
state (required)CallStateWhere the call is in its life.

CallsAvailability

Whether this account is in a call.

FieldTypeDescription
busy (required)booleanTrue while this account has a call, including one whose outcome is unresolved, so a new call cannot start.
ownedByThisClient (required)booleanTrue when this connection owns that call.