提供: Bright Pattern Documentation
• 日本語

Revision as of 10:10, 21 September 2026 by BpDeeplTranslateMaintenance (talk | contribs) (Updated via BpDeeplTranslate extension)

< 前へ | 次へ >
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
移動先: 案内検索
• English

onAgentStateChange

このハンドラは、エージェントの状態が変更された際に呼び出されます。

リクエスト

構文

on('ON_AGENT_STATE_CHANGE', handler: OnAgentStateChangeHandler): void


type OnAgentStateChangeHandler = (状態: AgentState, notReadyReason?: string) => void


type AgentState = "受付可能" | "not_ready" | "話中" | "after_call_work"

パラメータ

パラメータ パラメータ値 データ型 オプション/必須 説明
状態 文字列 必須 エージェントの状態は、以下のいずれかになります:
  • "ready"
  • "not_ready"
  • "busy"
  • "after_call_work"
notReadyReason 文字列 オプション エージェントが現在「not_ready」である理由です。なお、このパラメータは状態が not_ready の場合にのみ存在することに注意してください

let currentAgentState: AgentState | undefined = undefined;

let currentAgentNotReadyReason: string | undefined = undefined;

function agentStateChangeCallback(newState: AgentState, notReadyReason?: string) {

console.log("エージェントの状態が変更されました!");

currentAgentState = newState;

currentAgentNotReadyReason = notReadyReason;

}

adApi.on("ON_AGENT_STATE_CHANGE", agentStateChangeCallback);

戻り値

(なし)

< 前へ | 次へ >