Hi Mickael,
Sorry, I may not be able to follow all your analisis but there must be a reason for MRCPv2 TCP connections to remain stuck.
First, there are several configuration parameters that can be set for MRCPv2 connections. The most relevant ones are
<max-connection-count>100</max-connection-count>
<max-shared-use-count>100</max-shared-use-count>
<force-new-connection>false</force-new-connection>
<inactivity-timeout>600</inactivity-timeout>
<termination-timeout>3</termination-timeout>
But I would try to find the root cause of the problem. If the client does not close a SIP/MRCPv2 session, then the session will be closed by the server upon expiration of other timeout such as
<sip-session-expires>600</sip-session-expires>
and all the resources will be properly released in this case.
However, if there is a problem in the communication between the core and the plugin, then yes, the session and associated resources may not be released, as there is no indication that the underlying resources are no longer referenced. Needless to say, any action taken in these circumstances may easily cause a segfault.