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

Timeout on SendAction #205

Open
lameventanas opened this issue Jul 4, 2019 · 2 comments
Open

Timeout on SendAction #205

lameventanas opened this issue Jul 4, 2019 · 2 comments
Labels
bug A bug in the project that needs to be fixed.
Milestone

Comments

@lameventanas
Copy link

lameventanas commented Jul 4, 2019

I have a program with an AgentCalled event handler that needs to check the extension's state.

It looks like this:

ExtensionStateAction esa = new ExtensionStateAction();
esa.Exten = myExtension;
ManagerResponse res = manager.SendAction(esa);

This always times out, but when I connect to asterisk's manager via telnet I can do this:

Action: ExtensionState
ActionID: 2
Exten: 1020

Response: Success
ActionID: 2
Message: Extension Status
Exten: 1020
Context: default
Hint: SIP/1020
Status: 1

I'm aware of #188, but here the manager connection (and callbacks) run in a single thread, I don't have multiple instances (I'm not even sure what that means).

As a workaround, I don't call SendAction() anymore, but I implemented a second event handler to handle the ExtensionState event, which always comes shortly after AgentCalled event. Then both event handlers have some crude logic to determine they are related, but this is ugly and less reliable.

@Deantwo Deantwo added not enough information Need more information about the issue. bug A bug in the project that needs to be fixed. labels Jul 4, 2019
@Deantwo
Copy link
Collaborator

Deantwo commented Jul 4, 2019

For reference: wiki.asterisk.org - ManagerAction_ExtensionState

If you don't know what it means to have multiple instances, you might want to share you connection and disconnection code too.

There are multiple open issues about TimeoutExceptions being thrown where it makes no sense. Some code to reliably reproducing the issue would help a lot.
Was one other issue where I could reproduce the issue, but that case kinda went nowhere after the reporter didn't reply.
See: #123

@Deantwo Deantwo closed this as completed Jul 4, 2019
@Deantwo Deantwo reopened this Jul 4, 2019
@lameventanas
Copy link
Author

Here is a small console program to reproduce it.
It reacts to any UserEvent.

@Deantwo Deantwo removed the not enough information Need more information about the issue. label Jul 4, 2019
@Deantwo Deantwo added this to the Version 2.0 milestone Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the project that needs to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants