I am using CMdaAudioRecorderUtility, CMdaAudioPlayerUtility to play an mp3-file. If the call is NOT connected the application plays the sound file into the loudspeaker. And if the call is connected, then the sound file is not played at all. This has been tested on Nokia 6290, N81, C6-01.
There are apps which can do it, like AnsMachine. Can you possibly tell me what could be the problem?