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
- Register the
PAGE_BACKGROUND_WORKERplacement via placement.bind. - Check the registration script and requirements for
errorHandlerUrlon the WebRTC Integration Script page. - Register the call using telephony.externalcall.register to open the call card.
- After the BackgroundCallCard::initialized event, invoke placement commands through BX24.placement.call.
- 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:
telephonyWho can execute methods: any user
|
Method |
Description |
|
Mutes or unmutes the operator's microphone |
|
|
Puts the call on hold or resumes it |
|
|
Changes the state of the call card interface |
|
|
Returns available states of the card interface |
|
|
Changes the title of the call card |
|
|
Changes the text in the central part of the card |
|
|
Closes the call card |
|
Event |
Triggered |
|
After the call card is created |
|
|
When saving a comment in the call card |
|
|
When the mute button is clicked |
|
|
When the hold button is clicked |
|
|
When the close button of the call card is clicked |
|
|
When selecting an operator to transfer the call |
|
|
When the "return to call" button is clicked |
|
|
When the "redirect" button is clicked |
|
|
When the "end" button is clicked |
|
|
When the "next" button is clicked |
|
|
When the "skip" button is clicked |
|
|
When the "answer" button is clicked |
|
|
When the current entity being called changes in the call card |
|
|
When the "call" or "call back" button is clicked |
|
|
When rating the call quality |
|
|
When one of the phone's number buttons is clicked |
|
|
When the "notify admin" button is clicked |