How to make outbound call using in C#

  • 1
  • Question
  • Updated 2 years ago
  • Answered
i would like to make outbound from my custom web page (aspx)? How I can make call and do the out bound call? do we have any sample code
Photo of Z Admin

Z Admin

  • 440 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Benjamin Dean

Benjamin Dean

  • 8,602 Points 5k badge 2x thumb
We have a RingCentral C# SDK available: https://github.com/ringcentral/ringcentral-csharp

It shows usage as something like this (I am not a C# developer, so my code example below may not be correct, and I would recommend you ask any questions you have about using this SDK in the Github Issues for the repository:

//import RingCentral
using RingCentral;

//Initialize Ring Central Client
var sdk = new SDK(
"your appKey",
"your appSecret",
"RingCentral apiServer",
"Application Name",
"Application Version");

var authResponse = sdk.Platform.Login(userName, extension, password, true);

var ringoutPostBodyJson = "{\"from\":{\"phoneNumber\":\"\",\"forwardingNumberId\":\"\"},\"to\":{\"phoneNumber\":\"\"},\"callerId\":{\"phoneNumber\":\"\"},\"playPrompt\":false,\"country\":{\"id\":\"\"}}";
var request = new Request("/restapi/v1.0/account/~/extension/~/ringout", ringoutPostBodyJson);
var ringoutResponse = sdk.Platform.Post(request);
Photo of Z Admin

Z Admin

  • 440 Points 250 badge 2x thumb
I have tried this option, but the call is not going.

It gives the following error on the status of the call:

Cannotreach "Generic Error" is coming up. However i am able to make the call using the Ringcentral desktop application.