question

matt-spinks2179 avatar image
matt-spinks2179 asked ·

How to detect and remove duplicate recordings within the same call record

When inspecting some call records, I've noticed that there are sometimes duplicate recordings. Here is an example (I've removed some extra data to make is easier to read):

{   "id": "DkFXDQocJi8hjUA",   "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/call-log/DkFXDQocJi8hjUA?view=Detailed",   "sessionId": "172335211023",   "type": "Voice",   "direction": "Inbound",   "action": "Phone Call",   "result": "Accepted",   "startTime": "2019-04-27T13:18:10.463Z",   "duration": 28,   "lastModifiedTime": "2019-04-27T13:18:46.132Z",   "transport": "PSTN",   "from": {    "phoneNumber": null,    "extensionNumber": "143",    "location": null,    "name": "Ana Jorge",    "device": null   },   "to": {    "phoneNumber": null,    "extensionNumber": "104",    "location": null,    "name": null,    "device": null   },   "recording": {    "id": "985541334023",    "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/recording/985541334023",    "type": "Automatic",    "contentUri": "https://media.ringcentral.com/restapi/v1.0/account/314176022/recording/985541334023/content"   },   "message": null,   "billing": {    "costIncluded": "0.000",    "costPurchased": "0.000"   },   "legs": [{    "id": null,    "uri": null,    "sessionId": null,    "type": "Voice",    "direction": "Outbound",    "action": "VoIP Call",    "result": "Call connected",    "startTime": "2019-04-27T13:18:10.462Z",    "duration": 28,    "lastModifiedTime": null,    "transport": "VoIP",    "legType": "SipToPstnMetered",    "extension": {     "id": "62481118023",     "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/extension/62481118023"    },    "from": {     "phoneNumber": null,     "extensionNumber": "143",     "location": null,     "name": "Ana Jorge",     "device": {      "id": "800571597022",      "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/device/800571597022"     }    },    "to": {     "phoneNumber": null,     "extensionNumber": "104",     "location": null,     "name": "Jason Miller",     "device": null    },    "recording": {     "id": "985541333023",     "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/recording/985541333023",     "type": "Automatic",     "contentUri": "https://media.ringcentral.com/restapi/v1.0/account/314176022/recording/985541333023/content"    },    "message": null,    "billing": null   }, {    "id": null,    "uri": null,    "sessionId": null,    "type": "Voice",    "direction": "Outbound",    "action": "VoIP Call",    "result": "Call connected",    "startTime": "2019-04-27T13:18:18.204Z",    "duration": 19,    "lastModifiedTime": null,    "transport": "VoIP",    "legType": "PstnToSip",    "extension": {     "id": "314180022",     "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/extension/314180022"    },    "from": {     "phoneNumber": null,     "extensionNumber": "143",     "location": null,     "name": "Jason Miller",     "device": {      "id": "800865565023",      "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/device/800865565023"     }    },    "to": {     "phoneNumber": "+15619827939",     "extensionNumber": "104",     "location": "Boca Raton, FL",     "name": null,     "device": null    },    "recording": {     "id": "985541334023",     "uri": "https://platform.ringcentral.com/restapi/v1.0/account/314176022/recording/985541334023",     "type": "Automatic",     "contentUri": "https://media.ringcentral.com/restapi/v1.0/account/314176022/recording/985541334023/content"    },    "message": null,    "billing": null   }]  }

As you can see, there are 3 recordings listed: 

985541334023 (from the main call record)
985541333023 (from the first leg)
985541334023 (from the last leg)

Two of those ids are identical (the main call record and the last leg), so I know that those two are duplicates automatically. However, the recording from the first leg has a different recording id. And upon checking, these two recordings are the same (at least from listening to them). Why does this happen? And, more importantly, is there a way to detect these duplicates from the api? Or am I going to have to do a byte comparison on my end to determine if they are duplicates or not?


General Topic
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.