Managing the Call Card of a WebRTC Client: Overview of Methods

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

The PAGE_BACKGROUND_WORKER placement is utilized by telephony applications that need to interact with the call card from a background invisible frame on Bitrix24 pages. Through the JavaScript interface of the placement, the application can change the state of the card, manage operator actions, and handle interface events.

Quick navigation: all methods and events

User documentation: Call Card

Getting Started with PAGE_BACKGROUND_WORKER

  1. Register the PAGE_BACKGROUND_WORKER placement via placement.bind.
  2. Check the registration script and requirements for errorHandlerUrl on the WebRTC Integration Script page.
  3. Register the call using telephony.externalcall.register to open the call card.
  4. After the BackgroundCallCard::initialized event, invoke placement commands through BX24.placement.call.
  5. Subscribe to user actions on the card via BX24.placement.bindEvent.

How the Placement API Call Works

In PAGE_BACKGROUND_WORKER, placement commands and events are not standalone REST methods. The application interacts with them through a common JavaScript embedding interface.

To execute a placement command, pass its name to BX24.placement.call. For PAGE_BACKGROUND_WORKER, the available commands are CallCardSetMute, CallCardSetHold, CallCardSetUiState, CallCardGetListUiStates, CallCardSetCardTitle, CallCardSetStatusText, and CallCardClose. Card management commands typically return an empty array upon successful invocation, while CallCardGetListUiStates returns an array of available interface states.

To respond to user actions on the card without making repeated requests, subscribe to events via BX24.placement.bindEvent. In PAGE_BACKGROUND_WORKER, a set of events BackgroundCallCard::* is available from the Events section. The handler receives data about the current call and card, as well as specific user action data from the interface.

Overview of Methods and Events

Scope: telephony

Who can execute methods: any user

Method

Description

CallCardSetMute

Mutes or unmutes the operator's microphone

CallCardSetHold

Puts the call on hold or resumes it

CallCardSetUiState

Changes the state of the call card interface

CallCardGetListUiStates

Returns available states of the card interface

CallCardSetCardTitle

Changes the title of the call card

CallCardSetStatusText

Changes the text in the central part of the card

CallCardClose

Closes the call card

Event

Triggered

BackgroundCallCard::initialized

After the call card is created

BackgroundCallCard::addCommentButtonClick

When saving a comment in the call card

BackgroundCallCard::muteButtonClick

When the mute button is clicked

BackgroundCallCard::holdButtonClick

When the hold button is clicked

BackgroundCallCard::closeButtonClick

When the close button of the call card is clicked

BackgroundCallCard::transferButtonClick

When selecting an operator to transfer the call

BackgroundCallCard::cancelTransferButtonClick

When the "return to call" button is clicked

BackgroundCallCard::completeTransferButtonClick

When the "redirect" button is clicked

BackgroundCallCard::hangupButtonClick

When the "end" button is clicked

BackgroundCallCard::nextButtonClick

When the "next" button is clicked

BackgroundCallCard::skipButtonClick

When the "skip" button is clicked

BackgroundCallCard::answerButtonClick

When the "answer" button is clicked

BackgroundCallCard::entityChanged

When the current entity being called changes in the call card

BackgroundCallCard::makeCallButtonClick

When the "call" or "call back" button is clicked

BackgroundCallCard::qualityMeterClick

When rating the call quality

BackgroundCallCard::dialpadButtonClick

When one of the phone's number buttons is clicked

BackgroundCallCard::notifyAdminButtonClick

When the "notify admin" button is clicked