cordova-plugin-callrecorder
v1.0.0
Published
Automatic call recording for Android (API 24+). Records regular calls AND VoIP calls (WhatsApp, Signal, Telegram, Zoom). Works on Android 9–14. Uses AccessibilityService so no root required.
Maintainers
Readme
cordova-plugin-callrecorder
⚠️ RESTRICTED USE — APPROVAL REQUIRED
You are NOT allowed to use this plugin until you have received written approval via email from MGTECH LABS PRIVATE LIMITED.
To request approval, contact us at: [email protected]
Website: www.kalamacademy.org
Automatic call recording for Android apps built with Cordova or VoltBuilder.
Records both regular phone calls and VoIP calls (WhatsApp, Signal, Telegram, Zoom, Google Meet, Skype, Discord) — without root, without a system app.
What it supports
| Feature | Status | |---|---| | Regular phone calls | ✅ | | WhatsApp voice calls | ✅ | | Signal, Telegram calls | ✅ | | Zoom, Google Meet, Skype | ✅ | | Keep recording when screen is locked | ✅ | | Survive phone reboot | ✅ | | Android 9 to 14 (API 24–35) | ✅ | | No root required | ✅ |
How it works (simple explanation)
Normally Android blocks apps from recording calls. This plugin gets around that using two tricks:
- AccessibilityService — Android's built-in tool for apps that need to "see" the screen (used by screen readers). We use it to detect when a call screen opens, then start recording.
- PhoneStateListener — Listens for when a call connects/disconnects to start and stop recording automatically.
The user has to manually enable Accessibility permission once (just like enabling a screen reader). After that, everything is automatic.
Quick install (3 steps)
Step 1 — Add the plugin
From NPM (once published):
cordova plugin add cordova-plugin-callrecorderFrom local folder (for testing):
cordova plugin add ./path/to/cordova-plugin-callrecorderStep 2 — Add this to your config.xml
<preference name="android-targetSdkVersion" value="35" />
<preference name="android-minSdkVersion" value="24" />
<preference name="AndroidXEnabled" value="true" />Step 3 — Call these 3 functions in your app on first launch
// Step 1: Ask for microphone + phone state permissions
CallRecorder.requestPermissions(
function() { console.log('Permissions granted'); },
function(err) { console.error('Permission denied:', err); }
);
// Step 2: Check if accessibility is on, if not, open settings
CallRecorder.isAccessibilityEnabled(
function(enabled) {
if (!enabled) {
// This opens Android Settings so the user can turn it on
CallRecorder.openAccessibilitySettings();
}
}
);
// Step 3 (optional but recommended): Protect app from uninstall
CallRecorder.activateDeviceAdmin(
function() { console.log('App protected from uninstall'); },
function(err) { console.warn('Device admin skipped:', err); }
);That's it. After these 3 steps, call recording starts automatically. You don't need to do anything else per-call.
Full JavaScript API
All methods use callbacks: success(result) and error(message).
// ── Setup ──────────────────────────────────────────────────────────────────
// Request RECORD_AUDIO + READ_PHONE_STATE permissions
CallRecorder.requestPermissions(success, error);
// Returns 1 (enabled) or 0 (disabled)
CallRecorder.isAccessibilityEnabled(success, error);
// Opens Android Accessibility Settings page
CallRecorder.openAccessibilitySettings(success, error);
// Opens Device Admin activation dialog (prevents uninstall)
CallRecorder.activateDeviceAdmin(success, error);
// Returns 1 (active) or 0 (not active)
CallRecorder.isDeviceAdminActive(success, error);
// Returns 1 (granted) or 0 (denied)
CallRecorder.hasRecordPermission(success, error);
// ── Recordings ─────────────────────────────────────────────────────────────
// Returns array of recording objects: [{name, path, size, date}, ...]
CallRecorder.getRecordings(success, error);
// Delete a recording by its path
CallRecorder.deleteRecording(filePath, success, error);
// Open a recording in the phone's audio player
CallRecorder.playRecording(filePath, success, error);
// ── Info ───────────────────────────────────────────────────────────────────
// Returns {manufacturer, model, sdkInt, androidVersion}
CallRecorder.getDeviceInfo(success, error);Integrating into an existing CRM app
If you already have a Cordova CRM app that needs call recording, here is exactly what to add:
1. Add the plugin
cd your-crm-app
cordova plugin add cordova-plugin-callrecorder2. In your app's config.xml, make sure these exist:
<preference name="android-minSdkVersion" value="24" />
<preference name="android-targetSdkVersion" value="35" />
<preference name="AndroidXEnabled" value="true" />3. In your main index.html or app startup code, add inside deviceready:
document.addEventListener('deviceready', function () {
// --- One-time setup check ---
CallRecorder.hasRecordPermission(function(granted) {
if (!granted) {
CallRecorder.requestPermissions(null, null);
}
});
CallRecorder.isAccessibilityEnabled(function(enabled) {
if (!enabled) {
alert('Please enable "Call Recorder" in Accessibility Settings to start recording calls.');
CallRecorder.openAccessibilitySettings();
}
});
}, false);4. To show recordings in your CRM's call history:
CallRecorder.getRecordings(function(result) {
// result is either an array or a JSON string
var recordings = Array.isArray(result) ? result : JSON.parse(result);
recordings.forEach(function(rec) {
console.log('Recording:', rec.name);
console.log('Size:', rec.size, 'bytes');
console.log('Date:', rec.date);
console.log('Path:', rec.path);
});
}, function(err) {
console.error('Could not get recordings:', err);
});File structure of the plugin
cordova-plugin-callrecorder/
│
├── plugin.xml ← Tells Cordova what to install
├── package.json ← NPM metadata
├── README.md ← This file
│
├── www/
│ └── callrecorder.js ← JavaScript API (what you call in your app)
│
└── src/android/ ← Android Java code (hidden from developer)
├── CallRecorderPlugin.java ← Bridge between JS and Android
├── AccessibilityRecorderService.java ← Detects call screens, records audio
├── MonitorService.java ← Heartbeat: keeps recording running
├── BootReceiver.java ← Restarts services after phone reboot
├── AppDeviceAdminReceiver.java ← Prevents accidental uninstall
└── RecordingFileProvider.java ← Handles secure file sharingAs a developer using this plugin, you only need to know about callrecorder.js. Everything in src/android/ runs automatically.
Where recordings are saved
Recordings are saved inside the app's private storage:
/data/user/0/YOUR_APP_PACKAGE/files/CallRecordings/Call_YYYYMMDD_HHmmss.m4aThey are not visible in the phone's file manager (this is intentional for privacy).
To access them, use CallRecorder.getRecordings() and CallRecorder.playRecording().
Permissions explained
The plugin adds these Android permissions automatically — you do not need to add them manually:
| Permission | Why needed |
|---|---|
| RECORD_AUDIO | To record the call audio |
| READ_PHONE_STATE | To detect when a call starts/ends |
| FOREGROUND_SERVICE | To keep recording running in background |
| WAKE_LOCK | To prevent screen turning off mid-call |
| RECEIVE_BOOT_COMPLETED | To restart services after phone reboot |
| BIND_ACCESSIBILITY_SERVICE | To detect VoIP call screens |
VoIP apps supported
These apps are hard-coded to trigger recording when their call screen opens:
- WhatsApp and WhatsApp Business
- Signal
- Telegram and Telegram X
- Google Meet
- Zoom
- Skype
- Discord
Troubleshooting
Recording is silent / file is 0 bytes:
Make sure RECORD_AUDIO is granted AND Accessibility is enabled.
"tile memory exceeded" warning in logs: Harmless WebView warning. Does not affect recording.
App crashes on first open:
This was a known bug (FOREGROUND_SERVICE_MICROPHONE required before permissions granted). Fixed in v1.0.0 by using dataSync type for MonitorService.
Call is not recorded:
- Check Accessibility is enabled (green in app UI)
- Check microphone permission is granted
- Some Android 14 devices restrict
VOICE_RECOGNITIONaudio source — try on a different device
License
Proprietary — All Rights Reserved
This plugin is the intellectual property of MGTECH LABS PRIVATE LIMITED.
- You may NOT use, copy, modify, or distribute this plugin without prior written approval.
- To request a usage license, email: [email protected]
- Website: www.kalamacademy.org
© 2026 MGTECH LABS PRIVATE LIMITED. All rights reserved.
