We recently upgraded our version of asterisk from version 1.4.26.1 -> 13.23.1. And of the changes that we noticed was that after the AMI has closed its connection it used to respond to the AGI with a "Hangup" and then closes the tcp connection. This behaviour appears to have changed and it now receives a "HangupRequest" and leaves the connection open. From the Asterisk logs it also appears to be constantly attempting to destroy the channel. Does a HangupRequest expect a specific response from the AGI in order for it to complete the hangup?
The workaround that we are currently using is to add Set(AGIEXITONHANGUP=yes)
within the Dial plan this returns the behaviour to the way it used to perform a hangup whereas it feels like their should be a more graceful way of handing the hangup requests that does not need this setting within the dial plan.