From Bright Pattern Documentation
< 5.19:AgentDesktop-client-side-javascript-api-specification
Revision as of 04:01, 29 May 2024 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeleteTranslateTags script)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 >