From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


onSoftphoneStatusChange

Subscribe to any softphone status change event.

Request

Syntax

on('ON_SOFTPHONE_STATUS_CHANGE', handler: OnSoftphoneStatusChangeHandler): void


type OnSoftphoneStatusChangeHandler = (ready: boolean, error?: string) => SyncAsyncResult

Parameters

Parameter Parameter Values Data Type Optional/Required Description
ready Boolean Required If set to true, the softphone is available; if set to false, the softphone is not available.
error String Optional If ready is false, this shows the reason why the softphone isn't available.

Example Request

function softphoneStateChangeCallback(ready: boolean, error?: string) {

if (error) {

console.log("Softphone error:", error);

}

console.log("Softphone available?", ready);

}

adApi.on("ON_SOFTPHONE_STATUS_CHANGE", softphoneStateChangeCallback);

Return Value

null

< Previous | Next >