How to disable incoming DTMF tones during calls?

Hi, I’m using Asterisk with FreePBX and I set up some IVRs, so I need DTMF tones, but I found out a problem (and a possible security issue): also tones coming from an external context are resolved in feature codes. An extension should be able to transfer a call, but not the trunk.
Is it possible to disable features code only if the tones are coming from one side? If two extensions are communicating, it’s normal that both can use feature codes, but it’s not normal that the user from the other side of a trunk can do it.

Thank you in advance.

Neither side can use transfer codes unless you specifically permit them to do so in the Dial application options, so simply don’t enable them.

(Note this doesn’t apply to non-features transfers, e.g. true SIP transfers, although there are other controls on those.)

Thank you, I set the Asterisk Dial Options value to “tr” and Asterisk Outbound Trunk Dial Options to “T”, and all is working fine. Thank you so much. The only problem is that during internal calls only the called party can transfer, but it’s not a big issue.