I'd like to get notification about generation of recording wav file.

  • 1
  • Question
  • Updated 1 year ago
  • (Edited)
I am using the https://github.com/ringcentral/ringcentral-csharp-client c# SDK.

I have questions.

1) Can I record using sdk, when calling?

After the call is completed, i am going to download recorded wav file.

2)  How can I get status for completion of recording?
Now I gonna download recorded wav file as soon as call complete, I can download wav file after some time pass.

So I'd like to get notification about generation of wav file.

This is a code to get message status.
subscription.EventFilters.Add("/restapi/v1.0/account/~/extension/~/message-store");

I'd like to get status for recording like above I mentioned.

i am sure you can help me.

Kind Regards.
Photo of Eugene

Eugene

  • 210 Points 100 badge 2x thumb

Posted 1 year ago

  • 1
Photo of Paco Vu

Paco Vu

  • 476 Points 250 badge 2x thumb
Hi Eugene,

1) Unfortunately, there is no API to start recording a call. Call recording can be triggered only by users from the RingCentral mobile phone or the SoftPhone after a call is connected.

2) You can access recorded files by first calling the call-log API. You might want to query for only calls with records by setting the flag "withRecording=true". Then check if the "recording" field exists in the response. If it exists, parse the "recording" object to get the "contentUri", which will let you have access to the binary file.

See this code snippets for the c# SDK.
var account = rc.Restapi().Account();

// List call Logs
var queryParams = new CallLogPath.ListParameters
{
    type = "Voice",
    view = "Detailed",
    dateFrom = DateTime.UtcNow.AddDays(-100).ToString("o"),
    withRecording = true,
    perPage = 10,
};
var callLogs = await account.CallLog().List(queryParams);

// download a call recording
var callLog = callLogs.records[0];
var content = await account.Recording(callLog.recording.id).Content().Get();
File.WriteAllBytes("test.wav", content.data); 
No, you cannot get notification about generation of a wav. file. The 'message-store' is for SMS/MMS and Fax events only.

You might want to try with some work-around solution by using the "presence" event filter to get notified when a call completed, then use the sequence call above to check for a recording if any.

Hope this helps.
Paco
Photo of Eugene

Eugene

  • 210 Points 100 badge 2x thumb
Thanks for your reply.
After the call is completed, i am going to download recorded wav file.
But at this time recorded wav file isn't generated yet.
wav file is generated after a few sec.
when should i download file.
I am sure you can help me.
can I use function subscription?
I believe you will help me. 
(Edited)