question

sunny2393 avatar image
sunny2393 asked John Wang Deactivated answered

Getting started with API and C# SDK

Hi,

Community and Experts.


I am new to the API and SDK. i want to get help and guideline from the experts where to start and which way to follow.

I have downloaded the SDK from the website RCdotNetXDK, i found this is the place where i can start. i am just making a sample application using this SDK. I found that there is functions given in the SDk to send the SMS but there is no option to make an outgoing call . so i added the class in the same way as in SMS


public class RingOutServices {


private const string API_RESOURCE = "/ringout";

private const string API_RESOURCE_DELETE = "/ringout/44";


private ApiClient ApiClient { get; set; }


internal RingOutServices(ApiClient apiClient)

{


this.ApiClient = apiClient;

}


public void MakeCall(RingOutCall call)

{


ApiClient.PostFromExtension(API_RESOURCE, call.ToString());

}


public void CancelCall()

{


ApiClient.DeleteFromExtension(API_RESOURCE_DELETE, "");

}



public void MakeCall(string from, string to, string text,string country)

{


MakeCall (new RingOutCall { Called = new PhoneNumber(to), Calling = new PhoneNumber(from), PlayPromt = text,Country=country });

}

}


and


public class RingOutCall {


public PhoneNumber Called { get; set; }


public PhoneNumber Calling { get; set; }


public string PlayPromt { get; set; }


public string Country { get; set; }


public override string ToString()

{


var obj = JObject.FromObject(new

{


to = from r in new List<string> { this.Called.GetE164() }

select new

{


phoneNumber = r

},

from = new { phoneNumber = Calling.GetE164() },

text = PlayPromt,

country = Country

});


return obj.ToString();

}

}


so i have some questions regarding this :


  1. How to put call on hold?
  2. how to make a conference call while there is call in progress?
  3. How to get notification of an incoming call with the caller id prompt on screen?
  4. how to cancel an outgoing or incoming call?
  5. how to enable disable call recording?

these are some basics questions that i need help so i can start the application. Any help regarding this .. is i am going to the right way? is this the SDK with which i can start?


Waiting for the positive help..


sdk
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 would recommend asking these questions and communicating with the experts who author the C# SDK in the Github Issue tracker for the repository, here: 
https://github.com/ringcentral/ringcentral-csharp/issues
1 |3000

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

John Wang avatar image
John Wang Deactivated answered
Hi Sunny,

You are currently using the Community SDK RCdotNetXDK here:  https://github.com/vshisterov/RCdotNetXDK

Our official SDK is here as mentioned by Benjamin:  https://github.com/ringcentral/ringcentral-csharp

Many of your questions are call control questions in which case our WebRTC capability may be what you're interested in. WebRTC is supported in our JavaScript WebRTC SDK here:

https://github.com/ringcentral/ringcentral-web-phone

Regarding your specific questions:


(1) How to put call on hold?

You cannot use the C# SDK to put a call on hold but you can use our WebRTC capability to do so which is a client-side JS SDK with information here:  https://github.com/ringcentral/ringcentral-web-phone#hold-unhold

(2) how to make a conference call while there is call in progress?

Similar to the above, this cannot be done with any C# SDK. For this, ask on our WebRTC SDK project here:

https://github.com/ringcentral/ringcentral-web-phone/issues

(3) How to get notification of an incoming call with the caller id prompt on screen?

To get an event on incoming calls, make a subscription for presence events which will send inbound call events with caller id.

To get a caller id prompt on the screen, you'll need to catch that event and create a display on the screen. A demo is available for JavaScript in the CTI Demo:

https://github.com/ringcentral/ringcentral-js-cti-demo

You can also get information on making subscriptions for C# and JS below. JS is typically used for displaying notifications on the screen if you wish to run the subscription on the client. If you wish to run the subscription on the server using C#, you and send it to the browser using web sockets.

C#:  http://ringcentral-csharp.readthedocs.io/en/latest/usage/notifications/Subscriptions/
JS:  https://github.com/ringcentral/ringcentral-js#server-side-subscriptions

(4) how to cancel an outgoing or incoming call?

RingCentral has two ways to make calls, RingOut and WebRTC.

Using RingOut, you can issue a DELETE REST API call to the RingOut ID endpoint.

Using WebRTC you can terminate the call using session.terminate which is shown in the WebRTC demo app below:

https://github.com/ringcentral/ringcentral-web-phone/blob/master/demo/index.js#L241

(5) how to enable disable call recording?

You can do this with WebRTC as shown here:

https://github.com/ringcentral/ringcentral-web-phone#start-stop-recording
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