Skip to main content
Question

I want live incoming call event in c# during phone ring.

  • February 1, 2019
  • 2 replies
  • 1394 views

I want integrate ringcentral with my window form. So i need to find caller number and name during phone ring from c#. So is there any possible solutions?

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2312 replies
  • February 1, 2019
Are you using the RingCentral SDK for c-sharp? If not, open your project and install the RingCentral SDK via NuGet (search for RingCentral Client 3.0.0 package).

After adding the SDK to your project, you can use it as shown below:

using RingCentral; 

...
const string RC_CLIENTID = "your app client id";
const string RC_CLIENTSECRET = "your app client secret;
const string RC_SERVER = "https://platform.devtest.ringcentral.com";

const string RC_USERNAME = "username";
const string RC_PASSWORD = "password";
const string RC_EXTENSION = "extension number"; 

RestClient rc = null;
SubscriptionService subscription = null;
...
        protected void Page_Load(object sender, EventArgs args)
        {
            if (rc == null)
            {
                rc = new RestClient(RC_CLIENTID, RC_CLIENTSECRET, false);
                RegisterAsyncTask(new PageAsyncTask(RingCentralAuthenticationAsync));
            }
        }

        private async Task RingCentralAuthenticationAsync()
        {
            await rc.Authorize(RC_USERNAME, RC_EXTENSION, RC_PASSWORD);
            if (rc.token.access_token.Length > 0)
            {
                Console.WriteLine("Authorized");
                RegisterAsyncTask(new PageAsyncTask(subscribeForNotification));
            }
        }   

        private async Task subscribeForNotification()
        {
            subscription = rc.Restapi().Subscription().New();
            subscription.EventFilters.Add("/restapi/v1.0/account/~/extension/~/incoming-call-pickup");
            subscription.NotificationEvent += (sender, args) =>
            {

                var message = args.message;
                Console.WriteLine(message);

            };

            subscription.StatusEvent += (sender, args) =>
            {

                Console.WriteLine(args.Message);
            };
            await subscription.Register();
        } 

Check out other notification type. Particularly the "Presence" would give you better telephony status.

Hope this helps!

+ Phong

  • Author
  • New Participant
  • 3 replies
  • February 5, 2019
Hi,

We implemented as you mentioned before. 

But main aim is :

I have installed ringcentral windows client . When call comes to my number i want find incoming call event in c# and want to place my stuff in that event and i want operate phone from screen(answer call, end call).And also i want know ring central supports TAPI?



Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings