提供: Bright Pattern Documentation
• 日本語

Revision as of 02:46, 23 September 2026 by BpTranslationReview (talk | contribs) (Reviewed via BpTranslationReview)

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

onServerError

受信するサーバーエラーをすべて監視(サブスクライブ)します。これらは通常、システム全体の正常性や現在のエージェント認証セッションに影響を及ぼすグローバルエラーです。発生しうる既知のエラーの一覧を以下に示します。

リクエスト

構文

on('ON_SERVER_ERROR', handler: OnServerErrorHandler): void


type OnServerErrorHandler = (errorData: ServerErrorData) => void


type ServerErrorData = {

   code: ServerErrorCodes[keyof ServerErrorCodes]
   name:  keyof ServerErrorCodes
   timestamp: number // Date.now()
   message?: string

}

type ServerErrorCodes = {

 forced_logout_by_other_client: 100
 forced_logout_by_supervisor: 101
 invalid_request: 102
 phone_not_registered: 103
 phone_not_in_dial_plan: 104
 tenant_disabled: 105
 destination_user_not_logged: 106
 user_disabled_or_deleted: 107
 user_already_logged_in: 108
 invalid_credentials: 109
 other_user_logged_with_phone: 110
 invalid_token: 111
 logged_users_limit_reached: 112
 already_logged_in_with_the_same_session: 113
 not_enough_privileges: 114
 sip_server_error: 200
 unknown_error: 300

}


パラメータ

パラメータ パラメータ値 データ型 オプション/必須 説明
errorData
code 文字列 必須 ServerErrorCodes オブジェクトのエラーコードです。
name 文字列 必須 ServerErrorCodes オブジェクトのエラーコード名です。
timestamp 数値 必須 サーバーからエラーメッセージを受信した時点のタイムスタンプです。Date.now() メソッドを使用します。
message 文字列 オプション エラーの説明文です。

リクエスト例

function serverErrorHandler(errorInfo: ServerErrorData) {

console.log("The error " + errorInfo.name + " occurred!");

}

adApi.on("ON_SERVER_ERROR", serverErrorHandler);

戻り値

(なし)

< 前へ | 次へ >