如何获得过去通话的呼叫状态?
我想获得callerStatus和calleeStatus状态,这是我在RingOut状态API响应中看到的,但是我不知道在RingOut路径中为ringOutId使用什么:
https://developer.ringcentral.com/api-reference#RingOut-getRingOutCallStatus
请求
获取/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状态调用时,我希望得到一个调用列表,但是我得到了以下错误:
Resource for parameter [ringOutId] is not found用于ringOutId的是什么?我怎样才能得到callerStatus和calleeStatus的电话?
发布于 2018-11-22 09:44:57
RingOut主动呼叫状态
RingOut状态API只在通过RingOut打电话时使用。在Make的响应中返回ringOutId。它也只返回状态时,调用正在进行,并在短时间后,它将返回404。
API参考:https://developer.ringcentral.com/api-reference#RingOut-makeRingOutCall
RingOut历史呼叫状态
若要获取历史调用的调用状态,请使用调用日志API。默认情况下,该服务将返回result属性中的总体调用的状态。若要获取调用中的单个方(称为腿)的状态,请使用详细的调用日志API。以下网址可供查阅:
公司呼叫日志(所有用户)
GET /restapi/v1.0/account/~/call-log?view=Detailedhttps://developer.ringcentral.com/api-reference#Call-Log-loadCompanyCallLog
用户扩展调用日志
GET /restapi/v1.0/account/~/extension/~/call-log?view=Detailedhttps://developer.ringcentral.com/api-reference#Call-Log-loadUserCallLog
使用详细的视图,您将收到一个带有legs属性的响应,该属性是一个调用日志记录数组,也称为呼叫详细记录(CDR)。下面显示了一个示例记录。legs数组中的每个调用都有一个result属性。使用result代替状态,因为调用日志只列出已完成的调用。每个腿都有一个legType属性,可以用来识别调用方和被叫者。
例如,可以将legType设置为:
RingOutClientToCallerRingOutClientToSubscriberRingOutClientToSubscriber可以用于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
}
]
},注意:在详细的调用日志示例中,
to和from用于RingOutClientToCaller腿与to和from用于总体调用相同,而对于RingOutClientToSubscriber分支则相反。这是因为被调用者将与调用方连接,从他们的角度来看,调用方的号码在to属性中。
发布于 2021-01-08 07:11:31
https://stackoverflow.com/questions/53426791
复制相似问题