QM 聊天会话事件数据

本页介绍了 Contact Center AI 平台 (CCAI Platform) 可以导出到质量管理 (QM) 应用的聊天会话事件数据。QM 聊天事件数据支持 Web SDK 和移动 SDK。如需详细了解如何将 CCAI 平台与 QM 应用集成,请参阅 QM 和 SIPREC 集成

如需了解通话会话事件数据,请参阅 QM 通话会话事件数据

Chat 会话事件和触发器

某些会话事件会触发聊天会话数据导出到 QM 应用。本部分列出了聊天事件类型,并针对每种类型提供了会话事件载荷示例。

Chat 已开始

当人工客服或虚拟客服开始对话时,系统会触发此事件。事件载荷包含对话的初始状态,包括有关队列、参与者和发起者的信息。

以下代码示例展示了事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "support_number": null,
  "session_type_v2": "In-web",
  "chat_id": 138,
  "state": "waiting",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "dn": "end_user_5"
    }
  ]
}

Chat 等待分配

当聊天会话进入队列并等待分配时,系统会触发此事件。

以下代码示例展示了事件载荷:

{
  "queue_path_ids": "7/23",
  "queue_path_names": "Test/virtual",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 196,
  "state": "waiting",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "dn": "end_user_5"
    }
  ]
}

已接受 Chat

当人工客服或虚拟客服接受聊天时,系统会触发此事件。这是代理与聊天会话建立连接之前的一个可选中间事件。

以下代码示例展示了人工客服的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 167,
  "state": "connected",
  "direction": "incoming",
  "initiator": "agent_1",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "media_id": "MB0d0540e638354714a43d64e9be9677b6",
      "dn": "end_user_5"
    },
    {
      "state": "accepted",
      "type": "agent",
      "media_id": "MBd9670cb0cddd424c814194795527ae3a",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

以下代码示例展示了虚拟客服的事件载荷:

{
  "queue_path_ids": "7/23",
  "queue_path_names": "Test/virtual",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 196,
  "state": "connected",
  "direction": "incoming",
  "initiator": "virtual_agent_2",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "media_id": "MBdfcdab9220f94f1486008a165db3f31a",
      "dn": "end_user_5"
    },
    {
      "state": "accepted",
      "type": "virtual_agent",
      "media_id": "MBea10421d150b4d22b675de17070bc383",
      "dn": "virtual_agent_2"
    }
  ]
}

已连接 Chat

当聊天连接到人工客服或虚拟客服时,会触发此事件。这可以是自动连接,也可以是人工客服手动连接。

以下代码示例展示了人工客服的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 114,
  "state": "connected",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "media_id": "MB7a504ce7f418447bb4a48b8f3fa609d0",
      "dn": "end_user_5"
    },
    {
      "state": "connected",
      "type": "agent",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

以下代码示例展示了虚拟客服的事件载荷:

{
  "queue_path_ids": "7/23",
  "queue_path_names": "Test/virtual",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 196,
  "state": "connected",
  "direction": "incoming",
  "initiator": "virtual_agent_2",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "dn": "end_user_5"
    },
    {
      "state": "connected",
      "type": "virtual_agent",
      "dn": "virtual_agent_2"
    }
  ],
  "connected_at": "2024-09-13T14:04:17.000-07:00"
}

已关闭 Chat

当聊天会话在建立完整连接之前被取消或终止时(例如,未被接受或过早结束),系统会触发此事件。

以下代码示例展示了事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 197,
  "state": "dismissed",
  "direction": "incoming",
  "initiator": "agent_1",
  "participants": [
    {
      "state": "dismissed",
      "type": "external",
      "media_id": "MB444f542e9b9c4f89a8369bb2430357ad",
      "dn": "end_user_5"
    },
    {
      "state": "dismissed",
      "type": "agent",
      "media_id": "MB7e657411b2284f95b2cf31ef5e6dc83c",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

已恢复 Chat

当之前暂停或中止的聊天会话恢复时,系统会触发此事件。载荷包含聊天恢复时的状态。

以下代码示例展示了事件载荷:

{
  "session_type_v2": "In-web",
  "chat_id": 198,
  "state": "resumed",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "resumed",
      "type": "external",
      "media_id": "MB320da61121bc4fc48ea099759f679333",
      "dn": "end_user_5"
    },
    {
      "state": "resumed",
      "type": "agent",
      "media_id": "MBbe5db89a01ab4814a8e7830daf3d30fa",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

参与者已退出聊天

当一个或多个参与者离开聊天会话时,系统会触发此事件。这可能是最终用户、人工客服或虚拟客服离开聊天。载荷包含参与者离开聊天时聊天的状态。

以下代码示例展示了最终用户离开对话时的事件载荷:

{
  "session_type_v2": "In-web",
  "chat_id": 169,
  "state": "participantDisconnect",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "disconnected",
      "type": "external",
      "media_id": "MB4dd73370bc564cf18f5347233523ef44",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "agent",
      "media_id": "MBba370f84cf914992b05e9aab03730c4b",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

以下代码示例展示了人工客服离开对话的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 169,
  "state": "participantDisconnect",
  "direction": "incoming",
  "initiator": "agent_1",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "media_id": "MB4dd73370bc564cf18f5347233523ef44",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "agent"
      "media_id": "MBba370f84cf914992b05e9aab03730c4b",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ]
}

以下代码示例展示了虚拟客服离开对话时的事件载荷:

{
  "queue_path_ids": "7/23",
  "queue_path_names": "Test/virtual",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 196,
  "state": "participantDisconnect",
  "direction": "incoming",
  "initiator": "virtual_agent_2",
  "participants": [
    {
      "state": "disconnected",
      "type": "external",
      "media_id": "MBdfcdab9220f94f1486008a165db3f31a",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "virtual_agent",
      "media_id": "MBea10421d150b4d22b675de17070bc383",
      "dn": "virtual_agent_2"
    }
  ]
}

Chat 已结束

此事件会在聊天会话结束时触发。这可以是最终用户、人工客服或结束聊天的虚拟客服。相应载荷包含聊天结束时的状态,包括参与者以及聊天连接和结束的时间戳。

以下代码示例展示了人工客服和最终用户离开对话时的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "support_number": null,
  "session_type_v2": "In-web",
  "chat_id": 127,
  "state": "disconnected",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "disconnected",
      "type": "external",
      "media_id": "MB4a0a435e759c43369098ee7f2d0271f0",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "agent",
      "media_id": "MBa4afeafb5bcc4a279f51db76f3b98deb",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    }
  ],
  "connected_at": "2024-08-27T17:06:37.000-07:00",
  "ends_at": "2024-08-27T17:06:59.000-07:00"
}

以下代码示例展示了虚拟客服和最终用户离开对话时的事件载荷:

{
  "queue_path_ids": "7/23",
  "queue_path_names": "Test/virtual",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 190,
  "state": "disconnected",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "disconnected",
      "type": "external",
      "media_id": "MB6ea6204b6a0448428d88e9976fd856d4",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "virtual_agent",
      "media_id": "MBc6a2b72c99534a68990caf622b65571a",
      "dn": "virtual_agent_2"
    }
  ],
  "connected_at": "2024-09-12T10:50:51.000-07:00",
  "ends_at": "2024-09-12T11:54:08.000-07:00"
}

以下代码示例展示了在排队等待时结束的对话的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "support_number": null,
  "session_type_v2": "In-web",
  "chat_id": 141,
  "state": "disconnected",
  "direction": "incoming",
  "initiator": "end_user_5",
  "participants": [
    {
      "state": "disconnected",
      "type": "external",
      "media_id": "MB65670b2c44534af3860fad35be88ac41",
      "dn": "end_user_5"
    }
  ],
  "connected_at": "",
  "ends_at": "2024-08-29T14:41:16.000-07:00"
}

Chat 会话事件字段

下表介绍了 Contact Center AI 平台导出到 QM 应用的会话数据中的字段。

常规字段

字段名称

说明

条件

type

  • AgentState
  • ChatState

整个 JSON 载荷的事件类型。

  • 为与代理相关的事件传递 AgentState
  • 为聊天相关事件传递 ChatState

item

包含活动信息的对象。

Chat 状态字段

字段名称

说明

条件

chat_id

  • 聊天 ID

可在 item 对象中使用。

Contact Center AI 平台系统中的聊天会话标识符。

  • 传递 Contact Center AI 平台会话元数据中主要对象的 ID 字段的值。

state

  • waiting
  • connected
  • disconnected
  • dismissed
  • resumed
  • participantDisconnect
  • transferred

可在 item 对象中使用。

聊天会话的当前状态。

direction

  • incoming

可在 item 对象中使用。

从联络中心角度来看的聊天会话方向。

  • 当聊天会话为入站会话时,传递 incoming

initiator

  • agent_1
  • virtual_agent_2
  • end_user_5

可在 item 对象中使用。

初始化聊天状态的一方的标识符。

  • 对于人工客服

    传递会话元数据中 agent_info 对象的 ID 字段的值。

  • 适用于虚拟客服

    传递会话元数据中 participants 对象的 virtual_agent_id 字段的值。

  • 对于最终用户

    传递会话元数据中 end_user 对象的 ID 字段的值。

queue_path_ids

  • 队列 ID 的路径

可在 item 对象中使用。

最终用户在接通电话后与第一位客服人员通话之前所经过的队列路径。

此值是使用已导航队列的队列 ID 构建的。

  • 此设置仅适用于收到的消息。

queue_path_names

  • 队列名称的路径

可在 item 对象中使用。

最终用户在接通电话后与第一位客服人员通话之前所经过的队列路径。

此值是使用已导航队列的队列名称构建的。

  • 此设置仅适用于收到的消息。

language

  • 语言代码

可在 item 对象中使用。

最终用户所选语言的语言代码。

  • 此设置仅适用于收到的消息。

queue_uuid

  • 队列 ID

可在 item 对象中使用。

聊天已路由到的队列的 UUID。

  • 此功能仅适用于收到的对话和从队列转移的对话。

tenant

  • 实例名称

可在 item 对象中使用。

托管聊天会话的实例的名称。

event_id

  • 活动 ID

可在 item 对象中使用。

聊天会话的标识符。

timestamp

  • 一个 UNIX 时间戳

可在 item 对象中使用。

相应对话的 Unix 纪元时间戳

session_type_v2

  • In-web

可在 item 对象中使用。

表示 Web SDK 聊天会话。

support_number

  • NULL

  • 不适用于聊天。

connected_at

  • 日期和时间

可在 item 对象中使用。

聊天会话开始的日期和时间。

ends_at

  • 日期和时间

可在 item 对象中使用。

聊天会话结束的日期和时间。

participants

可在 item 对象中使用。

一个包含通话参与者信息的对象。

participant_id

  • agent_id
  • virtual_agent_id

可在 participants 对象中使用。

聊天参与者的标识符。

  • 对于人工客服

    传递会话元数据中 agent_info 对象的 ID 字段的值。

  • 适用于虚拟客服

    传递会话元数据中 participants 对象内 virtual_agent_id 字段中的值

  • 对于最终用户

    传递会话元数据中 end_user 对象的 ID 字段的值。

  • 对于第三方

    传递第三方的手机号码(如有)。

    否则,传递 null 值。

type

  • external
  • agent
  • virtual_agent

可在 participants 对象中使用。

通话参与者的类型。

  • 当聊天参与者是客服人员时,通过 agent
  • 当聊天参与者是最终用户或第三方时,传递 external
  • 当聊天参与者是虚拟客服时,传递 virtual_agent

state

  • connected
  • disconnected
  • accepted
  • dismissed
  • resumed

可在 participants 对象中使用。

参与者在聊天会议中的当前状态。

media_id

  • twilio_mediaID
  • nexmo_mediaID

可在 participants 对象中使用。

运营商提供的聊天会话媒体的标识符。

  • 当发起者通过 Twilio 号码发起聊天或接收聊天时,传递 twilio_mediaID
  • 当发起者通过 Nexmo 号码发起聊天或从 Nexmo 号码发起聊天时,传递 nexmo_mediaID

dn

  • end_user_1
  • agent_1

可在 participants 对象中使用。

参与者的电话号码。

agent_number

可在 participants 对象中使用。代理的号码。

name

可在 participants 对象中使用。代理的名称。

alias

可在 participants 对象中使用。代理的别名。

Chat 会话转移

Chat 会话转移不是单独的聊天事件。而是表明聊天会话已转移的载荷。此部分显示了在客服人员离开聊天时触发的聊天会话转移载荷。在此示例中,initiator 字段值为 agent_1,表示代理 1 发起了转移。在 participants 数组中,agent_1 的状态为 disconnectedagent_2 的状态为 connected。这表示会话已从代理 1 转移到代理 2,代理 1 已离开聊天,代理 2 已加入聊天。在此示例中,总体 state 字段的值为 participantDisconnect,但您可以根据需要将系统建模为具有 transferredconnected 的总体状态。您还可以对系统进行建模,使其具有额外的字段来更明确地表示会话转移,例如 transfer_id 或专用的转移事件类型。

以下代码示例展示了会话转移的事件载荷:

{
  "queue_path_ids": "7/26",
  "queue_path_names": "Test/calls",
  "language": "en",
  "session_type_v2": "In-web",
  "chat_id": 208,
  "state": "participantDisconnect",
  "direction": "incoming",
  "initiator": "agent_1",
  "participants": [
    {
      "state": "connected",
      "type": "external",
      "media_id": "MBed9193af0a82486cbad069925b5a0b18",
      "dn": "end_user_5"
    },
    {
      "state": "disconnected",
      "type": "agent",
      "media_id": "MB05685c80e6af444faa1de5c5e48a26c7",
      "agent_number": "Uno numero",
      "name": "Admin UJET",
      "alias": "super_agent",
      "dn": "agent_1"
    },
    {
      "state": "connected",
      "type": "agent",
      "media_id": "MB5caad80c7d94477d9db9c5f1c3662768",
      "agent_number": "420",
      "name": "ajay1 ujet",
      "alias": "ajay1-alias",
      "dn": "agent_2"
    }
  ]
}