0

如何获取过去通话的通话状态?

我想获得我在 RingOut Status API 响应中看到的callerStatuscalleeStatus状态,但我不确定ringOutId在 URL 路径中使用什么:

https://developer.ringcentral.com/api-reference#RingOut-getRingOutCallStatus

要求

GET /restapi/v1.0/account/400162076008/extension/400162076009/ring-out/Y3MxNzE4NDkyODg0NDM5MDJAMTAuNjIuMjkuMzM

回复

HTTP 200 OK

{
    "uri" : "https://platform.ringcentral.com/restapi/v1.0/account/400162076008/extension/400162076009/ring-out/2",
    "id" : "Y3MxNzE4NDkyODg0NDM5MDJAMTAuNjIuMjkuMzM",
    "status" : {
      "callStatus" : "Success",
      "callerStatus" : "Success",
      "calleeStatus" : "Success"
    }
}

在没有 的情况下进行 RingOut Status 呼叫时ringOutId,我希望获得呼叫列表,但我收到以下错误:

Resource for parameter [ringOutId] is not found

我有什么用ringOutId?我怎样才能得到callerStatusand calleeStatusfor 电话?

4

2 回答 2

1

响铃活动呼叫状态

RingOut 状态 API 仅在通过 RingOut 拨打电话时使用。在 Make RingOut API的ringOutId响应中返回 。它也只在调用过程中返回状态,稍后会返回一个 404。

API 参考:https ://developer.ringcentral.com/api-reference#RingOut-makeRingOutCall

RingOut 历史通话状态

要获取历史通话的通话状态,请使用通话记录 API。默认情况下,服务将返回result属性中整体调用的状态。要获取通话中各个参与方的状态(称为支腿),请使用详细通话记录 API。以下 URL 可用:

公司通话记录(所有用户)

GET /restapi/v1.0/account/~/call-log?view=Detailed

https://developer.ringcentral.com/api-reference#Call-Log-loadCompanyCallLog

用户分机通话记录

GET /restapi/v1.0/account/~/extension/~/call-log?view=Detailed

https://developer.ringcentral.com/api-reference#Call-Log-loadUserCallLog

使用详细视图,您将收到带有属性的响应,该legs属性是呼叫日志记录的数组,也称为呼叫详细记录 (CDR)。示例记录如下所示。legs数组中的每个调用都有一个result属性。result使用而不是状态,因为呼叫日志仅列出已完成的呼叫。每条腿都有一个legType属性,可用于识别调用者和被调用者。

例如,legType可以设置为:

  • RingOutClientToCaller
  • RingOutClientToSubscriber

RingOutClientToSubscriber可用于calleeStatus. 这给了我们:

  • callerStatus=leg.result在哪里leg.legType == 'RingOutClientToCaller'
  • calleeStatus=leg.result在哪里leg.legType == 'RingOutClientToSubscriber'

注意: CDR 可能只有一条腿。如果result是,则可能发生这种情况Busy。在 RingOut 中,如果一方忙,不呼叫另一方可能是一种优化。很多时候,我们的客户会先用 RingOut 给他们的员工打电话,如果员工接电话,再给客户打电话。如果员工不在,就没有理由打电话给客户并让他们听忙音。

这是一个响应呼叫日志记录示例:

{
  "uri": "https://platform.ringcentral.com/restapi/v1.0/account/727097016/extension/727097016/call-log/L6HbCN6tB1nyDUA?view=Detailed",
  "id": "L6HbCN6tB1nyDUA",
  "sessionId": "575838550017",
  "startTime": "2018-11-22T08:42:05.500Z",
  "duration": 19,
  "type": "Voice",
  "direction": "Outbound",
  "action": "RingOut PC",
  "result": "Call connected",
  "to": {
    "phoneNumber": "+12125550111",
    "name": "Daenerys Targaryen",
  },
  "from": {
    "phoneNumber": "+16505550101",
    "name": "John Snow"
  },
  "extension": {
    "uri": "https://platform.ringcentral.com/restapi/v1.0/account/727097016/extension/727097016",
    "id": 727097016
  },
  "transport": "PSTN",
  "lastModifiedTime": "2018-11-22T08:42:30.007Z",
  "billing": {
    "costIncluded": 0.0,
    "costPurchased": 0.0
  },
  "legs": [
    {
      "startTime": "2018-11-22T08:42:05.257Z",
      "duration": 20,
      "type": "Voice",
      "direction": "Outbound",
      "action": "RingOut PC",
      "result": "Call connected",
      "to": {
        "phoneNumber": "+16505550101",
        "name": "John Snow"
      },
      "from": {
        "phoneNumber": "+12125550111",
        "name": "Daenerys Targaryen",
      },
      "extension": {
        "uri": "https://platform.ringcentral.com/restapi/v1.0/account/727097016/extension/727097016",
        "id": 727097016
      },
      "transport": "PSTN",
      "billing": {
        "costIncluded": 0.0,
        "costPurchased": 0.0
      },
      "legType": "RingOutClientToSubscriber"
    },
    {
      "startTime": "2018-11-22T08:42:05.500Z",
      "duration": 19,
      "type": "Voice",
      "direction": "Outbound",
      "action": "RingOut PC",
      "result": "Call connected",
      "to": {
        "phoneNumber": "+12125550111",
        "name": "Daenerys Targaryen",
      },
      "from": {
        "phoneNumber": "+16505550101",
        "name": "John Snow"
      },
      "extension": {
        "uri": "https://platform.ringcentral.com/restapi/v1.0/account/727097016/extension/727097016",
        "id": 727097016
      },
      "transport": "PSTN",
      "legType": "RingOutClientToCaller",
      "master": true
    }
  ]
},

注意:在详细的通话记录示例中,分支的toand与整体通话的 and 一致,而对于被调用者的分支则相反。这是因为被呼叫者将与呼叫者连接,从他们的角度来看,呼叫者的号码在属性中。fromRingOutClientToCallertofromRingOutClientToSubscriberto

于 2018-11-22T09:44:57.987 回答
0

您可以致电 https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/active-calls 此端点获取所有活动通话详细信息,请参阅 https://developers.ringcentral.com/guide/voice /finding-active-calls

于 2021-01-08T07:11:31.630 回答