Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VoIP App - iOS FreePBX Client

A complete iOS VoIP application that connects to FreePBX servers using PJSIP protocol with SRTP encryption and CallKit integration for background call handling.

Features

  • PJSIP Integration: Full SIP protocol support with PJSIP library
  • SRTP Encryption: Secure voice communication
  • CallKit Support: Native iOS call interface with background call handling
  • FreePBX Compatible: Optimized for FreePBX server connections
  • Push Notifications: VoIP push notifications for incoming calls
  • Audio Session Management: Proper handling of speaker/earpiece modes
  • Call Controls: Mute, speaker, hold/unhold functionality

Requirements

  • iOS 15.0+
  • Xcode 14.0+
  • CocoaPods
  • FreePBX server with SIP extensions configured
  • Apple Developer Account (for VoIP entitlements)

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd calltech
  2. Install dependencies:

    pod install
  3. Open the project:

    open VoIPApp.xcworkspace
  4. Configure Code Signing:

    • Update the bundle identifier in the project settings
    • Configure your Apple Developer Team
    • Ensure VoIP background modes are enabled

Configuration

FreePBX Server Setup

  1. Create a new SIP extension in your FreePBX admin panel
  2. Configure the extension with:
    • Username/Extension number
    • Strong password
    • SRTP encryption enabled (recommended)
    • NAT settings if needed

App Configuration

  1. Launch the app on your device
  2. Enter your FreePBX server details:
    • Server Address: Your FreePBX server IP or domain
    • Username: SIP extension username
    • Password: SIP extension password
    • Extension: Extension number
  3. Tap "Register" to connect to the server

Usage

Making Calls

  1. Ensure you're registered with the FreePBX server
  2. Enter the destination number in the "Number to call" field:
    • For internal extensions: Enter extension number (e.g., "1002")
    • For external numbers: Enter full number (app will add dial prefix automatically)
  3. Tap "Call" to initiate the call

Receiving Calls

  • Incoming calls will appear with the native iOS call interface
  • Accept or decline calls using standard iOS controls
  • Calls work in background and when app is closed (thanks to CallKit)

Call Controls

  • Mute: Toggle microphone on/off
  • Speaker: Switch between earpiece and speaker
  • Hangup: End the current call

Technical Architecture

Core Components

  1. PJSIPWrapper.swift: Low-level PJSIP integration with C bindings
  2. VoIPManager.swift: High-level VoIP service coordinator
  3. CallKitManager.swift: iOS CallKit integration for system call interface
  4. FreePBXConfig.swift: FreePBX-specific configuration and helpers
  5. CallViewController.swift: Main UI controller

Key Features Implementation

  • SRTP Encryption: Configured in PJSIP account settings
  • Background Calls: VoIP background mode + CallKit provider
  • Push Notifications: PKPushKit for VoIP notifications
  • Audio Session: AVAudioSession optimized for voice calls

Troubleshooting

Common Issues

  1. Registration Failed:

    • Check server address and credentials
    • Verify network connectivity
    • Ensure FreePBX allows registration from your IP
  2. No Incoming Calls:

    • Verify VoIP push notifications are working
    • Check CallKit permissions
    • Ensure app has microphone permissions
  3. Audio Issues:

    • Check microphone permissions
    • Verify audio session configuration
    • Test speaker/earpiece switching

Debug Information

The app logs important events to the console. Use Xcode's debug console to monitor:

  • PJSIP registration status
  • CallKit events
  • Audio session changes
  • Push notification deliveries

Security Considerations

  • SRTP Encryption: All voice traffic is encrypted when enabled
  • TLS Transport: Use TLS transport for signaling encryption
  • Credential Storage: User credentials are stored in UserDefaults (consider Keychain for production)
  • Network Security: Ensure your FreePBX server uses secure configurations

Building for Production

  1. Enable VoIP Entitlements:

    • Add VoIP background mode entitlement
    • Configure push notification certificates
  2. Code Signing:

    • Use Distribution certificate
    • Configure provisioning profile with VoIP services
  3. App Store Considerations:

    • Provide clear privacy policy for microphone usage
    • Document VoIP functionality in app description

License

[Add your license information here]

Support

For issues related to:

  • FreePBX: Check FreePBX documentation and community forums
  • PJSIP: Refer to PJSIP documentation
  • iOS Development: Apple Developer documentation

Contributing

[Add contribution guidelines here]

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages