Recording outgoing call after receiving by the receiver from my Android application?
<p>I want to make a call recording application where user can record his outgoing call. I have done it. But one little problem, call is recording when I am starting to dial a number. I want that , the call will be recorded when the receiver will receive it. Otherwise no sound will be recorded. That means, I want a sound that is free from disgusting dialing tone. Sample code of my application is given below.</p>

<pre><code>//Service
@Override
    public void onCallStateChanged(int state, String phonenumber) {

        switch (state) {
        case TelephonyManager.CALL_STATE_RINGING:
            Log.d(TAG, "CALL_STATE_RINGING");

            break;

        case TelephonyManager.CALL_STATE_OFFHOOK:
            Log.d(TAG, "CALL_STATE_OFFHOOK");
            isOffHook = true;
            try {
                Toast.makeText(context, "Recording started", 10000).show();
                Toast.makeText(context,
                        "Recording will stop when call is Diconnected",
                        10000).show();
                startRecord();
            } catch (IllegalStateException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            break;

        case TelephonyManager.CALL_STATE_IDLE:
            Log.d(TAG, "CALL_STATE_IDLE");

            if (isOffHook) {
                try {

                    stopRecord();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            break;

        }
</code></pre>
