Above linked seemed to help. Many people told it worked from them in Android 2.1 and Android 2.2 but it does not work with Android 2.3. I got error message: "java.lang.SecurityException: Neither user 10035 nor current process has android.permission.MODIFY_PHONE_STATE."
To capture call or pickup call programatically you need to use "android.permission.MODIFY_PHONE_STATE" permission in AndroidManifest.xml. From Android 2.3 onwards developers are not allowed to access this permission. Only venders with OEM license can use it for any apps which come preloaded on Android device when you buy it.
Enhancement request for Android 2.3 is already submitted by many developers as many are already using MODIFY_PHONE_STATE permission and without that permission their applications will be useless. Android guys have replied saying this permission was never supposed to be used by developers.
Visit above links for more information. If you are targeting Android 2.1 and Android 2.2 then those links might still help. If you found any new information regarding it then please comment below.