I tried it and use the following code for recording outgoing calls but it does not..
@Override
public void onReceive(Context context, Intent intent)
{
You cannot record call simply by media recorder. you have to also change the setting of audio manager and put the loud speaker on before starting recording and the audio source will remain same(mic).So try to edit audio manager's setting
AudioManager audiomanager = (AudioManager)context.getSystemService("audio");
int i = audiomanager.getRouting(2);
audiomanager.setMode(2);
audiomanager.setMicrophoneMute(false);
audiomanager.setSpeakerphoneOn(true);
int j = audiomanager.getStreamMaxVolume(0);
if(j < 0)
j = 1;
int k = j / 2 + 1;
audiomanager.setStreamVolume(0, k, 0);
audiomanager.setRouting(2, 11, 15);