I just tested the DTMF-Only gateway with VXML Server 8.5 and IOS 15.1 and got some unexpected results.
When I select DTMF-Only and use a Form element and enter DTMF-Grammar: builtin:dtmf/digits
The vxml code sent to the gateway contains no grammar at all (whether I include a minlength, or maxlength, or length doesn't matter - the grammar doesn't show up in the vxml code). And the gateway allows me to enter any number of digits I want.
If I use a Digits element, then the vxml code contains what I'd expect
So - if you want to specify a min/max number of digits you will have to use the Digits Element.
Finally, if you want a fixed number of dtmf keys (for example, 2 dtmf keys), then you can enter this on the DTMF-Keypress setting: .. (dot dot) that allows only 2 DTMF keys. It accepts the first 2 dtmf keys and ignores the rest entered by the caller.
I'm going to paste the vxml created by VxmlServer below.
I will attach 2 VXML Debug Logs on the forum in case you'd like to see. (one shows just the field and grammars, the other is the complete log)