If you use the default g729 codec, the modem audio will be compressed and it will just not work as the codecs are optimised for speech, not modem tones.
You will need to use g711 codecs on all the channels you pass modems over , if this cannot be determined you will need to configure g711 for all calls and it will eat up the bandwidth !