If the "Terminate by DTMF" option is set to true, then recording should finish when 3CX detects any DTMF digit.
What phone are you using for testing this? Is it configured to send DTMF digits with RFC2833 or SIP INFO methods? If you configure the phone to send DTMF inband, 3CX may not detect them...

