News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
I want live incoming call event in c# during phone ring.
Tags: sdk
Feb 1, 2019 at 3:53am   •   2 replies  •  0 likes
venkatraju-p

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 Answers
answered on Feb 5, 2019 at 8:07am  
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?



 0
answered on Feb 1, 2019 at 2:54pm  
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

 1



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us