Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManagerConnection.SuccessfulAuth does not fire #270

Closed
babskig opened this issue Oct 12, 2022 · 4 comments
Closed

ManagerConnection.SuccessfulAuth does not fire #270

babskig opened this issue Oct 12, 2022 · 4 comments

Comments

@babskig
Copy link

babskig commented Oct 12, 2022

When using the code:

var connection = new ManagerConnection(host, port, user, pass);
connection.SuccessfulAuth += (s, e) =>
{
    Console.WriteLine("{0} In SuccessfulAuth", DateTime.Now);
};
connection.Login();

The event SuccessfulAuth never fires.

I captured the TCP traffic, with the following data (with sensitive info removed):

Asterisk Call Manager/1.1
Action: Challenge
ActionID: 15368010_0#
AuthType: MD5

Response: Success
ActionID: 15368010_0#
Challenge: <redacted>

Action: Login
ActionID: 15368010_1#
Username: <redacted>
AuthType: MD5
Key: <redacted>

Response: Success
ActionID: 15368010_1#
Message: Authentication accepted

I expected that at the point the asterisk server returned "Message: Authentication accepted" the SuccessfulAuth would fire.

I tried using the nuget package version 1.3.0 and by clone this repo (HEAD was at c4df9d8).

Attached is a minimal Visual Studio 2017 project that reproduces the issue.
TestAsternetAuth.zip

@Deantwo
Copy link
Collaborator

Deantwo commented Oct 12, 2022

What version of Asterisk are you using?

@babskig
Copy link
Author

babskig commented Oct 13, 2022

Running: asterisk -V
Asterisk 1.6.2.6

@Deantwo
Copy link
Collaborator

Deantwo commented Oct 13, 2022

Asterisk 1.6 is extremely old. The SuccessfulAuth event was supposed added in Asterisk 13 (or 12?), so that is why the event isn't raised.

See: https://wiki.asterisk.org/wiki/display/AST/New+in+13#Newin13-Events

AMI will now emit security events. A new class authorization has been added in manager.conf for the security events, security. The new events are:
...
SuccessfulAuth
Raised when a request successfully authenticates.

This will likely not be changed in AsterNET, since AsterNET is made to just convert all AMI messages it receives and little else.

@babskig
Copy link
Author

babskig commented Oct 14, 2022

Ah, I see. Thanks for looking.

@babskig babskig closed this as completed Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants