Start the Call Timer from the Application CallCardStartTimer
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.
Scope:
placement— registration of the placement,telephony— registration of the call that raises the cardWho can execute the command: any user
The CallCardStartTimer command shows the timer in the call card and starts counting the conversation time.
The command operates within the application context in the PAGE_BACKGROUND_WORKER placement. This is a JS interface command, not a REST method: it cannot be invoked with a request to /rest/.
The command is needed when the application counts the conversation time itself. When the card switches to the connected state, the timer starts automatically — the automatic start can be disabled with the disableAutoStartTimer parameter of the CallCardSetUiState command.
The countdown runs from the moment of the first start, not from the command call. If the timer is already running, the command changes nothing; after CallCardStopTimer, it resumes counting from the previous point rather than from zero. The only way to reset it is to switch the card to connected with disableAutoStartTimer.
How to Call the Command
The command is invoked from the widget with the BX24.placement.call method. The third argument is the callback function, which receives the result of the command.
BX24.placement.call('CallCardStartTimer', {}, function (result) {
// in the browser, the callback function is not invoked on success
console.log(result);
});
Command Parameters
The command takes no parameters. Pass an empty object {} as the second argument.
Code Examples
How to Use Examples in Documentation
It is recommended to call the command after the BackgroundCallCard::initialized event
BX24.ready(function () {
BX24.init(function () {
BX24.placement.call('CallCardStartTimer', {}, function (result) {
console.log(result);
});
});
});
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide)
import type { B24Frame } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
// in the browser, the promise does not resolve on success — do not await the result
$b24.placement.call('CallCardStartTimer')
<!-- 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()
// in the browser, the promise does not resolve on success — do not await the result
$b24.placement.call('CallCardStartTimer')
})
</script>
Command Result
In the browser, a successful call returns nothing: the callback function is not invoked, and the timer appears in the card.
In the Bitrix24 desktop application, an empty array arrives after a successful call.
[]
Errors
The command error arrives in the same callback function: instead of the usual result, it receives an array with an object whose result equals error.
[
{
"result": "error",
"errorCode": "Call card is undefined"
}
]
errorCode Values
|
Code |
Description |
Value |
|
|
The call card is unavailable |
There is no active call card to manage. The same code arrives when the card exists but the call is not an external one: the interface only works with a card raised by the telephony.externalCall.register method |
If the command is invoked in another placement, the callback function will not be invoked at all: the placement interface ignores an unknown command. To check that the CallCardStartTimer command is available, use the BX24.placement.getInterface method.