简体   繁体   English

如何找到 RingCentral 呼叫的 callerStatus 和 calleeStatus?

[英]How to find the callerStatus and calleeStatus for RingCentral calls?

How do I get call status for past calls?如何获取过去通话的通话状态?

I want to get the callerStatus and calleeStatus status which I see in the RingOut Status API response but I'm not sure what to use for the ringOutId in the URL path:我想获取在 RingOut Status API 响应中看到的callerStatuscalleeStatus状态,但我不确定在 URL 路径中用于ringOutId的内容:

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

Request要求

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

Response回复

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"
    }
}

When making a RingOut Status call without a ringOutId , I was hoping to get a list of calls, but I get the following error instead:在没有ringOutId情况下进行 RingOut Status 呼叫时,我希望获得呼叫列表,但我收到以下错误:

Resource for parameter [ringOutId] is not found

What do I use for ringOutId ?我用什么ringOutId How can I get the callerStatus and calleeStatus for calls?如何获取呼叫的callerStatuscalleeStatus

RingOut Active Call Status RingOut 活动呼叫状态

The RingOut Status API is only used when making phone calls via RingOut. RingOut 状态 API 仅在通过 RingOut 拨打电话时使用。 The ringOutId is returned in the response for the Make RingOut API. ringOutId在 Make RingOut API 的响应中返回。 It also only returns status while the call is in progress and a short time later, after which, it will return a 404.它也只在调用过程中和短时间内返回状态,之后,它将返回 404。

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

RingOut Historical Call Status RingOut 历史呼叫状态

To get call status for historical calls, use the Call Log API.要获取历史呼叫的呼叫状态,请使用 Call Log API。 By default, the service will return status for the overall call in the result property.默认情况下,服务将在result属性中返回整体调用的状态。 To get status on individual parties on the call, known as legs, use the Detailed Call Log API.要获取通话中各个方的状态(称为支路),请使用详细通话记录 API。 The following URLs are available:以下 URL 可用:

Company Call Log (all users)公司通话记录(所有用户)

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

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

User Extension Call Log用户分机通话记录

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

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

With the detailed view, you will receive a response with the legs property, which is an array of call log records also known as a Call Detail Records (CDR) .使用详细视图,您将收到带有legs属性的响应,这是一组呼叫日志记录,也称为呼叫详细记录 (CDR) An example record is shown below.下面显示了一个示例记录。 Each call in the legs array has a result property. legs数组中的每个调用都有一个result属性。 result is used instead of status because the call log only lists completed calls. result而不是状态,因为呼叫日志仅列出已完成的呼叫。 Each leg has a legType property that can be used to identify the caller and callee.每条腿都有一个legType属性,可用于识别调用者和被调用者。

For example, legType can be set to:例如, legType可以设置为:

  • RingOutClientToCaller
  • RingOutClientToSubscriber

RingOutClientToSubscriber can be used for the calleeStatus . RingOutClientToSubscriber可用于calleeStatus This gives us:这给了我们:

  • callerStatus = leg.result where leg.legType == 'RingOutClientToCaller' callerStatus = leg.result where leg.legType == 'RingOutClientToCaller'
  • calleeStatus = leg.result where leg.legType == 'RingOutClientToSubscriber' calleeStatus = leg.result where leg.legType == 'RingOutClientToSubscriber'

Note: It's possible for a CDR to only have one leg.注意: CDR 可能只有一条腿。 This can happen if the result is Busy .如果resultBusy就会发生这种情况。 In RingOut, if one party is busy, it can be an optimization to not call the other party.在 RingOut 中,如果一方忙,不呼叫另一方可能是一种优化。 Many times, our customers will use RingOut to call their employee first, and if the employee picks up, then call the customer.很多时候,我们的客户会先使用 RingOut 给他们的员工打电话,如果员工接听,再给客户打电话。 If the employee isn't there, there's no reason to call the customer and have them listen to a busy tone.如果员工不在,就没有理由打电话给客户并让他们听忙音。

Here's a response call log record example:这是一个响应呼叫日志记录示例:

{
  "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
    }
  ]
},

Note: In the detailed call log example, the to and from for the RingOutClientToCaller leg coincide with the to and from for the overall call, while they are reversed for the RingOutClientToSubscriber leg to the callee.注:在详细呼叫记录例如, tofromRingOutClientToCaller与腿相吻合tofrom对整体呼叫,而他们被颠倒了RingOutClientToSubscriber腿到被叫方。 This is because the callee will be connect with the caller, whose number is in the to property from their perspective.这是因为被调用者将与调用者连接,从他们的角度来看,调用者的号码在to属性中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM