Showing results for 
Search instead for 
Did you mean: 
Gozde Kumasoglu

Mediasense API Download Url Error For Some Recordings


We are using a Mediasense server, version  (7 vCPU configuration)  for both video and voice calls in production environment. Using Mediasense API, programatically we login to Mediaesense server per minute and query the recordings in last 10 minutes using "getSessions" method . Then we compare the sessionID's found for last 10 minutes with the sessionID's in our DB, if the seesionID is found in our DB (which means we didn't try downloading this recording before), we write the call data to DB and we download those recordings making http requests using download urls of the recordings which are obtained from "getSessions" method earlier.

I realized only for some recordings, we get  two types of exceptions that can be found as below. When those happen, those recordings aren't downloaded from Mediasense. This happens for 2-5 recordings out of  approx.7000 recordings a day and those problematic calls don't have any common features like same time range, call type (video or audio) or duration. No configuration change is made for Mediasense server recently.

Considering only concurrent recordings on the problem time (counting video call recordings as multiplied by 10 of voice call recordings), we don't seem passing the limits.

Can you please help identifying the root cause of those exceptions?


Exception1:  Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.ConnectStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.WebClient.DownloadBitsState.RetrieveBytes(Int32& bytesRetrieved) at System.Net.WebClient.DownloadBits(WebRequest request, Stream writeStream, CompletionDelegate completionDelegate, AsyncOperation asyncOp) at System.Net.WebClient.DownloadFile(Uri address, String fileName)An exception occurred during a WebClient request.SystemVoid DownloadFile(System.Uri, System.String)

Exception2: The remote server returned an error: (401) Unauthorized.SystemVoid DownloadFile(System.Uri, System.String)