AsterNET / AsterNET

AsterNET is an open source .NET framework for Asterisk AMI and FastAGI. AsterNET allows you to talk to Asterisk AMI from any .NET application and create FastAGI applications in any .NET language.
http://www.xdev.net/projects/asternet/
MIT License
184 stars 127 forks source link

asternet How to get list of users #245

Open SnifferEv opened 4 years ago

SnifferEv commented 4 years ago

I want get list of users(like sip show users). Now i use

AsterNET.Manager.Action.CommandAction cmdAction = new AsterNET.Manager.Action.CommandAction(); cmdAction.Command = "sip show users"; CommandResponse response = (CommandResponse)manager.SendAction(cmdAction); `

But versions 12 and 16 of asterisk have different output. How can i get users list trough asternet methods?

Deantwo commented 4 years ago

What is the differences in the two outputs?

And I don't know if there is an Asterisk command to get a list of SIP users. Maybe: ManagerAction_SIPpeers

You will have to actually read the Asterisk AIM command list to see what exist. Here: https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+AMI+Actions Normally doing text commands like that to emulate the CLI commands isn't what you would do with AMI at least.

SnifferEv commented 4 years ago

image image

depending on version i must to pars different ways. So I would like to ask if there is a ready-made method in the library?

Deantwo commented 4 years ago

depending on version i must to pars different ways.

Looks like the only difference is that Output: is added in Asterisk16, might be part of the communication changes I have been seeing reported elsewhere. See: https://github.com/AsterNET/AsterNET/issues/240#issuecomment-684556973

So I would like to ask if there is a ready-made method in the library?

Like I said, you will have to check the actual Asterisk AIM command list. AsterNET doesn't invent anything, it only makes it easier to use the Asterisk AIM commands and events. I don't know if there is an Asterisk AIM command to get a list of SIP users, you will have to figure that out yourself. If you are lucky, someone else asked the exact same issue here before so you should check the closed issues.

SnifferEv commented 4 years ago

Is this project still supported? The latest version was released in 2018.

Deantwo commented 4 years ago

Is this project still supported? The latest version was released in 2018.

That was likely when the last NuGet was release yeah. The master branch here has a bunch of fixes that aren't in the v1.3.0 NuGet release. Updating on this project has been slow over the last couple of years.

My company hasn't updated to a new version of Asterisk in a long while, so the issues that have popped up hasn't affected us. Not to mention that I don't use all AIM features/commands/events, so most of them I have never used.

We have been collecting changes and feedback here for quite a while now, but we know the next update will be v2.0.0 and it will have some breaking changes. So there hasn't been any rush. Asterisk versions have however exploded over the past two years, and I know there are a bunch of bugs in the v1.3.0 NuGet version when it comes to Asterisk versions beyond v14, such as what you reported here.

Mainly we need more contributors and people to help test the latest master. Before we will do a v2.0.0 NuGet release.