Event of Call Status Change CallCard::CallStateChanged

We are still updating this page

Some data may be missing here — we will complete it soon.

Scope: telephony

Who can subscribe: any user

The event CallCard::CallStateChanged occurs when the status of the current call changes.

What the handler receives

The specified arguments are passed to the handler.

Required parameters are marked with *

Parameter
type

Description

PHONE_NUMBER*
callState

Current state of the call (idle, connecting, connected)

additionalParams
object

Object with additional fields

Parameter data[]

Parameter
type

Description

failedCode
string

Call completion code. Passed only in case of an unsuccessful call completion when transitioning to the idle state

Event Subscription

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"PLACEMENT":"CallCard::CallStateChanged","HANDLER":"**your_handler_url_here**"}' \
        "https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/placement.bindEvent"
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"PLACEMENT":"CallCard::CallStateChanged","HANDLER":"**your_handler_url_here**"}' \
        "https://**put_your_bitrix24_address**/rest/placement.bindEvent?auth=**put_access_token_here**"
        
BX24.placement.bindEvent("CallCard::CallStateChanged", function (callState) {
            console.log(callState);
        });
        
require_once('crest.php');
        
        $result = CRest::call(
            'placement.bindEvent',
            [
                'PLACEMENT' => 'CallCard::CallStateChanged',
                'HANDLER' => '**your_handler_url_here**'
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        

Continue Learning