通话状态
查询指定通话的当前状态,包括通话类型、参与方标识、时间戳及结束原因等完整信息。通话双方均可调用。
| 项目 | 内容 |
|---|---|
| Method | GET |
| URL | https://devapi.fengshengshou.com/api/calls/{callId}/state |
| 鉴权 | 是,Bearer Token |
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| callId | int | 是 | 路径参数,通话 ID |
curl -X GET "https://devapi.fengshengshou.com/api/calls/5001/state" \ -H "Authorization: Bearer your_token_here"| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,0 表示成功 |
| message | string | 提示信息 |
| data.call_id | int | 通话 ID |
| data.status | string | 当前状态 |
| data.call_type | string | 通话类型(audio / video) |
| data.biz_type | string | 业务类型 |
| data.conversation_id | int | 所属会话 ID |
| data.channel_name | string | RTC 频道名 |
| data.app_id | string | RTC 应用 ID |
| data.caller_user_id | int | 主叫用户 ID |
| data.callee_user_id | int | 被叫用户 ID |
| data.caller_uid | string | 主叫 RTC 用户标识 |
| data.callee_uid | string | 被叫 RTC 用户标识 |
| data.accepted_at | string|null | 接听时间(ISO 8601),可为空 |
| data.started_at | string|null | 通话开始时间(ISO 8601),可为空 |
| data.ended_at | string|null | 通话结束时间(ISO 8601),可为空 |
| data.end_reason | string|null | 结束原因,可为空,常见取值见下表 |
| data.version | int | 数据版本号 |
end_reason 常见取值
| 取值 | 说明 |
|---|---|
no_answer_timeout |
振铃超时无人接听 |
callee_busy |
对方忙线 |
user_reject |
被叫拒绝 |
caller_cancel |
主叫取消 |
local_hangup |
一方主动挂断 |
{ "code": 0, "message": "success", "data": { "call_id": 5001, "status": "ended", "call_type": "video", "biz_type": "single", "conversation_id": 1001, "channel_name": "call_5001_1001", "app_id": "xxxxxxxxxxxxxxxx", "caller_user_id": 10001, "callee_user_id": 20002, "caller_uid": "10001", "callee_uid": "20002", "accepted_at": "2026-07-05T10:05:10Z", "started_at": "2026-07-05T10:05:30Z", "ended_at": "2026-07-05T10:12:45Z", "end_reason": "local_hangup", "version": 6 }}{ "code": 41001, "message": "通话不存在", "data": null}{ "code": 41010, "message": "非参与方", "data": null}