I am trying to make voice call on ringCentral in my ASP.NET MVC 4.6.2. I used code from ringCentral documentation regarding C#. But When I try to make a call. It shows "The resource you are looking for (or one of its dependencies) could have been removed" on line: "var resp = await restClient.Restapi().Account().Extension().RingOut().Post(parameters);"
Note: I am trying to make a call from ringCentral Sandbox phone number to my personal phone number in Pakistan. The Code is attached below:
[HttpPost]
public async Task Call_From_RingCentral()
{
restClient = new RestClient(
"65ty", //client id
"12gh", //client secret
"https://platform.devtest.ringcentral.com"); //server url
await restClient.Authorize("JWT");
await call_ringout();
}
static private async Task call_ringout()
{
var parameters = new MakeRingOutRequest();
parameters.from = new MakeRingOutCallerInfoRequestFrom
{
phoneNumber = Environment.GetEnvironmentVariable("+13232......")
};
parameters.to = new MakeRingOutCallerInfoRequestTo
{
phoneNumber = Environment.GetEnvironmentVariable("+92300067.....")
};
parameters.playPrompt = false;
var resp = await
restClient.Restapi().Account().Extension().RingOut().Post(parameters);
Console.WriteLine("Call Placed. Call status" + resp.status.callStatus);
}