Skip to content

Fix #214. Lose ami connection after restart Asterisk#215

Open
Gref2007 wants to merge 1 commit intoAsterNET:masterfrom
Gref2007:master
Open

Fix #214. Lose ami connection after restart Asterisk#215
Gref2007 wants to merge 1 commit intoAsterNET:masterfrom
Gref2007:master

Conversation

@Gref2007
Copy link

@Gref2007 Gref2007 commented Dec 11, 2019

Fixes: #214

Copy link
Collaborator

@Deantwo Deantwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and follows the existing code format.
Could use a test scenario or code to reproduce the issue, so we can see if it is fixed.

@Gref2007
Copy link
Author

Gref2007 commented Dec 13, 2019

Could use a test scenario or code to reproduce the issue, so we can see if it is fixed.

Sorry, i don't know how correct reproduce issue or write clear test.
But i can show, how i do it.
Use checkManagerAPI() in AsterNET.Test.
Set manager.PingInterval = 1;. It is need for increase chance catch bug.
Somewhere in 'while loop' in ManagerReader.Run() set Console.WriteLine("Thread = " + Thread.CurrentThread.ManagedThreadId);
It is help you see, that we still read from socket.
And finally, on Asterisk execute :
for i in {1..10}; do /usr/sbin/asterisk -rx'core restart now'; date; sleep 5; done.
You will see, that usually after 1-3 restart asterisk, we stop listen ami.

@Gref2007 Gref2007 requested a review from Deantwo December 18, 2019 11:51
Copy link
Collaborator

@Deantwo Deantwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need to rewrite the entire communication layer.

@Gref2007 Gref2007 requested a review from Deantwo February 25, 2020 09:38
@Deantwo
Copy link
Collaborator

Deantwo commented Feb 25, 2020

I haven't had the time to test this right now. Not sure when I will have the time.

But feel free to add some code snippets to make testing easier.

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

Successfully merging this pull request may close these issues.

Lose connection after restart Asterisk.

2 participants