1. We place the call with /restapi/v1.0/account/~/extension/~/ringout
2. We get the sessionid using /restapi/v1.0/account/~/extension/~/presence?detailedTelephonyState=true
3. We save the sessionid and the call time.
4. Once the call is completed, we get the call log with the call-log method. It is run every two minutes. The dateFrom is determined by the earliest call start time of calls completed since the last call-log attempt. The dateTo is determined by the call end time of the last call completed prior to the current call-log lookup.
Here is a sample: /restapi/v1/restapi/v1.0/account/~/call-log?perPage=1000&page=1&view=Simple&recordingType=All&dateFrom=2018-03-07T14:15:00.0000000Z&dateTo=2018-03-07T14:17:00.0000000Z.
5. We parse this response looking for the sessionid.
6. When we find the sessionid we parse the associated record for the media link;
7. We download the recording using the media link
The problem occurs in step 5. We are not finding any records with the sessionid we are looking for. It is not related to the date window. We have tried using the call-log method with times that encompass the entire day which downloads thousands of call records and have been unable to find the call by sessionid.
This is happening up to 20% of the time. This problem started this week. There have been no changes to code or RC settings for several months.
These calls have recordings attached. We can find them using the customer portal to view the call log. So either we have an incorrect sessionid or the call-log method is not working as expected. It is hard to believe that we have the wrong sessionid since during the call we get call state information using PubNub referencing that sessionid.