Skip to main content

🛠 Troubleshooting Guide - Pitel VoIP React Native

This guide helps you resolve common integration and runtime issues when using the react-native-pitel-voip-v2 React Native package.


📱 Build & Compilation Issues​

🍎 iOS​

Issue: "Undefined symbols for architecture arm64" or PJSIP Linker Errors​

Symptoms:

  • Xcode build fails with linking errors referencing PJSIP symbols.

Solutions:

  • Physical Device Only: The underlying PJSIP static libraries are configured for physical iOS devices. Always build and run on a real iPhone.
  • Deploy Target: Open ios/Podfile and verify that the minimum deployment target is set to 14.0 or higher:
    platform :ios, '14.0'
  • Re-install Pods:
    cd ios
    pod repo update
    rm -rf Pods Podfile.lock
    pod install

Issue: Command PhaseScriptExecution failed with a nonzero exit code​

Symptoms:

  • Xcode build fails during bundling stage with an error from Metro bundler about missing modules (e.g. @babel/runtime or local packages).

Solutions:

  • Metro Configuration (Monorepo/Symlinks): If using a monorepo setup (like pnpm), configure Metro to watch the root directory and find libraries properly. Update metro.config.js to look like this:
    const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
    const path = require('path');

    const root = path.resolve(__dirname, '..');

    const config = {
    watchFolders: [root],
    resolver: {
    nodeModulesPaths: [
    path.resolve(__dirname, 'node_modules'),
    path.resolve(root, 'node_modules'),
    ],
    },
    };

    module.exports = mergeConfig(getDefaultConfig(__dirname), config);
  • Clear Metro Cache: Run the startup command with reset cache:
    npm start -- --reset-cache
    # or
    yarn start --reset-cache
    # or
    pnpm start --reset-cache

🤖 Android​

Issue: Gradle / Java version compatibility errors​

Symptoms:

  • Android build fails referencing SDK methods or class file version mismatch.

Solutions:

  • JDK 17: Ensure your development environment uses Java 17 (standard for newer React Native versions).
  • Min SDK Version: In android/build.gradle (or android/app/build.gradle), verify that the minSdkVersion is set to 24 (Android 7.0) or higher:
    buildscript {
    ext {
    minSdkVersion = 24
    }
    }

🔔 Push Notification & Wakeup Issues​

Issue: App doesn't wake up on incoming calls (Background / Terminated)​

Checklist:

  1. Simulator Limitation: iOS VoIP Push notifications do not work on simulators. You must test on a physical iPhone.
  2. Xcode Capabilities: Open your project in Xcode and go to Signing & Capabilities:
    • Verify that Push Notifications is enabled.
    • Verify that Background Modes is checked with:
      • Voice over IP
      • Background fetch
      • Remote notifications
  3. Pitel Portal Credentials:
    • For iOS: Make sure the correct .p12 VoIP certificate and Firebase Service Account .json are uploaded.
    • For Android: Make sure the Firebase Service Account .json is uploaded and matches your package name.
    • See the Pitel Portal Setup Guide for full configuration steps.

🎙 Audio Issues​

Issue: No audio or one-way audio during calls​

Solutions:

  1. Microphone Permission:
    • iOS: Ensure you added the Microphone permission usage description in ios/<YourAppName>/Info.plist:
      <key>NSMicrophoneUsageDescription</key>
      <string>We need microphone access to make VoIP calls.</string>
    • Android: Ensure the microphone permission is declared in android/app/src/main/AndroidManifest.xml:
      <uses-permission android:name="android.permission.RECORD_AUDIO" />
  2. Network/NAT issues:
    • VoIP connections can block audio if you are on restricted corporate WiFi networks or behind strict firewalls. Try switching to mobile data (4G/5G) to rule out NAT audio blocking.

🔐 Registration & Connection Issues​

Issue: Registration Status stuck on "CONNECTING..." or "NOT REGISTERED"​

Solutions:

  1. Check SIP Configuration:
    • Double-check extension, password, domain, and port configurations.
    • Ensure the domain does not contain a protocol prefix (e.g., use sip.pitel.vn instead of https://sip.pitel.vn).
  2. Network Connection:
    • Ensure the device is connected to the internet.
    • Try changing networks (WiFi to mobile data or vice versa).