I’m seeing an odd situation with a TCP trunk that I can’t figure out. When the trunk connection is made, after 30 seconds, a FIN,ACK is sent from the Asterisk server to the trunk even if the trunk sent an OPTIONS into Asterisk. The TCP connection then enters a TIME_WAIT state. This isn’t exactly an issue, but the behavior changes if a call is made on that trunk within that first thirty seconds. After the call is torn down, the connection stays in the ESTABLISHED state; no FIN,ACK is sent from the Asterisk server, even after waiting 5+ minutes.
What I am trying to figure out is what is causing the behavior of the TCP connection to change. If this was an OS-level behavior, the traffic coming across (OPTIONS vs INVITE) shouldn’t matter. If this was an Asterisk-level behavior, I would think it was a bug as a TCP connection should stay open to ensure two way traffic. Can anyone explain this behavior? This is on Asterisk 1.8 and 13. I can provide Wiresharks if it would help. I can’t figure out the “why” to this behavior.