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 Login - "Timeout waiting for protocol identifier" #134

Closed
jamcleroy opened this issue Feb 16, 2018 · 8 comments
Closed

Comments

@jamcleroy
Copy link

I'm trying to connect to the Asterisk Manager with the ManagerConnection class and originate a call. I'm not able to login, however. When using the Login() method, I always get a Timeout Exception with the message "Timeout waiting for protocol identifier". My usage is as follows:

ManagerAction action = new OriginateAction();
//Fill in originate options here
ManagerConnection mgrCon = new ManagerConnection("localhost", 5038, "username", "password");
mgrCon.Login();
ManagerResponse response = mgrCon.SendAction(action);
mgrCon.Logoff();

I'm able to connect to the Asterisk Manager through telnet and originate calls so my host, port, username and password are correct.

I can see within the Asterisk CLI that a connection attempt was made, but failed before authenticating, pointing to the connection being attempted, but the welcome response from asterisk ("Asterisk Call Manager/Version") is not being received within my application.

Am I missing something in my code before attempting to login?

@skrusty
Copy link
Collaborator

skrusty commented Feb 22, 2018

What version of Asterisk are you using?

@jamcleroy
Copy link
Author

I'm using Asterisk 13. Version 13.17.2.

@Deantwo
Copy link
Collaborator

Deantwo commented Mar 7, 2018

I get the same error when I type in an incorrect IP address or port number. So I suggest checking those are correct first.

Check also that there isn't a firewall blocking you. Mostly inbound on the server that hosts the Asterisk, but also outbound on your computer.

Then ensure that the AMI doesn't have your IP address blacklisted.
Not sure what your source IP address is when you are connecting to localhost. So try the server's own IP address instead too.

@themicster
Copy link
Contributor

I'm having the same problem. I've got a packet capture showing a connection is made and asterisk sends the Asterisk Call Manager/3.2.0 but AsterNET doesn't seem to get it. I'm running this using the nuget package with an asp.net core project. It works fine when I run it on my windows machine, but once I build it on a linux server that docker image has the problem even if I transport it to my windows machine. So I believe there must be an issue with the netstandard library or some mismatch with .net core. I think the Manager reader might have a problem on .net core. Can anyone else dig into this some more? I don't have the time to get to the bottom of this one.

@Deantwo
Copy link
Collaborator

Deantwo commented Jul 10, 2018

I assume this is the same issue as #139, which is fixed with #140.

@Deantwo Deantwo closed this as completed Jul 10, 2018
@alirashidi1993
Copy link

Can anyone please tell me how to solve this problem ?

@alirashidi1993
Copy link

I assume this is the same issue as #139, which is fixed with #140.

How ? What was wrong in your code ?

@Deantwo
Copy link
Collaborator

Deantwo commented Jun 12, 2022

Can anyone please tell me how to solve this problem ?

This isn't an issue anymore. So please use your other issue for questions instead of replying to an old closed issue.

How ? What was wrong in your code ?

If you are genuinely curious, you can just read the two linked issue and look at the pull request. I don't feel the need to explain it to you because it is not an issue anymore.

Whatever your problem is will have to be discussed in #264 instead of here.

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

5 participants