VOIP Call Recording
Asked Answered
E

1

8

I am working on a project to record VOIP calls in android, I didn't found any solution for that, there are lot of apps which support VOIP recordings on phones. I am unable to find any tutorial and help. Cube Call Recorder is one of the app which is giving this feature but I can't figure out how to do it. I was tested it by starting recording by using android MediaRecorder then initiated whatsapp call, so other person was unable to listen my voice. after call, I checked only my voice were saved in the recording.

As a research I reverse engineered some apks, I found they are using Accessibility permissions in the apk.

<uses-permission android:name="android.permission.BIND_ACCESSIBILITY_SERVICE" />

I don't know what things I need to understand how can I get to know that to VOIP call is coming and going just like a BroadcastReceiver.

Then, I will understand how can I record the calls.

Eade answered 20/1, 2018 at 8:24 Comment(7)
Did you manage to find a solution? I am working on a similar app right now, and can't seem to find any way of doing this.Kofu
No buddy Still notEade
@NaveedAhmad any solution for this?Tzong
@Tzong Still the answer is a mystery, I find some clues but still not the exact solution yet. Can we contact on email? to work in coordination, if we solve this mystery we can share hereEade
Any solution for this?Abominate
Not yet guys....Eade
@NaveedAhmad : have you found any solution for this?Tarlatan
H
1

I have found the answer for this

First grant accessiblity permission and have this class

import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.Intent;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;

public class AccessAudio extends AccessibilityService {
    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
Log.d("","gf");
    }

    @Override
    protected void onServiceConnected() {
        super.onServiceConnected();

        AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
        accessibilityServiceInfo.flags = 1;
        accessibilityServiceInfo.eventTypes = -1;
        accessibilityServiceInfo.feedbackType = 16;
        setServiceInfo(accessibilityServiceInfo);
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onInterrupt() {

    }
}

After that you can use

mediaRecorder = new MediaRecorder();
        mediaRecorder.setAudioSource(MediaRecorder.AudioSource.VOICE_RECOGNITION);
        mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        mediaRecorder.setOutputFile(AudioSavePathInDevice.getPath());
        mediaRecorder.prepare();
        mediaRecorder.start();
Heartburning answered 12/10, 2020 at 20:6 Comment(2)
may u please explain this a little bit better @Heartburning ?Headmost
@Heartburning : can you share the full code of this?Tarlatan

© 2022 - 2024 — McMap. All rights reserved.