# 通用API - 录音识别结果

#### 接口说明

客户主动获取录音识别接口。

#### 请求方式

POST，form-data格式

#### 获取通话记录接口请求参数

| 参数名          | 类型     | 是否必须 | 说明                                                                |
| :----------- | :----- | :--- | :---------------------------------------------------------------- |
| service      | string | 是    | App.Sip_Cdr.GetAsrRecord                                             |
| token        | string | 是    | 通过授权接口获取的token                                                    |
| starttime    | string | 是    | 起始时间，格式：yyyy-mm-dd hh:mm:ss，最长31天                              |
| endtime      | string | 是    | 结束时间，格式：yyyy-mm-dd hh:mm:ss，最长31天                                |
| cdrid     | int    | 否    | CDR记录ID                      |
| calluuid    | int    | 否    | 通话UUID                                        |
| calleenumber   | int    | 否     | 被叫号码 |
| callstatus    | string | 否     | 通话识别状态：0待处理、1处理中、2成功、3失败、4跳过、5部分成功                      |
| voicemailstatus   | string | 否     | 0未知、1正常通话、2语音信箱                                                |
| currentpage  | int    | 是    | 页数，默认：1                                                           |
| itemsperpage | int    | 是    | 每页数量，默认：10，最小：1；最大：1000                                           |


#### 获取通话记录接口请求示例（PHP）

```
<?php
    $apiUrl = 'http://127.0.0.1:8080';
    $postFields = [
        'service'   => 'App.Sip_Cdr.GetAsrRecord',
        'token'     => 'ABCDEFG',
        'starttime'  => '2019-01-12 00:00:00',
        'endtime'    => '2020-12-12 00:00:00',
        'cdrid'  => 3
        'calluuid'   => 3,
        'currentpage'  => 1,
        'itemsperpage'  => 10,
    ];
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $apiUrl);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postFields);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $response = curl_exec($curl);
    $curlError = curl_error($curl);
    curl_close($curl);
    var_dump($response);
?>

```

#### 返回数据结构示例

```
{
    "status": 0,
    "desc": "成功",
    "result": {
      "totalitems": 1,
      "currentpage": 1,
      "itemsperpage": 20,
      "asrrecords": [
        {
          "id": 111,
          "cdrid": 6,
          "calluuid": "5adf71c4-bee0-11f0-8eb3-811da796b819",
          "calleenumber": "8179032525",
    
          "preduration": 11,
          "prestatus": 3,
          "pretext": "",
  
  
          "callduration": 90,
          "callstatus": 2,
          "lefttext": "左声道识别文本",
          "righttext": "右声道识别文本",
  
          "voicemailstatus": 1,
          "voicemailevidence": null,
          "voicemailclassifiedat": null,
  
          "createdat": "2025-11-12 01:25:25"
        }
      ]
    }
}

```

#### 返回参数说明

| 参数名               | 类型     | 说明          |
| :---------------- | :----- | :---------- |
| result            | objest | 返回的结果集      |
| —totalitems       | int    | 记录总数        |
| —currentpage      | int    | 当前页码        |
| —itemsperpage     | int    | 每页数量        |
| —asrrecords            | array  | 记录数组        |
| ——id              | int    | 记录id        |
| ——cdrid     | string | 通话id      |
| ——calluuid       | string | 呼叫uuid         |
| ——calleenumber      | string | 目标号码        |
| ——preduration       | string | 等待时长        |
| ——prestatus       | string | 前置识别状态        |
| ——pretext      | string | 前置文本        |
| ——callduration         | string | 通话时间      |
| ——callstatus        | int    | 识别状态      |
| ——lefttext         | int    | 左侧识别文本        |
| ——righttext       | string | 右侧识别文本        |
| ——voicemailstatus      | int    | 0未知、1正常通话、2语音信箱         |
| ——voicemailevidence          | string | 分类命中的文本关键词 |
| ——voicemailclassifiedat        | string |质检时间  |
| ——createdat      | string | 识别时间  |