To get caller information using .NET

I am new to FreePBX, I was able to login into FreePBX server using c#. Can anyone please provide me the information to get the caller details like caller phone number, call Id using c#. I checked with the below code snippet but I get a null value when there is an ongoing call. I have used Aster.NET library.
Please required the suggestion for the above implementation.

NewExtenEvent extnEvents = new NewExtenEvent(manager);
NewChannelEvent channelEvents = new NewChannelEvent(manager);
string callerNumber=channelEvents.CallerIdNum;
NewCallerIdEvent callEvents = new NewCallerIdEvent(manager);


I am also new to Freepbx and want to achieve the same. How have you connected to Freepbx using C#? Do we have to do some configuration in Freepbx to allow C# to connect to it?

I’m really not clear on what you are expecting. C# is a programming language. There are libraries that you can install that will converse with parts of FreePBX, but those are all outside the scope of FreePBX. There isn’t an “API”, per se, so connecting to “FreePBX” with C# isn’t really something that you can “do”.

You need to look at ARI and the Rest Interfaces, but then again, you’ll need a C# library that supports those, and all of that is WAY outside the scope here.