🛠️ Android Troubleshooting Guide
This guide provides solutions for common issues encountered when integrating and running the Pitel VoIP Android SDK.
📋 Quick Diagnostic Checklist
| Category | Common Symptom | Likely Cause & Solution |
|---|---|---|
| SIP Registration | Error code 401 / 403 | Incorrect extension, password, or domain. Verify credentials on PBX portal. |
| SIP Registration | Error code 408 / 504 | Network timeout reaching SBC proxy. Verify SBC proxy address, port 50061 / 5061, and internet firewall. |
| Push Notification | Incoming call does not ring when app is killed | FCM token not saved or Service Account not configured on Pitel Portal. Check PUSH_NOTIF.md. |
| Incoming Call UI | Call shows heads-up notification instead of full screen | Android 14+ requires USE_FULL_SCREEN_INTENT declared and granted. See FULL_SCREEN_INTENT.md. |
| Audio | No voice audio or microphone muted | RECORD_AUDIO permission not granted at runtime. |
| Bluetooth | Audio fails to route to Bluetooth headset | BLUETOOTH_CONNECT permission missing on Android 12+ (API 31+). |
| R8 / Proguard | Crashes in release build with ClassNotFoundException | Proguard keep rules stripped native PJSIP bindings. |
1. SIP Account & Registration Issues
❌ Error 401 Unauthorized / 403 Forbidden
- Cause: The SIP registrar rejected the extension credentials.
- Solution:
- Verify that
extension,password, anddomainmatch exactly with PBX configuration. - Check whether the extension is already assigned or restricted on the PBX server.
- Verify that
❌ Error 408 Request Timeout / 504 Gateway Timeout
- Cause: The device sent a SIP REGISTER request but received no response before timeout.
- Solution:
- Verify the SBC proxy address and port (e.g.,
proxy = "sip:proxy.domain.com:5061"). - Verify whether your corporate Wi-Fi or carrier network blocks SIP/TLS ports (
5060,5061,50061). Test switching between 4G/5G and Wi-Fi.
- Verify the SBC proxy address and port (e.g.,
2. Push Notification & Wake-up Issues
❌ Incoming calls ring when app is open, but fail when app is closed / killed
- Cause 1: FCM token has not been delivered to the SDK.
- Fix: Ensure
PitelClient.saveFcmToken(token)is called immediately upon obtaining the token inFirebaseMessaging.getInstance().tokenandonNewToken.
- Fix: Ensure
- Cause 2: Firebase Service Account JSON is missing or invalid on Pitel Portal.
- Fix: Re-check PORTAL_GUIDE.md and ensure the Firebase project ID matches the one configured on the Portal.
- Cause 3: Cloud Messaging API not enabled in Google Cloud Console.
- Fix: Open Google Cloud Console $\rightarrow$ APIs & Services $\rightarrow$ Enable Firebase Cloud Messaging API.
3. Full-Screen Lockscreen Call Presentation (Android 14+)
❌ Calls appear only as notification banners on the lockscreen
- Cause: Starting in Android 14 (API 34), Google restricts full-screen intent (
USE_FULL_SCREEN_INTENT) as a special app access. - Solution:
- Declare
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />in your app manifest. - Use
PitelClient.getFullScreenIntentStatus(context)to check permission. - If status is
NOT_GRANTED, guide users to open settings viaPitelClient.openFullScreenIntentSettings(context). - See complete details in FULL_SCREEN_INTENT.md.
- Declare
4. Audio Routing & Microphone Permissions
❌ Caller cannot be heard or outgoing audio is silent
- Ensure
RECORD_AUDIOandMODIFY_AUDIO_SETTINGSpermissions are declared inAndroidManifest.xmland requested at runtime before registering or making calls:if (!PitelClient.hasRequiredPermissions(this)) {
PitelClient.requestPermissions(this, requestCode = 100)
}
❌ Bluetooth headset routing does not work on Android 12+ (API 31+)
- Android 12 requires runtime Bluetooth permissions for audio routing:
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> - Request
BLUETOOTH_CONNECTpermission dynamically at runtime on Android 12+ devices.
5. Proguard / R8 Optimization in Release Builds
The SDK package automatically bundles consumer R8 rules (consumer-rules.pro). If you encounter issues in obfuscated builds, verify your app's proguard-rules.pro includes:
-keep class com.pitel.voip.sdk.** { *; }
-keep class org.pjsip.pjsua2.** { *; }
-keepclassmembers class * extends org.pjsip.pjsua2.** { *; }