question

devanand-w3658 avatar image
devanand-w3658 asked devanand-w3658 answered

Ringcentral API to stream phone recording

I would like to play the phone recording whenever user clicks on 'Play' button in C# using ringcentral API. Can anyone please suggest how I can do this? I know we can get Call Recordings with Call Logs but I need to stream it. According to what Ive read, this should be possible to stream the recording but can anyone suggest how to do it using C#? Also how can I add few 'test recordings' in our Sandbox account? So that I can able to work on it with this test recording.

rest api
1 |3000

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

benjamin-dean avatar image
benjamin-dean answered
Hey Mahesh, good questions.

Are you using the official, open source RingCentral C# SDK in your development? If you haven't, I highly recommend its use, it is available in the RingCentral Github account here: https://github.com/ringcentral/ringcentral-csharp. This package has also been published on NuGet for your convenience.

There is also the RingCentral C# Client (which is being developed by Tyler, who also authored the official RingCentral C# SDK), it is available in the RingCentral Github account as well, here:  https://github.com/ringcentral/ringcentral-csharp-client

You can choose to use one or the other, but not both, of the development resources listed above (and we highly recommend using one of these tools to simplify development).

You will need to understand a few key resources as you've mentioned (using the RingCentral C# Client, different than the C# SDK referenced above):  Getting Message Content and Download Call Recording. If you elect to not use either of these handy developer resources (which I would recommend against, but is your choice), and you need to better understand how to locate and access these resources, you can use the RingCentral API Reference (and even test API requests using the RingCentral API Explorer).

The unit test project in the C# Client provides an example of  using the RingCentral C# SDK to download call recording content.

As far as Streaming playback of these resources, my C# experience is minimal and I would recommend one of the following:

  1. View how other developers are streaming audio playback obtained from an HTTP request (async seems to be important) using C# in the questions on StackOverflow. Here are a couple of URLs I thought might get you started in the right direction: http://stackoverflow.com/questions/32670407/audio-stream-requested-using-httpclient-doesnt-play-unti...http://stackoverflow.com/questions/34042928/how-to-stream-downloadplay-an-audio-from-url
  2. Use one of the RingCentral C# Resources (but not both), and ask how to Stream playback as an issue labeled as a question on the respective Github repository issue tracker. If you try to get things working using one of these libraries and hit a development blocker, ask questions in the issue tracker or on Stackoverflow.
  3. Try some things out in your own development to solve this problem, and if you hit roadblocks, supply the code you've written to that point and ask your question on Stackoverflow using the 'ringcentral' tag on your question (one of our team, or a member of the Stackoverflow community will most certainly help as much as possible).
1 |3000

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

benjamin-dean avatar image
benjamin-dean answered
I forgot to provide an answer to you about how to "Add some test recordings in your Sandbox Account"?

It is very easy to create some test recordings in your RingCentral Sandbox Account using the RingCentral SoftPhone.

Here is the Developer Guide information about Call Recordings:  http://ringcentral-api-docs.readthedocs.io/en/latest/calllog_call-recordings/

In that, you will find this list of step-by-step instructions to Create a Call Recording:

For simplicity, we are just going to step you through using the RingCentral Soft Phone (in Direct Dial Mode) to create an outbound call, and record that call.
  1. Here is our Getting Started Guide to Configure Your RingCentral Development Environment
  2. Open the RingCentral Soft Phone on your Desktop
  3. Click the Settings Icon, and choose Calling from the menu
  4. In the Calling Mode section, set the value to Direct Dial
  5. Close the settings dialog window
  6. Open the dial pad of your RingCentral Soft Phone, and dial your cellular device (or another outside number not associated with your RingCentral account). Please note, you must set Your Location to "Custom Number", and set Custom Number to { {YOUR_SANDBOX_USER_EXTENSION_DIRECT_NUMBER}}. I've included a screenshot below of me being logged into the Sandbox Online Account Portal (https://service.devtest.ringcentral.com) and my RingCentral Soft Phone in Sandbox  (while placing an outbound call in Direct Dial mode, with the configurations as required above, please note the difference between the extension number and my direct number).
  7. Answer the call when it is received on your outside line
  8. In the RingCentral Soft Phone, click the Record button. You will hear a notification that the call is being recorded
  9. Talk to yourself for the next 35 seconds (this is always the worst part of doing this process...hearing yourself on the phone)
  10. Click the Record button a second time to stop recording, and then hangup the call to end it.

1 |3000

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

devanand-w3658 avatar image
devanand-w3658 answered
Hey Benjamin, Thank you so much for this detailed answer to my question. I am really going to try the steps you provided above and I will let you know if I face any other difficulty.

Thanks a lot! :)
1 |3000

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

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys