Skip to main content

I need to develop an application to Track live call numbers when the RingCentral phone app is ringing. How can I do that with C# SDK?




#User story#


We have developed a c#, .net windows-based application for the Pizza shop. They need to integrate their RingCentral app with this new application to track customer call numbers. When ringing the RingCentral phone app, We need to get the customer's phone number and check whether that number is already registered with our DB. Could please help in order to get this done? I am looking for a sample code.

I tried with the below code and got the error.

// https://developers.ringcentral.com/my-account.html#/applications // Find your credentials at the above url, set them as environment variables, or enter them below


RestClient rc = new RestClient( Environment.GetEnvironmentVariable("clientId"), Environment.GetEnvironmentVariable("clientSecret"), false );

await rc.Authorize( Environment.GetEnvironmentVariable("username"), Environment.GetEnvironmentVariable("extension"), Environment.GetEnvironmentVariable("password") );

var r = await rc.Restapi().ClientInfo().SipProvision().Post(); // PROCESS RESPONSE


-----------------------------------------------------


{ "errorCode": "SPR-112", "message": "Client edition is not compatible with current Brand", "errors": [ { "errorCode": "SPR-112", "message": "Client edition is not compatible with current Brand" } ] }


Why did you invoke await rc.Restapi().ClientInfo().SipProvision().Post()?

It's for low level SIP and it's probably not what you need.


To get customer phone number, when they call you, you need to create a subscription: https://github.com/ringcentral/RingCentral.Net/blob/master/RingCentral.Tests/SubscriptionTest.cs

And here is the event: https://developers.ringcentral.com/api-reference/Extension-Telephony-Sessions-Event



Hi Tyler,


I checked your sample. But I received the below error. Could you please advise how can I get this off?

1656093750257.png


Also, I have given all the permissions.


1656093813917.png


Here is my code snippet


1656093896741.png


Also, your sample is for Send SMS, Not to Get caller number. It would be great if you can share a sample code that I can use to get the call number when ringing the phone.




Code is almost the same. You just replace the event filter. And parse the response for the number.


it means you authorize your app using extension 1, and try to subscribe to events for extensions 2. But extension 1 and extension 2 don't belong to the same company.


Reply