RingCentral 'Make RingOut Call' issue in .NET C#

58 Views Asked by At

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 by using "From Number: Default Phone Number From My RingCentral Sandbox account" and "To Number: My Canadian Phone Number". It shows success status but I do not get the call.

However, a strange thing happens if I reverse the numbers like in 'To Number', I used Default Phone Number From My Ring Central Sandbox account and in 'From Number', I used My Canadian Phone Number then I get a missed call to my Canadian Phone Number from Sandbox Phone Number.

I would be thankful for the help regarding the above mentioned strange scenarios, and also please guide me that why I get just missed call and not proper call. The code attached below:

[HttpPost]
public async Task Call_From_RingCentral()
{
    RestClient rc = new 
    RestClient(ConfigurationManager.AppSettings["RingCentral:ClientId"], 
    ConfigurationManager.AppSettings["RingCentral:ClientSecret"], false);
    await rc.Authorize("JWT Token");
    if (rc.token.access_token.Length > 0)
    {
        var parameters = new MakeRingOutRequest();
        parameters.from = new MakeRingOutCallerInfoRequestFrom { phoneNumber = 
        "+151....." };
        parameters.to = new MakeRingOutCallerInfoRequestTo { phoneNumber = "+132....." 
     };
        parameters.playPrompt = true;

        var resp = await rc.Restapi().Account().Extension().RingOut().Post(parameters);
        Console.WriteLine("Call Placed. Call status: " + resp.status.callStatus);
    }
 }

Note: I am using RingCentral Sandbox Account

0

There are 0 best solutions below