A complete iOS VoIP application that connects to FreePBX servers using PJSIP protocol with SRTP encryption and CallKit integration for background call handling.
- ✅ 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
- iOS 15.0+
- Xcode 14.0+
- CocoaPods
- FreePBX server with SIP extensions configured
- Apple Developer Account (for VoIP entitlements)
-
Clone the repository:
git clone <repository-url> cd calltech
-
Install dependencies:
pod install
-
Open the project:
open VoIPApp.xcworkspace
-
Configure Code Signing:
- Update the bundle identifier in the project settings
- Configure your Apple Developer Team
- Ensure VoIP background modes are enabled
- Create a new SIP extension in your FreePBX admin panel
- Configure the extension with:
- Username/Extension number
- Strong password
- SRTP encryption enabled (recommended)
- NAT settings if needed
- Launch the app on your device
- Enter your FreePBX server details:
- Server Address: Your FreePBX server IP or domain
- Username: SIP extension username
- Password: SIP extension password
- Extension: Extension number
- Tap "Register" to connect to the server
- Ensure you're registered with the FreePBX server
- 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)
- Tap "Call" to initiate the call
- 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)
- Mute: Toggle microphone on/off
- Speaker: Switch between earpiece and speaker
- Hangup: End the current call
- PJSIPWrapper.swift: Low-level PJSIP integration with C bindings
- VoIPManager.swift: High-level VoIP service coordinator
- CallKitManager.swift: iOS CallKit integration for system call interface
- FreePBXConfig.swift: FreePBX-specific configuration and helpers
- CallViewController.swift: Main UI controller
- 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
-
Registration Failed:
- Check server address and credentials
- Verify network connectivity
- Ensure FreePBX allows registration from your IP
-
No Incoming Calls:
- Verify VoIP push notifications are working
- Check CallKit permissions
- Ensure app has microphone permissions
-
Audio Issues:
- Check microphone permissions
- Verify audio session configuration
- Test speaker/earpiece switching
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
- 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
-
Enable VoIP Entitlements:
- Add VoIP background mode entitlement
- Configure push notification certificates
-
Code Signing:
- Use Distribution certificate
- Configure provisioning profile with VoIP services
-
App Store Considerations:
- Provide clear privacy policy for microphone usage
- Document VoIP functionality in app description
[Add your license information here]
For issues related to:
- FreePBX: Check FreePBX documentation and community forums
- PJSIP: Refer to PJSIP documentation
- iOS Development: Apple Developer documentation
[Add contribution guidelines here]