Poor audio quality when bridging SIP/G711 and IAX/GSM


I have an Asterisk 1.2 system with CAPI/ISDN/T0, IAX and SIP connectivity.

SIP phones use G.711a codec, IAX uses GSM and ISDN is G.711a

I get a reasonable audio quality when i make calls:
(IAX or SIP) - asterisk - ISDN (both ways),
(IAX or SIP) -asterisk - voicemail (listening/recording),

However, when I have calls: AIX - asterisk - SIP, the audio has very poor quality both ways. Sound is very noisy and barely audible.

I have had the same problem using codec G.711u for IAX and with asterisk 1.0.

I have no clue where the problem comes from and how to fix it.

Any idea anyone ?