Reason of "Disconnected from Asterisk server"

Hi All,

Do you guys know what the reasons behind “Disconnected from Asterisk server” are?

Usually, I got this error after I modify the source-code of Asterisk. When I forget to close the file (fclose), then I can understand that my code is the culprit. However, when everything seems fine, then I get the error…

So, I would like to understand a little bit more about this.

Any help is appreciated!

Thank You