In PSTN applications dedicated telephony circuits are used to generate DTMF (e. g. MT8880). On the other hand, a microprocessor can do it, too.
With GSM modules it is much easier. Just send one AT command AT+VTS=X and generate correct tones via software. AT+VTS=1 generates the DTMF tone 1 for 100 ms.