查询通话记录详情 (v2.0)
查询通话记录详情。
注: 该接口仅适用于 API 2.0 版本。
请求 URL
GET {base_url}/{api_path}/cdr/detail?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| uid | 是 | String | 通话记录的唯一 ID。 注: 可通过 搜索特定通话记录 (v2.0) 接口查询通话记录
ID。
|
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| data | Object<CDR_Detail> | 通话记录详细信息。 |
- CDR_Detail
-
参数 类型 说明 basic Object<Basic_Info> 通话记录的基本信息。 call_notes Object<Call_Note> 通话备注的相关信息。 timeline Array<Timeline_Info> 时间线的相关信息。
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Integer | 记录序号。 |
| uid | String | 通话记录的唯一 ID。 |
| time | String | 发起或接听该通通话的时间。 |
| call_type | String | 通讯类型。
|
| call_from | String | 主叫的号码和名称。 |
| call_from_name | String | 主叫名称。 |
| call_from_number | String | 主叫号码。 |
| call_from_avatar | String | 主叫分机头像的文件 ID。 |
| call_to | String | 被叫的号码和名称。 |
| call_to_name | String | 被叫名称。 |
| call_to_number | String | 被叫号码。 |
| call_to_avatar | String | 被叫分机头像的文件 ID。 |
| last_participant | String | 最后一个通话阶段的被叫。 |
| last_participant_name | String | 最后一个通话阶段被叫的名称。 |
| last_participant_number | String | 最后一个通话阶段被叫的号码。 |
| last_participant_avatar | String | 最后一个通话阶段被叫分机头像的文件 ID。 |
| last_status | String | 通话的最终状态。
|
| call_duration | Integer | 拨号开始到通话结束的时间。 |
| routing_duration | Integer | 通话开始到通话被应答的时间。 |
| ivr_duration | Integer | 通话在 IVR 中的时长。 |
| call_flow_duration | Integer |
通话在通话流程中的时长。 |
| ring_duration | Integer | 通话开始到通话被应答的时间。 |
| handling_duration | Integer | 通话被应答到通话结束的时间,包括保持时长。 |
| talk_duration | Integer | 通话被应答到通话结束的时间。 |
| hold_duration | Integer | 通话中被保持的时长。 |
| disconnected_by | String | 挂断通话的一方。
|
| enb_timeline | Integer | 是否启用了时间线功能。
|
| 参数 | 类型 | 说明 |
|---|---|---|
| Leg_{number} | Array<Call_Note_for_Leg> | 通话阶段相关的通话备注。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| id | String | 通话备注的唯一 ID。 |
| group_id | String | 通话备注的组 ID。 |
| disposition_code_list | Array<Disposition_Codes> | 通话备注中选中的话务标签。 |
| remark | String | 备注。 |
| agent_name | String | 添加通话备注的分机用户的名称。 |
| registration_time | Long | 分机用户添加通话备注的时间。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Integer | 话务标签的唯一 ID。 |
| name | String | 话务标签。 |
| description | String | 话务标签说明。 |
Timeline_Info
| 参数 | 类型 | 说明 |
|---|---|---|
| leg | Integer | 记录的序号。 |
| transaction_id | String | 通话阶段的 ID。 |
| time | String | 接听或拨打该通通话的时间。 |
| call_type | String | 通讯类型。
|
| call_from | String | 主叫的号码和名称。 |
| call_from_avatar | String | 主叫分机头像的文件 ID。 |
| call_to | String | 被叫的号码和名称。 |
| call_to_avatar | String | 被叫分机头像的文件 ID。 |
| status | String | 通话状态。
|
| call_duration | Integer | 拨号开始到通话结束的时间。 |
| ring_duration | Integer | 通话开始到通话被应答的时间。 |
| talk_duration | Integer | 通话被应答到通话结束的时间。 |
| hold_duration | Integer | 通话中被保持的时长。 |
| src_trunk | String | 来电从哪条中继呼入。 |
| dst_trunk | String | 去电使用的中继线路。 |
| did | String | 主叫拨打的号码。 |
| dod | String | 被叫电话上显示的号码。 |
| src_addr | String | 主叫 IP 地址。 |
| account_code | String | 外呼使用的 PIN 码。 |
| event_list | Array<Event_List> | 通话事件的相关信息。 |
| call_from_ext_id | Integer | 主叫分机的 ID。 |
| call_to_ext_id | Integer | 被叫分机的 ID。 |
| has_ai_summary | Integer | 是否包含 AI 生成的总结。
|
| cdr_id | String | 通话记录中具体通话阶段的 ID。 |
| shaken | String | SHAKEN 信任等级或验签结果。
|
| call_from_number | String | 主叫号码。 |
| call_to_number | String | 被叫号码。 |
| ai_receptionist_status | String | AI 接待员通话的处理结果。
|
| call_quality_list | Array<Call_Quality> | 通话质量的相关信息。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| call_score | Object<call_score> | MOS 得分最低的通话场景信息。 |
| callee_info | Object<callee_info> | 被叫侧的通话与设备信息。 |
| caller_info | Object<caller_info> | 主叫侧的通话与设备信息。 |
| performance_metrics | Object<performance_metrics> | 不同通话场景下的 QoS 表现。 |
call_score
| 参数 | 类型 | 说明 |
|---|---|---|
| lowest_scenario | String | MoS 得分最低的通话场景。
|
| lowest_score | String | 最低 MOS 得分。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| name | String | 分机名称及号码。 |
| duration | Integer | 通话质量监测持续时长。 |
| codec | String | 通话使用的编解码类型。 |
| terminal_equipment | Array<terminal_equipment> | 通话使用的客户端类型。 |
| round_trip_time | Integer | 音频数据往返传输时延。 |
| local_address | Array | 客户端的本地 IP 地址。 |
| public_address | Array | 客户端的公网 IP 地址。 |
| network_type | Array<network_type> | 通话使用的网络连接类型。 |
network_type
| 参数 | 类型 | 说明 |
|---|---|---|
| percentage | Integer | 通话过程中该网络连接类型的使用占比。 |
| type | String | 网络类型。
|
terminal_equipment
| 参数 | 类型 | 说明 |
|---|---|---|
| model | String | 具体客户端型号。
|
| type | String | 客户端类型。
|
| version | String | 客户端版本。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| callee_to_pbx | Object<qos_metrics> | 被叫侧到 PBX 的 QoS 指标。 |
| caller_to_pbx | Object<qos_metrics> | 主叫侧到 PBX 的 QoS 指标。 |
| pbx_to_callee | Object<qos_metrics> | PBX 到被叫侧的 QoS 指标。 |
| pbx_to_caller | Object<qos_metrics> | PBX 到主叫侧的 QoS 指标。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| mos | String | 音频质量评分 (MOS)。 |
| packet_loss | String | 音频数据包丢失比例。 |
| avg_jitter | String | 音频传输过程中的抖动。 |
| avg_latency | String | 音频传输过程中的网络延迟。 |
Event_List
| 参数 | 类型 | 说明 |
|---|---|---|
| event_content | String | 事件的详细信息。 |
| event_id | String | 事件的唯一 ID。 |
| event_name | String | 事件名称。 |
| event_time | Integer | 从通话开始到事件发生时所经过的时间。 |
| event_ts | String | 事件触发的时间。 |
| event_type | String | 事件类型。 |
| pos | String | 添加通话备注的场景。 |
| child | Array<Child_Event> | 子事件的详细信息。 |
| 参数 | 类型 | 说明 |
|---|---|---|
| event_content | String | 事件的详细信息。 |
| event_id | String | 事件的唯一 ID。 |
| event_name | String | 事件名称。 |
| event_time | Integer | 从通话开始到事件发生时所经过的时间。 |
| event_ts | String | 事件触发的时间。 |
| event_type | String | 事件类型。 |
| pos | String | 添加通话备注的场景。 |
| child | Array<Child_Event> | 子事件的详细信息。 |
示例
请求示例
GET /openapi/v2.0/cdr/detail?access_token=UpC3Er3cXokxyPSM7E1KkRhlXD0Tp0so&uid=202606051629069F667 HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
响应示例
HTTP/1.1 200 OK { "errcode": 0, "data": { "basic": { "id": "67AED734-47C00135", "uid": "20260612182412C3BB1", "time": "2026/06/12 18:24:12", "call_type": "Internal", "call_from": "Evelyn<3200>", "call_from_name": "Evelyn", "call_from_number": "3200", "call_from_avatar": "", "call_to": "ringgroup Test<3021>", "call_to_name": "ringgroup Test", "call_to_number": "3021", "call_to_avatar": "", "last_participant": "ringgroup Test<3021>", "last_participant_name": "ringgroup Test", "last_participant_number": "3021", "last_participant_avatar": "", "last_status": "ANSWERED", "call_duration": 30, "routing_duration": 3, "ivr_duration": 0, "call_flow_duration": 0, "ring_duration": 3, "handling_duration": 27, "talk_duration": 27, "hold_duration": 0, "wrapup_duration": 0, "disconnected_by": "Extension", "end_call_time": "", "end_call_timepoint": 0, "enb_timeline": 1, "ai_receptionist_duration": 0 }, "call_notes": { "leg_1": { "id": "20260612182412-8F6C3", "group_id": "1781259852.18", "disposition_code_list": [ { "id": 10, "name": "Demo" } ], "remark": "Confirmed", "agent_name": "ringgroup Test", "registration_time": 1781259879, "update_entry": "", "enb_callnote": 8 } }, "timeline": [ { "leg": 1, "transaction_id": "31001", "time": "2026/06/12 18:24:12", "call_type": "Internal", "call_from": "Evelyn<3200>", "call_from_avatar": "", "call_to": "ringgroup Test<3021>", "call_to_avatar": "", "status": "ANSWERED", "call_duration": 30, "ring_duration": 3, "talk_duration": 27, "hold_duration": 0, "src_trunk": "", "dst_trunk": "", "did": "", "dod": "", "src_addr": "127.0.0.1:30175", "account_code": "", "event_list": [ { "event_id": "67AED734-47400309", "event_name": "call_to", "event_time": 0, "event_type": "basic", "event_content": "{\"from\":\"Evelyn(3200)\",\"from_feature\":\"extension\",\"in\":\"mobile\",\"to\":\"ringgroup Test(3021)\",\"to_feature\":\"extension\"}", "event_ts": "2026/06/12 18:24:13" }, { "event_id": "67AED734-47400B28", "event_name": "tried_contact", "event_time": 0, "event_type": "dial", "event_content": "{\"in\":\"desktop\",\"to\":\"ringgroup Test(3021)\",\"to_feature\":\"extension\"}", "event_ts": "2026/06/12 18:24:13" }, { "event_id": "67AED734-47800386", "event_name": "answered", "event_time": 3, "event_type": "dial", "event_content": "{\"device_remark\":\"yeastar\",\"in\":\"desktop\",\"talk_duration\":27,\"to\":\"ringgroup Test(3021)\",\"to_feature\":\"extension\"}", "event_ts": "2026/06/12 18:24:16" }, { "event_id": "20260612182412-8F6C3", "event_name": "callnote", "event_time": 26, "event_type": "callnote", "event_content": "{\"call_disposition\":[{\"id\":10,\"name\":\"已约演示\"}],\"id\":\"20260612182412-8F6C3\",\"remark\":\"时间确定\"}", "event_ts": "2026/06/12 18:24:39", "pos": "incall" }, { "event_id": "67AED734-478008E9", "event_name": "hangup", "event_time": 30, "event_type": "operate", "event_content": "{\"from\":\"Evelyn(3200)\",\"from_feature\":\"extension\",\"via_operate\":\"sip\"}", "event_ts": "2026/06/12 18:24:43" } ], "time_second": 0, "wrap_duration": 0, "call_from_ext_id": 3071, "call_to_ext_id": 3075, "has_ai_summary": 0, "cdr_id": "20260612182412-8F6C3", "shaken": "", "call_from_number": "3200", "call_to_number": "3021", "ai_receptionist_status": "", "call_quality_list": null } ] } }