When Clicking the "Continue Call" Button BackgroundCallCard::cancelTransferButtonClick
Choose a tool for developing with an AI agent:
- use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
- use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation
Scope:
placement— registration of the placement,telephony— registration of the call that raises the cardWho can subscribe: any user
The BackgroundCallCard::cancelTransferButtonClick event occurs when the operator clicks the "Continue call" button to cancel the transfer.
The button is available in the transferring and transferFailed states. The application enables them with the CallCardSetUiState command. A transfer starts with the transferButtonClick event, when the operator selects the recipient. In the transferring state, one of two events follows: completeTransferButtonClick if the operator confirmed the transfer, or cancelTransferButtonClick if they canceled it. In the transferFailed state, the "Redirect" button is not shown, so only cancelTransferButtonClick can occur.
Bitrix24 does not cancel the transfer of an application call itself: the application aborts the transfer on its side and returns the card to the connected state.
The event operates within the application context in the PAGE_BACKGROUND_WORKER placement. This is a JS interface event, not a REST event: you cannot subscribe to it with a request to /rest/.
What the Handler Receives
No data is passed to the event handler.
Event Subscription Parameters
The handler is registered from the widget with the BX24.placement.bindEvent method.
Required parameters are marked with *
|
Name |
Description |
|
event* |
The name of the interface event. For this event — |
|
callback* |
The function Bitrix24 invokes when the event occurs. No arguments are passed to the handler |
Code Examples
How to Use Examples in Documentation
BX24.ready(function () {
BX24.init(function () {
BX24.placement.bindEvent('BackgroundCallCard::cancelTransferButtonClick', function () {
// handler code
});
});
});
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide)
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
await $b24.placement.bindEvent('BackgroundCallCard::cancelTransferButtonClick', () => {
// handler code
})
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const $b24 = await B24Js.initializeB24Frame()
await $b24.placement.bindEvent('BackgroundCallCard::cancelTransferButtonClick', () => {
// handler code
})
})
</script>
Errors
Check the following conditions.
- The widget is open in the
PAGE_BACKGROUND_WORKERplacement. In other placements, theBackgroundCallCard::*events are not registered, and the subscription silently fails - The event name is passed without typos and with the correct capitalization. The list of events available in the current placement is returned by BX24.placement.getInterface
- The call was raised by the application with the telephony.externalCall.register method. For calls made by Bitrix24 itself, the
BackgroundCallCard::*events are not emitted at all
Continue Learning
- Overview of Events for Working with the Call Card of a WebRTC Client
- Set Up an Event Handler for the Interface BX24.placement.bindEvent
- Call Card
- Manage the Call Card of a WebRTC Client: Overview of Commands and Events
- When Selecting an Operator to Transfer the Call To BackgroundCallCard::transferButtonClick
- When Clicking the "Redirect" Button BackgroundCallCard::completeTransferButtonClick
- Change the Call Card Interface State from the Application CallCardSetUiState