I want to know which situation we will use high complexity or medium complexity for connecting TMD on voice gateway ? In normal situation, the TMD will only use G.711 as the codec.
That depends on what type of codecs you are using for your calls..
High complexity codecs include g729. For a detailed list of codecs and their complexity please refer to this link
For a better understanding of how dsp allocates credits refor to this link