Asterisk or AMI close Connection without log notification

Hello,
I’m a new member of the asterisk forum.
Since July, the month in which I took charge of an Asterisk-based call center system with AMI connection, I have been reconsidering a blocking problem that I cannot understand: randomly after a certain period of normal activity Asterisk closes the AMI connections to my system ( WEB interface for Call-Center). In the logs, both the WEB and Asterisk part (file full), at the time of the crash I do not find anything and, on my system, the connection is UP (even if I know very well that it is not, as I no longer receive messages).
Doing a netstat -anpo on port 5038 I have the following situation.

  1. Situation OK
    tcp 0 0 10.110.6.228:5038 10.110.6.228:38838 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:49834 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:36126 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:36126 10.110.6.228:5038 ESTABLISHED 23926 / java off (0.00 / 0/0)
    tcp 897273 0 10.110.6.228:38838 10.110.6.228:5038 ESTABLISHED 23926 / java off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:49834 10.110.6.228:5038 ESTABLISHED 26639 / java off (0.00 / 0/0)

  2. just before the fall
    tcp 0 1727785 10.110.6.228:5038 10.110.6.228:38838 FIN_WAIT1 - probe (24.08 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:49834 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:36126 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:36126 10.110.6.228:5038 ESTABLISHED 23926 / java off (0.00 / 0/0)
    tcp 903788 0 10.110.6.228:38838 10.110.6.228:5038 ESTABLISHED 23926 / java off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:49834 10.110.6.228:5038 ESTABLISHED 26639 / java

  3. after the fall
    tcp 0 0 10.110.6.228:35300 10.110.6.228:5038 ESTABLISHED 23926 / java off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:49834 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:5038 10.110.6.228:35300 ESTABLISHED - off (0.00 / 0/0)
    tcp 0 0 10.110.6.228:49834 10.110.6.228:5038 ESTABLISHED 26639 / java off (0.00 / 0/0)

As you can see, when the system works,we are in the in the case 1,
(6 connection in ESTABLISHED state),
then if something happens I go to case 2 (one or more connections in FIN_WAIT1 state) and in the end I lose the connection (case 3 with 4 connection instead of 6).
In my system I put some monitors that if such a fall occurs I restart the AMI connection … unfortunately, however, the system does not always manage to reopen and therefore I have to do a complete manual restart.
Can someone help me?
thanks Massimiliano

PS info of the system
asterisk: version 1.8.32.3
my system: Java 1.7 ami asterisk-java version 2.2.0strong text

If you have a FIN_WAIT state, the connection is half closed, and you should have received an indication of that. The OS kernel cannot put the connection into FIN_WAIT without a FIN having been sent to you, so, if you haven’t received an indication of that, it is not Asterisk’s fault.

FIN_WAIT1 means that the half close indication has been sent, but not acknowledged, which suggests a network problem, or a kernel level problem at your end. The network problem might be a temporary firewall or NAT rule timing out.

If I remember correctly, Asterisk trying to close an AMI session tends to happen when trying to send an event would have blocked, which also indicates a failure to receive responses from your end. Look for careful write failures.

thanks for your valuable contribution … I’ll check your suggestions together with the network experts.
Massimiliano

Hi, could you contact me for a further details because I cannot further specify the situation in order not to conflict with the customer’s privacy? - lifeisbau@yahoo.com

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.